diff options
author | Brad King <brad.king@kitware.com> | 2004-04-21 11:33:47 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2004-04-21 11:33:47 -0400 |
commit | 78803c01ea0cc13c38a0c208a9012897ece5f47f (patch) | |
tree | 788f57f8d6086f3b3770bc580b21c87d7dc7c204 /Modules | |
parent | ac8232e140fdc934cff8895f5cca80fb8ab4d49f (diff) | |
download | cmake-78803c01ea0cc13c38a0c208a9012897ece5f47f.tar.gz |
ENH: Terminate with a FATAL_ERROR if FIND_PACKAGE command was called with REQUIRED argument and package was not found.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindITK.cmake | 7 | ||||
-rw-r--r-- | Modules/FindVTK.cmake | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/Modules/FindITK.cmake b/Modules/FindITK.cmake index c997505461..12d27c6897 100644 --- a/Modules/FindITK.cmake +++ b/Modules/FindITK.cmake @@ -23,6 +23,8 @@ # for backward compatability. Use ITK_USE_FILE instead. # +SET(ITK_DIR_STRING "directory containing ITKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/InsightToolkit for an installation.") + # Search only if the location is not already known. IF(NOT ITK_DIR) # Get the system search path as a list. @@ -64,7 +66,7 @@ IF(NOT ITK_DIR) [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild10] # Help the user find it if we cannot. - DOC "The directory containing ITKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/InsightToolkit for an installation." + DOC "The ${ITK_DIR_STRING}" ) ENDIF(NOT ITK_DIR) @@ -78,4 +80,7 @@ IF(ITK_DIR) SET(USE_ITK_FILE ${ITK_USE_FILE}) ELSE(ITK_DIR) SET(ITK_FOUND 0) + IF(ITK_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Please set ITK_DIR to the ${ITK_DIR_STRING}") + ENDIF(ITK_FIND_REQUIRED) ENDIF(ITK_DIR) diff --git a/Modules/FindVTK.cmake b/Modules/FindVTK.cmake index 747e320257..d2acc9a99f 100644 --- a/Modules/FindVTK.cmake +++ b/Modules/FindVTK.cmake @@ -124,5 +124,9 @@ ELSE(VTK_FOUND) # VTK not found, explain to the user how to specify its location. IF(NOT VTK_FIND_QUIETLY) MESSAGE(FATAL_ERROR ${VTK_DIR_MESSAGE}) + ELSE(NOT VTK_FIND_QUIETLY) + IF(VTK_FIND_REQUIRED) + MESSAGE(FATAL_ERROR ${VTK_DIR_MESSAGE}) + ENDIF(VTK_FIND_REQUIRED) ENDIF(NOT VTK_FIND_QUIETLY) ENDIF(VTK_FOUND) |