summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2017-01-12 21:43:48 +0100
committerSebastian Koslowski <koslowski@kit.edu>2017-01-23 21:33:37 +0100
commit395bd4415cc92217886d0f2a4f026a6070e1748b (patch)
tree5fc558976017b17ccf19d2b69e8f3ed2342ff9cf /cmake
parent98806de9e5b623b8301426f648e097f408369316 (diff)
grc: gtk3: update cmake requirements
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/GrPython.cmake28
1 files changed, 17 insertions, 11 deletions
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake
index 49461e5319..b5cbc4cec2 100644
--- a/cmake/Modules/GrPython.cmake
+++ b/cmake/Modules/GrPython.cmake
@@ -77,11 +77,25 @@ endif(PYTHON_EXECUTABLE)
# - cmd an additional command to run
# - have the result variable to set
########################################################################
+macro(GR_PYTHON_CHECK_MODULE_RAW desc python_code have)
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} -c "${python_code}"
+ RESULT_VARIABLE return_code
+ )
+ if(return_code EQUAL 0)
+ message(STATUS "Python checking for ${desc} - found")
+ set(${have} TRUE)
+ else()
+ message(STATUS "Python checking for ${desc} - not found")
+ set(${have} FALSE)
+ endif()
+endmacro(GR_PYTHON_CHECK_MODULE_RAW)
+
macro(GR_PYTHON_CHECK_MODULE desc mod cmd have)
message(STATUS "")
message(STATUS "Python checking for ${desc}")
- execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -c "
+ GR_PYTHON_CHECK_MODULE_RAW(
+ "${desc}" "
#########################################
try:
import ${mod}
@@ -89,15 +103,7 @@ try:
except ImportError, AssertionError: exit(-1)
except: pass
#########################################"
- RESULT_VARIABLE ${have}
- )
- if(${have} EQUAL 0)
- message(STATUS "Python checking for ${desc} - found")
- set(${have} TRUE)
- else(${have} EQUAL 0)
- message(STATUS "Python checking for ${desc} - not found")
- set(${have} FALSE)
- endif(${have} EQUAL 0)
+ "${have}")
endmacro(GR_PYTHON_CHECK_MODULE)
########################################################################