summaryrefslogtreecommitdiffstats
path: root/host/config
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-09 18:38:39 -0800
committerJosh Blum <josh@joshknows.com>2010-11-09 18:38:39 -0800
commit3bca8c492514564a065e34d3284cb468873fcc8c (patch)
tree73f11afc14eb62ac1c1ff5374dce9c3cb33c0278 /host/config
parent073518083f2c7044d4b0c16948a192c5623d0752 (diff)
parentc0dfc2cf47b98734c4218427c7c6f5eb92025a9c (diff)
downloaduhd-3bca8c492514564a065e34d3284cb468873fcc8c.tar.gz
uhd-3bca8c492514564a065e34d3284cb468873fcc8c.tar.bz2
uhd-3bca8c492514564a065e34d3284cb468873fcc8c.zip
Merge branch 'master' into usrp_e_next
Diffstat (limited to 'host/config')
-rw-r--r--host/config/Python.cmake35
1 files changed, 17 insertions, 18 deletions
diff --git a/host/config/Python.cmake b/host/config/Python.cmake
index 55ef6acca..95cdb4479 100644
--- a/host/config/Python.cmake
+++ b/host/config/Python.cmake
@@ -18,32 +18,31 @@
########################################################################
# Setup Python
########################################################################
-INCLUDE(FindPythonInterp)
+IF(NOT DEFINED PYTHON_EXECUTABLE)
+ INCLUDE(FindPythonInterp)
-IF(NOT PYTHONINTERP_FOUND)
- MESSAGE(FATAL_ERROR "Error: Python interpretor required by the build system.")
-ENDIF(NOT PYTHONINTERP_FOUND)
+ IF(NOT PYTHONINTERP_FOUND)
+ MESSAGE(FATAL_ERROR "Error: Python interpretor required by the build system.")
+ ENDIF(NOT PYTHONINTERP_FOUND)
+ENDIF(NOT DEFINED PYTHON_EXECUTABLE)
-MACRO(PYTHON_CHECK_MODULE module have)
- MESSAGE(STATUS "Checking for python module ${module}")
+MACRO(PYTHON_CHECK_MODULE desc mod cmd have)
+ MESSAGE(STATUS "Python checking for ${desc}")
EXECUTE_PROCESS(
- COMMAND ${PYTHON_EXECUTABLE} -c "import ${module}"
+ COMMAND ${PYTHON_EXECUTABLE} -c "
+#########################################
+try: import ${mod}
+except: exit(-1)
+try: assert ${cmd}
+except: exit(-1)
+#########################################"
RESULT_VARIABLE ${have}
)
IF(${have} EQUAL 0)
- MESSAGE(STATUS "Checking for python module ${module} - found")
+ MESSAGE(STATUS "Python checking for ${desc} - found")
SET(${have} TRUE)
ELSE(${have} EQUAL 0)
- MESSAGE(STATUS "Checking for python module ${module} - not found")
+ MESSAGE(STATUS "Python checking for ${desc} - not found")
SET(${have} FALSE)
ENDIF(${have} EQUAL 0)
ENDMACRO(PYTHON_CHECK_MODULE)
-
-########################################################################
-# Check Modules
-########################################################################
-PYTHON_CHECK_MODULE("Cheetah" HAVE_PYTHON_MODULE_CHEETAH)
-
-IF(NOT HAVE_PYTHON_MODULE_CHEETAH)
- MESSAGE(FATAL_ERROR "Error: Cheetah Templates required by the build system.")
-ENDIF(NOT HAVE_PYTHON_MODULE_CHEETAH)