FindITK.cmake
Go to the documentation of this file.
00001 ############################################################################## 00002 # @file FindITK.cmake 00003 # @brief Find an ITK installation or build tree. 00004 # 00005 # When ITK is found, the ITKConfig.cmake file is sourced to setup the 00006 # location and configuration of ITK. Please read this file, or 00007 # ITKConfig.cmake.in from the ITK source tree for the full list of 00008 # definitions. Of particular interest is ITK_USE_FILE, a CMake source file 00009 # that can be included to set the include directories, library directories, 00010 # and preprocessor macros. In addition to the variables read from 00011 # ITKConfig.cmake, this find module also defines 00012 # 00013 # @par Output variables: 00014 # <table border="0"> 00015 # <tr> 00016 # @tp @b ITK_DIR @endtp 00017 # <td>The directory containing ITKConfig.cmake. 00018 # This is either the root of the build tree, 00019 # or the lib/InsightToolkit directory. 00020 # This is the only cache entry.</td> 00021 # </tr> 00022 # <tr> 00023 # @tp @b ITK_FOUND @endtp 00024 # <td>Whether ITK was found. If this is true, @c ITK_DIR is okay.</td> 00025 # </tr> 00026 # <tr> 00027 # @tp @b USE_ITK_FILE @endtp 00028 # <td>The full path to the <tt>UseITK.cmake</tt> file. 00029 # This is provided for backward 00030 # compatability. Use @c ITK_USE_FILE instead.</td> 00031 # 00032 # @verbatim 00033 # CMake - Cross Platform Makefile Generator 00034 # Copyright 2000-2009 Kitware, Inc., Insight Software Consortium 00035 # All rights reserved. 00036 # 00037 # Redistribution and use in source and binary forms, with or without 00038 # modification, are permitted provided that the following conditions 00039 # are met: 00040 # 00041 # * Redistributions of source code must retain the above copyright 00042 # notice, this list of conditions and the following disclaimer. 00043 # 00044 # * Redistributions in binary form must reproduce the above copyright 00045 # notice, this list of conditions and the following disclaimer in the 00046 # documentation and/or other materials provided with the distribution. 00047 # 00048 # * Neither the names of Kitware, Inc., the Insight Software Consortium, 00049 # nor the names of their contributors may be used to endorse or promote 00050 # products derived from this software without specific prior written 00051 # permission. 00052 # 00053 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00054 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00055 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00056 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00057 # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00058 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00059 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00060 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00061 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00062 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00063 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00064 # 00065 #------------------------------------------------------------------------------ 00066 # 00067 #The above copyright and license notice applies to distributions of 00068 #CMake in source and binary form. Some source files contain additional 00069 #notices of original copyright by their contributors; see each source 00070 #for details. Third-party software packages supplied with CMake under 00071 #compatible licenses provide their own copyright notices documented in 00072 #corresponding subdirectories. 00073 # 00074 #------------------------------------------------------------------------------ 00075 # 00076 #CMake was initially developed by Kitware with the following sponsorship: 00077 # 00078 # * National Library of Medicine at the National Institutes of Health 00079 # as part of the Insight Segmentation and Registration Toolkit (ITK). 00080 # 00081 # * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel 00082 # Visualization Initiative. 00083 # 00084 # * National Alliance for Medical Image Computing (NAMIC) is funded by the 00085 # National Institutes of Health through the NIH Roadmap for Medical Research, 00086 # Grant U54 EB005149. 00087 # 00088 # * Kitware, Inc. 00089 # @endverbatim 00090 # 00091 # @ingroup CMakeFindModules 00092 ############################################################################## 00093 00094 # Use the Config mode of the find_package() command to find ITKConfig. 00095 # If this succeeds (possibly because ITK_DIR is already set), the 00096 # command will have already loaded ITKConfig.cmake and set ITK_FOUND. 00097 IF(NOT ITK_FOUND) 00098 SET(_ITK_REQUIRED "") 00099 IF(ITK_FIND_REQUIRED) 00100 SET(_ITK_REQUIRED REQUIRED) 00101 ENDIF() 00102 SET(_ITK_QUIET "") 00103 IF(ITK_FIND_QUIETLY) 00104 SET(_ITK_QUIET QUIET) 00105 ENDIF() 00106 FIND_PACKAGE(ITK ${ITK_FIND_VERSION} ${_ITK_REQUIRED} ${_ITK_QUIET} NO_MODULE 00107 NAMES ITK InsightToolkit 00108 CONFIGS ITKConfig.cmake 00109 ) 00110 ENDIF() 00111 00112 IF(ITK_FOUND) 00113 # Set USE_ITK_FILE for backward-compatability. 00114 SET(USE_ITK_FILE ${ITK_USE_FILE}) 00115 ENDIF()