1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

gcs: fix weird Windows build error if python is called w/o quotes

This fixes two problems:
- if OPENPILOT_TOOLS_DIR is set using backslashes, they should be
  converted to forward ones. Otherwise on Windows it can't run the
  program.
- for some weird reason the python called without quotes (regardless
  of full path used or not) tries to open whole command line as a file
  instead of the 1st parameter only. This works as it should from bash
  prompt. But executed by make it fails on Windows.
This commit is contained in:
Oleg Semyonov 2013-04-19 22:54:55 +03:00
parent 491e89b165
commit 5e942bbd6d

View File

@ -17,16 +17,17 @@ PYTHON_DIR = python-2.7.4
# Search the python using environment override first
OPENPILOT_TOOLS_DIR = $$(OPENPILOT_TOOLS_DIR)
!isEmpty(OPENPILOT_TOOLS_DIR):exists($$OPENPILOT_TOOLS_DIR/$$PYTHON_DIR/python*) {
PYTHON = $$OPENPILOT_TOOLS_DIR/$$PYTHON_DIR/python
PYTHON = \"$$OPENPILOT_TOOLS_DIR/$$PYTHON_DIR/python\"
} else {
# If not found, search the predefined tools path
exists($$ROOT_DIR/tools/$$PYTHON_DIR/python*) {
PYTHON = $$ROOT_DIR/tools/$$PYTHON_DIR/python
PYTHON = \"$$ROOT_DIR/tools/$$PYTHON_DIR/python\"
} else {
# not found, hope it's in the path...
PYTHON = python
PYTHON = \"python\"
}
}
PYTHON = $$replace(PYTHON, \\\\, /)
message(Using python interpreter: $$PYTHON)
# Define other variables