diff options
author | Brad King <brad.king@kitware.com> | 2011-04-18 18:11:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-04-18 18:11:54 (GMT) |
commit | aa170c20f7353a1781e7886b705908add569f027 (patch) | |
tree | 44e7f31539e061ba73b8562bbe4b1890279018e5 /Modules/FindITK.cmake | |
parent | 241de9e89cd8b7d1cd946a06585ae03e6031c6d8 (diff) | |
download | CMake-aa170c20f7353a1781e7886b705908add569f027.zip CMake-aa170c20f7353a1781e7886b705908add569f027.tar.gz CMake-aa170c20f7353a1781e7886b705908add569f027.tar.bz2 |
FindITK: Use passthru find_package config mode for messages
The custom error message that mentions PREFIX/lib/InsightToolkit is not
accurate for ITKv4. Just use the more generic message that find_package
generates by default. This module is now almost a no-op but exists to
tell find_package to look for the InsightToolkit name as well as ITK.
Diffstat (limited to 'Modules/FindITK.cmake')
-rw-r--r-- | Modules/FindITK.cmake | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Modules/FindITK.cmake b/Modules/FindITK.cmake index 5f43dd9..a3ca998 100644 --- a/Modules/FindITK.cmake +++ b/Modules/FindITK.cmake @@ -37,19 +37,21 @@ # If this succeeds (possibly because ITK_DIR is already set), the # command will have already loaded ITKConfig.cmake and set ITK_FOUND. IF(NOT ITK_FOUND) - FIND_PACKAGE(ITK QUIET NO_MODULE + SET(_ITK_REQUIRED "") + IF(ITK_FIND_REQUIRED) + SET(_ITK_REQUIRED REQUIRED) + ENDIF() + SET(_ITK_QUIET "") + IF(ITK_FIND_QUIETLY) + SET(_ITK_QUIET QUIET) + ENDIF() + FIND_PACKAGE(ITK ${_ITK_REQUIRED} ${_ITK_QUIET} NO_MODULE NAMES ITK InsightToolkit CONFIGS ITKConfig.cmake ) ENDIF() -SET(ITK_DIR_MESSAGE "Please set ITK_DIR to the directory containing ITKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/InsightToolkit for an installation.") - IF(ITK_FOUND) # Set USE_ITK_FILE for backward-compatability. SET(USE_ITK_FILE ${ITK_USE_FILE}) -ELSEIF(ITK_FIND_REQUIRED) - MESSAGE(FATAL_ERROR ${ITK_DIR_MESSAGE}) -ELSEIF(NOT ITK_FIND_QUIETLY) - MESSAGE(STATUS ${ITK_DIR_MESSAGE}) ENDIF() |