1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

OP-910: move PYTHON definition to a qmake include file for easy reuse

This commit is contained in:
Oleg Semyonov 2013-06-05 16:00:43 +03:00
parent f9706132f7
commit 0a53a1a89d
2 changed files with 24 additions and 23 deletions

View File

@ -2,6 +2,7 @@ TEMPLATE = lib
TARGET = VersionInfo
include(../../openpilotgcslibrary.pri)
include(../../python.pri)
HEADERS = version_info.h
SOURCES = version_info.cpp
@ -13,31 +14,8 @@ SOURCES = version_info.cpp
# the other dependencies evaluation.
#
# We use python to extract git version info, but it may be installed locally.
# This expected python version should be kept in sync with make/tools.mk.
PYTHON_DIR = python-2.7.4
# Since debug_and_release option is set, we need this
!debug_and_release|build_pass {
ROOT_DIR = $$GCS_SOURCE_TREE/../..
# 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\"
} else {
# If not found, search the predefined tools path
exists($$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 = $$replace(PYTHON, \\\\, /)
message(Using python interpreter: $$PYTHON)
# Define other variables
VERSION_INFO_DIR = $$GCS_BUILD_TREE/../openpilotgcs-synthetics
VERSION_INFO_SCRIPT = $$ROOT_DIR/make/scripts/version-info.py

View File

@ -0,0 +1,23 @@
# We use python to extract git version info and generate some other files,
# but it may be installed locally. The expected python version should be
# kept in sync with make/tools.mk.
PYTHON_DIR = python-2.7.4
ROOT_DIR = $$GCS_SOURCE_TREE/../..
# 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\"
} else {
# If not found, search the predefined tools path
exists($$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 = $$replace(PYTHON, \\\\, /)
message(Using python interpreter: $$PYTHON)