Browse Source

Report a CMake error if script compilation fails

Jean-Christophe Fillion-Robin 12 years ago
parent
commit
57d5e89a0f
1 changed files with 4 additions and 0 deletions
  1. 4 0
      CMake/ctkMacroCompilePythonScript.cmake

+ 4 - 0
CMake/ctkMacroCompilePythonScript.cmake

@@ -249,7 +249,11 @@ endif()
 
 execute_process(
   COMMAND \"@PYTHON_EXECUTABLE@\" \"@compile_all_script@\"
+  RESULT_VARIABLE result_var
   )
+if(NOT result_var STREQUAL 0)
+  message(FATAL_ERROR \"Failed to compile python scripts: ${target} \")
+endif()
 ")
 
     add_custom_command(