瀏覽代碼

COMP: for some reason find_package(PythonInterp) was failing when called from within the CTK-Configure target, but succeeds when called during the top level superbuild configure. This fix is better anyway, since if python is not found the error comes when running cmake rather than when running the build itself

Steve Pieper 14 年之前
父節點
當前提交
6cc57ba572
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      CMakeLists.txt

+ 4 - 0
CMakeLists.txt

@@ -379,6 +379,10 @@ ENDFOREACH()
 #-----------------------------------------------------------------------------
 # CTK Python wrapping - Propose the option only if CTK_LIB_Scriping/Python/Core is ON
 IF(CTK_LIB_Scripting/Python/Core)
+  find_package(PythonInterp)
+  IF(NOT PYTHONINTERP_FOUND)
+    MESSAGE(SEND_ERROR "PYTHON_EXECUTABLE not specified or inexistent when CTK_LIB_Scripting is enabled")
+  ENDIF()
   OPTION(CTK_WRAP_PYTHONQT_FULL "Wrap CTK classes using Qt meta-object system into Python language" OFF)
   OPTION(CTK_WRAP_PYTHONQT_LIGHT "Wrap CTK classes using Qt meta-object system into Python language" OFF)
   IF(CTK_WRAP_PYTHONQT_FULL AND CTK_WRAP_PYTHONQT_LIGHT)