diff options
author | Josh Blum <josh@joshknows.com> | 2010-10-28 18:23:27 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-10-28 18:23:27 -0700 |
commit | a8d2c2944b329218af1c0b171b92f775b679b409 (patch) | |
tree | 02e558d525055cb82e8d00a7a2d75fe324015ae6 /host/config/Python.cmake | |
parent | ef8ed898cbc6cb6cd1994d2a8b090112f4f3a664 (diff) | |
parent | 6a3e499f586513d48ef648aa910e252b7d8b046b (diff) | |
download | uhd-a8d2c2944b329218af1c0b171b92f775b679b409.tar.gz uhd-a8d2c2944b329218af1c0b171b92f775b679b409.tar.bz2 uhd-a8d2c2944b329218af1c0b171b92f775b679b409.zip |
Merge branch 'next'
Diffstat (limited to 'host/config/Python.cmake')
-rw-r--r-- | host/config/Python.cmake | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/host/config/Python.cmake b/host/config/Python.cmake index 55ef6acca..a5080fc40 100644 --- a/host/config/Python.cmake +++ b/host/config/Python.cmake @@ -24,26 +24,23 @@ IF(NOT PYTHONINTERP_FOUND) MESSAGE(FATAL_ERROR "Error: Python interpretor required by the build system.") ENDIF(NOT PYTHONINTERP_FOUND) -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) |