]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Bugfix, expose run failure to outside world
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 3 Apr 2013 15:29:44 +0000 (15:29 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 3 Apr 2013 15:29:44 +0000 (15:29 +0000)
git-svn-id: https://svn.dealii.org/trunk@29162 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake

index 376ba81509882a2016470d46afc8ab8540f3fbf3..373fb2fe607976b8eac340b5112730889a0cda41 100644 (file)
@@ -59,7 +59,12 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT)
     #
     FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run_target.cmake
       "SET(ENV{PATH} \"${DEAL_II_PATH}/${DEAL_II_LIBRARY_RELDIR}:\$ENV{PATH}\")\n"
-      "EXECUTE_PROCESS(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_RUN})"
+      "EXECUTE_PROCESS(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_RUN}\n"
+      "  RESULT_VARIABLE _return_value\n"
+      "  )\n"
+      "IF(NOT \"\${_return_value}\" STREQUAL "0")\n"
+      "  MESSAGE(SEND_ERROR \"\nProgram terminated with exit code: \${_return_value}\")\n"
+      "ENDIF()\n"
       )
     ADD_CUSTOM_TARGET(run
       COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run_target.cmake

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.