소스 검색

Merge branch 'use-cmake-message-fatal-error'

* use-cmake-message-fatal-error:
  Use message FATAL_ERROR instead of SEND_ERROR
Jean-Christophe Fillion-Robin 14 년 전
부모
커밋
5d57d659fe

+ 1 - 1
CMake/ctkFunctionDownloadData.cmake

@@ -45,7 +45,7 @@ FUNCTION( ctkFunctionDownloadData)
   # Sanity checks
   FOREACH(arg MIDAS_SERVER_URL ITEMID OUTPUT_DIRECTORY)
     IF(NOT DEFINED MY_${arg})
-      MESSAGE(SEND_ERROR "${arg} is mandatory")
+      MESSAGE(FATAL_ERROR "${arg} is mandatory")
     ENDIF()
   ENDFOREACH()
     

+ 2 - 2
CMake/ctkFunctionGeneratePluginManifest.cmake

@@ -14,7 +14,7 @@ FUNCTION(ctkFunctionGeneratePluginManifest QRC_SRCS)
 
   # Sanity checks
   IF(NOT DEFINED MY_SYMBOLIC_NAME)
-    MESSAGE(SEND_ERROR "SYMBOLIC_NAME is mandatory")
+    MESSAGE(FATAL_ERROR "SYMBOLIC_NAME is mandatory")
   ENDIF()
 
   SET(_manifest_content "Plugin-SymbolicName: ${MY_SYMBOLIC_NAME}")
@@ -24,7 +24,7 @@ FUNCTION(ctkFunctionGeneratePluginManifest QRC_SRCS)
     IF(_activation_policy STREQUAL "eager")
       SET(_manifest_content "${_manifest_content}\nPlugin-ActivationPolicy: eager")
     ELSE()
-      MESSAGE(SEND_ERROR "ACTIVATIONPOLICY is set to '${MY_ACTIVATIONPOLICY}', which is not supported")
+      MESSAGE(FATAL_ERROR "ACTIVATIONPOLICY is set to '${MY_ACTIVATIONPOLICY}', which is not supported")
     ENDIF()
   ENDIF()
 

+ 1 - 1
CMake/ctkMacroBuildApp.cmake

@@ -33,7 +33,7 @@ MACRO(ctkMacroBuildApp)
 
   # Sanity checks
   IF(NOT DEFINED MY_NAME)
-    MESSAGE(SEND_ERROR "NAME is mandatory")
+    MESSAGE(FATAL_ERROR "NAME is mandatory")
   ENDIF()
 
   # Make sure either the source or the binary directory associated with the application

+ 3 - 3
CMake/ctkMacroBuildLib.cmake

@@ -33,14 +33,14 @@ MACRO(ctkMacroBuildLib)
 
   # Sanity checks
   IF(NOT DEFINED MY_NAME)
-    MESSAGE(SEND_ERROR "NAME is mandatory")
+    MESSAGE(FATAL_ERROR "NAME is mandatory")
   ENDIF()
   STRING(REGEX MATCH "^CTK.+" valid_library_name ${MY_NAME})
   IF(NOT valid_library_name)
-    MESSAGE(SEND_ERROR "CTK library name [${MY_NAME}] should start with 'CTK' uppercase !")
+    MESSAGE(FATAL_ERROR "CTK library name [${MY_NAME}] should start with 'CTK' uppercase !")
   ENDIF()
   IF(NOT DEFINED MY_EXPORT_DIRECTIVE)
-    MESSAGE(SEND_ERROR "EXPORT_DIRECTIVE is mandatory")
+    MESSAGE(FATAL_ERROR "EXPORT_DIRECTIVE is mandatory")
   ENDIF()
   IF(NOT DEFINED MY_LIBRARY_TYPE)
     SET(MY_LIBRARY_TYPE "SHARED")

+ 1 - 1
CMake/ctkMacroBuildPlugin.cmake

@@ -55,7 +55,7 @@ MACRO(ctkMacroBuildPlugin)
 
   # Sanity checks
   IF(NOT DEFINED MY_EXPORT_DIRECTIVE)
-    MESSAGE(SEND_ERROR "EXPORT_DIRECTIVE is mandatory")
+    MESSAGE(FATAL_ERROR "EXPORT_DIRECTIVE is mandatory")
   ENDIF()
  
   # Plugin are expected to be shared library

+ 2 - 2
CMake/ctkMacroBuildQtDesignerPlugin.cmake

@@ -33,10 +33,10 @@ MACRO(ctkMacroBuildQtDesignerPlugin)
 
   # Sanity checks
   IF(NOT DEFINED MY_NAME)
-    MESSAGE(SEND_ERROR "NAME is mandatory")
+    MESSAGE(FATAL_ERROR "NAME is mandatory")
   ENDIF()
   IF(NOT DEFINED MY_EXPORT_DIRECTIVE)
-    MESSAGE(SEND_ERROR "EXPORT_DIRECTIVE is mandatory")
+    MESSAGE(FATAL_ERROR "EXPORT_DIRECTIVE is mandatory")
   ENDIF()
   IF(NOT DEFINED MY_LIBRARY_TYPE)
     SET(MY_LIBRARY_TYPE "SHARED")

+ 1 - 1
CMake/ctkMacroCompilePythonScript.cmake

@@ -24,7 +24,7 @@ MACRO(ctkMacroCompilePythonScript)
   # Sanity checks
   FOREACH(varname TARGET_NAME SCRIPTS DESTINATION_DIR INSTALL_DIR)
     IF(NOT DEFINED MY_${varname})
-      MESSAGE(SEND_ERROR "${varname} is mandatory")
+      MESSAGE(FATAL_ERROR "${varname} is mandatory")
     ENDIF()
   ENDFOREACH()
   

+ 3 - 3
CMake/ctkMacroWrapPythonQt.cmake

@@ -91,7 +91,7 @@ else: print 'TRUE'
     )
   
   IF(result)
-    MESSAGE(SEND_ERROR "reSearchFile - Problem with regex: ${regex}\n${error}")
+    MESSAGE(FATAL_ERROR "reSearchFile - Problem with regex: ${regex}\n${error}")
   ENDIF()
   SET(is_matching ${output} PARENT_SCOPE)
 ENDFUNCTION()
@@ -101,7 +101,7 @@ MACRO(ctkMacroWrapPythonQt WRAPPING_NAMESPACE TARGET SRCS_LIST_NAME SOURCES IS_W
   
   # Sanity check
   IF(IS_WRAP_FULL AND NOT EXISTS "${PYTHONQTGENERATOR_EXECUTABLE}")
-    MESSAGE(SEND_ERROR "PYTHONQTGENERATOR_EXECUTABLE not specified or inexistent when calling ctkMacroWrapPythonQt")
+    MESSAGE(FATAL_ERROR "PYTHONQTGENERATOR_EXECUTABLE not specified or inexistent when calling ctkMacroWrapPythonQt")
   ENDIF()
   
   # TODO: this find package seems not to work when called form a superbuild, but the call is needed
@@ -109,7 +109,7 @@ MACRO(ctkMacroWrapPythonQt WRAPPING_NAMESPACE TARGET SRCS_LIST_NAME SOURCES IS_W
   # package so this is a no-op.  Other uses of this file may need to have this call so it is still enabled.
   find_package(PythonInterp)
   IF(NOT PYTHONINTERP_FOUND)
-    MESSAGE(SEND_ERROR "PYTHON_EXECUTABLE not specified or inexistent when calling ctkMacroWrapPythonQt")
+    MESSAGE(FATAL_ERROR "PYTHON_EXECUTABLE not specified or inexistent when calling ctkMacroWrapPythonQt")
   ENDIF()
 
   # Extract python lib path

+ 4 - 4
CMake/ctkScriptMocPythonQtWrapper.cmake

@@ -37,14 +37,14 @@
 # Check for non-defined var
 FOREACH(var WRAPPING_NAMESPACE TARGET MOC_FLAGS WRAPPER_MASTER_MOC_FILE WRAP_INT_DIR)
   IF(NOT DEFINED ${var})
-    MESSAGE(SEND_ERROR "${var} not specified when calling ctkScriptMocPythonQtWrapper")
+    MESSAGE(FATAL_ERROR "${var} not specified when calling ctkScriptMocPythonQtWrapper")
   ENDIF()
 ENDFOREACH()
 
 # Check for non-existing ${var}
 FOREACH(var OUTPUT_DIR QT_MOC_EXECUTABLE)
   IF(NOT EXISTS ${${var}})
-    MESSAGE(SEND_ERROR "Failed to find ${var} when calling ctkScriptWrapPythonQt")
+    MESSAGE(FATAL_ERROR "Failed to find ${var} when calling ctkScriptWrapPythonQt")
   ENDIF()
 ENDFOREACH()
 
@@ -54,7 +54,7 @@ STRING(REPLACE "." "_" WRAPPING_NAMESPACE_UNDERSCORE ${WRAPPING_NAMESPACE})
 # Read moc flags from file
 IF(WIN32)
   IF(NOT EXISTS ${MOC_FLAGS})
-    MESSAGE(SEND_ERROR "On Windows, MOC_FLAGS should be the name of the file containing the moc flags !")
+    MESSAGE(FATAL_ERROR "On Windows, MOC_FLAGS should be the name of the file containing the moc flags !")
   ENDIF()
   FILE(READ ${MOC_FLAGS} MOC_FLAGS)
 ENDIF()
@@ -71,7 +71,7 @@ set(glob_expression ${OUTPUT_DIR}/${WRAP_INT_DIR}${WRAPPING_NAMESPACE_UNDERSCORE
 FILE(GLOB wrapper_headers RELATIVE ${OUTPUT_DIR}/${WRAP_INT_DIR} ${glob_expression})
 
 IF(NOT wrapper_headers)
-  MESSAGE(SEND_ERROR "ctkScriptMocPythonQtWrapper - Failed to glob wrapper headers using expression:[${glob_expression}]")
+  MESSAGE(FATAL_ERROR "ctkScriptMocPythonQtWrapper - Failed to glob wrapper headers using expression:[${glob_expression}]")
 ENDIF()
 
 # Moc'ified each one of them

+ 3 - 3
CMake/ctkScriptWrapPythonQt_Full.cmake

@@ -42,14 +42,14 @@
 # Check for non-defined var
 FOREACH(var SOURCES TARGET INCLUDE_DIRS WRAP_INT_DIR WRAPPING_NAMESPACE)
   IF(NOT DEFINED ${var})
-    MESSAGE(SEND_ERROR "${var} not specified when calling ctkScriptWrapPythonQt")
+    MESSAGE(FATAL_ERROR "${var} not specified when calling ctkScriptWrapPythonQt")
   ENDIF()
 ENDFOREACH()
 
 # Check for non-existing ${var}
 FOREACH(var PYTHONQTGENERATOR_EXECUTABLE QT_QMAKE_EXECUTABLE OUTPUT_DIR)
   IF(NOT EXISTS ${${var}})
-    MESSAGE(SEND_ERROR "Failed to find ${var} when calling ctkScriptWrapPythonQt")
+    MESSAGE(FATAL_ERROR "Failed to find ${var} when calling ctkScriptWrapPythonQt")
   ENDIF()
 ENDFOREACH()
 
@@ -108,7 +108,7 @@ FILE(WRITE ${OUTPUT_DIR}/${WRAP_INT_DIR}build_${TARGET}.txt "
 # Read include dirs from file
 IF(WIN32)
   IF(NOT EXISTS ${INCLUDE_DIRS})
-    MESSAGE(SEND_ERROR "On Windows, INCLUDE_DIRS should be the name of the file containing the include directories !")
+    MESSAGE(FATAL_ERROR "On Windows, INCLUDE_DIRS should be the name of the file containing the include directories !")
   ENDIF()
   FILE(READ ${INCLUDE_DIRS} INCLUDE_DIRS)
 ENDIF()

+ 3 - 3
CMake/ctkScriptWrapPythonQt_Light.cmake

@@ -89,7 +89,7 @@ else: print \"TRUE\"
     )
   
   IF(result)
-    MESSAGE(SEND_ERROR "reSearchFile - Problem with regex: ${regex}\n${error}")
+    MESSAGE(FATAL_ERROR "reSearchFile - Problem with regex: ${regex}\n${error}")
   ENDIF()
   #message(${output})
   SET(is_matching ${output} PARENT_SCOPE)
@@ -100,14 +100,14 @@ ENDFUNCTION()
 # Check for non-defined var
 FOREACH(var WRAPPING_NAMESPACE TARGET SOURCES INCLUDE_DIRS WRAP_INT_DIR)
   IF(NOT DEFINED ${var})
-    MESSAGE(SEND_ERROR "${var} not specified when calling ctkScriptWrapPythonQt")
+    MESSAGE(FATAL_ERROR "${var} not specified when calling ctkScriptWrapPythonQt")
   ENDIF()
 ENDFOREACH()
 
 # Check for non-existing ${var}
 FOREACH(var QT_QMAKE_EXECUTABLE OUTPUT_DIR PYTHON_EXECUTABLE PYTHON_LIBRARY_PATH)
   IF(NOT EXISTS ${${var}})
-    MESSAGE(SEND_ERROR "Failed to find ${var}=\"${${var}}\" when calling ctkScriptWrapPythonQt")
+    MESSAGE(FATAL_ERROR "Failed to find ${var}=\"${${var}}\" when calling ctkScriptWrapPythonQt")
   ENDIF()
 ENDFOREACH()