summaryrefslogtreecommitdiffstats
path: root/host/config
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-12-27 13:56:09 -0800
committerJosh Blum <josh@joshknows.com>2010-12-27 13:56:09 -0800
commit3017907fd83d32e89e91f43a5d2b94d4155beddd (patch)
treefa1aa7154145481db51a4074e7319aced0ac4eb1 /host/config
parent2dfec0af4a159b4f886180a0f7448ce37a75aac1 (diff)
downloaduhd-3017907fd83d32e89e91f43a5d2b94d4155beddd.tar.gz
uhd-3017907fd83d32e89e91f43a5d2b94d4155beddd.tar.bz2
uhd-3017907fd83d32e89e91f43a5d2b94d4155beddd.zip
cmake: changes to finding python interp, some other tweaks
Diffstat (limited to 'host/config')
-rw-r--r--host/config/Python.cmake28
1 files changed, 24 insertions, 4 deletions
diff --git a/host/config/Python.cmake b/host/config/Python.cmake
index 847e7bff3..49f74ae88 100644
--- a/host/config/Python.cmake
+++ b/host/config/Python.cmake
@@ -18,13 +18,33 @@
########################################################################
# Setup Python
########################################################################
-IF(NOT DEFINED PYTHON_EXECUTABLE)
- INCLUDE(FindPythonInterp)
+#this allows the user to override PYTHON_EXECUTABLE
+IF(PYTHON_EXECUTABLE)
+ SET(PYTHONINTERP_FOUND TRUE)
+
+#otherwise if not set, try to automatically find it
+ELSE(PYTHON_EXECUTABLE)
+
+ #use the built-in find script
+ FIND_PACKAGE(PythonInterp)
+
+ #and if that fails use the find program routine
IF(NOT PYTHONINTERP_FOUND)
- MESSAGE(FATAL_ERROR "Error: Python interpretor required by the build system.")
+ FIND_PROGRAM(PYTHON_EXECUTABLE python)
+ IF(PYTHON_EXECUTABLE)
+ SET(PYTHONINTERP_FOUND TRUE)
+ ENDIF(PYTHON_EXECUTABLE)
ENDIF(NOT PYTHONINTERP_FOUND)
-ENDIF(NOT DEFINED PYTHON_EXECUTABLE)
+
+ENDIF(PYTHON_EXECUTABLE)
+
+#make the path to the executable appear in the cmake gui
+SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE PYTHON_EXECUTABLE "python interpreter")
+
+IF(NOT PYTHONINTERP_FOUND)
+ MESSAGE(FATAL_ERROR "Error: Python interpretor required by the build system.")
+ENDIF(NOT PYTHONINTERP_FOUND)
MACRO(PYTHON_CHECK_MODULE desc mod cmd have)
MESSAGE(STATUS "")