From 5e942bbd6dc166cded71b2a8e00306dc87a76532 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Fri, 19 Apr 2013 22:54:55 +0300 Subject: [PATCH] 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. --- ground/openpilotgcs/src/app/gcsversioninfo.pri | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ground/openpilotgcs/src/app/gcsversioninfo.pri b/ground/openpilotgcs/src/app/gcsversioninfo.pri index 42a695695..cc1d9c629 100644 --- a/ground/openpilotgcs/src/app/gcsversioninfo.pri +++ b/ground/openpilotgcs/src/app/gcsversioninfo.pri @@ -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