mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-21 11:54:15 +01:00
OP-910: move PYTHON definition to a qmake include file for easy reuse
This commit is contained in:
parent
f9706132f7
commit
0a53a1a89d
@ -2,6 +2,7 @@ TEMPLATE = lib
|
|||||||
TARGET = VersionInfo
|
TARGET = VersionInfo
|
||||||
|
|
||||||
include(../../openpilotgcslibrary.pri)
|
include(../../openpilotgcslibrary.pri)
|
||||||
|
include(../../python.pri)
|
||||||
|
|
||||||
HEADERS = version_info.h
|
HEADERS = version_info.h
|
||||||
SOURCES = version_info.cpp
|
SOURCES = version_info.cpp
|
||||||
@ -13,31 +14,8 @@ SOURCES = version_info.cpp
|
|||||||
# the other dependencies evaluation.
|
# 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
|
# Since debug_and_release option is set, we need this
|
||||||
!debug_and_release|build_pass {
|
!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
|
# Define other variables
|
||||||
VERSION_INFO_DIR = $$GCS_BUILD_TREE/../openpilotgcs-synthetics
|
VERSION_INFO_DIR = $$GCS_BUILD_TREE/../openpilotgcs-synthetics
|
||||||
VERSION_INFO_SCRIPT = $$ROOT_DIR/make/scripts/version-info.py
|
VERSION_INFO_SCRIPT = $$ROOT_DIR/make/scripts/version-info.py
|
||||||
|
23
ground/openpilotgcs/src/python.pri
Normal file
23
ground/openpilotgcs/src/python.pri
Normal 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)
|
Loading…
x
Reference in New Issue
Block a user