FindITK.cmake
Go to the documentation of this file.
1 ##############################################################################
2 # @file FindITK.cmake
3 # @brief Find an ITK installation or build tree.
4 #
5 # When ITK is found, the ITKConfig.cmake file is sourced to setup the
6 # location and configuration of ITK. Please read this file, or
7 # ITKConfig.cmake.in from the ITK source tree for the full list of
8 # definitions. Of particular interest is ITK_USE_FILE, a CMake source file
9 # that can be included to set the include directories, library directories,
10 # and preprocessor macros. In addition to the variables read from
11 # ITKConfig.cmake, this find module also defines
12 #
13 # @par Output variables:
14 # <table border="0">
15 # <tr>
16 # @tp @b ITK_DIR @endtp
17 # <td>The directory containing ITKConfig.cmake.
18 # This is either the root of the build tree,
19 # or the lib/InsightToolkit directory.
20 # This is the only cache entry.</td>
21 # </tr>
22 # <tr>
23 # @tp @b ITK_FOUND @endtp
24 # <td>Whether ITK was found. If this is true, @c ITK_DIR is okay.</td>
25 # </tr>
26 # <tr>
27 # @tp @b USE_ITK_FILE @endtp
28 # <td>The full path to the <tt>UseITK.cmake</tt> file.
29 # This is provided for backward
30 # compatability. Use @c ITK_USE_FILE instead.</td>
31 # </tr>
32 # </table>
33 #
34 # @ingroup CMakeFindModules
35 ##############################################################################
36 
37 # ============================================================================
38 # Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
39 # All rights reserved.
40 #
41 # Distributed under the OSI-approved BSD License (the "License");
42 # see accompanying file Copyright.txt for details.
43 #
44 # This software is distributed WITHOUT ANY WARRANTY; without even the
45 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
46 # See the License for more information.
47 #=============================================================================
48 # (To distribute this file outside of CMake, substitute the full
49 # License text for the above reference.)
50 
51 # Use the Config mode of the find_package() command to find ITKConfig.
52 # If this succeeds (possibly because ITK_DIR is already set), the
53 # command will have already loaded ITKConfig.cmake and set ITK_FOUND.
54 IF(NOT ITK_FOUND)
55  SET(_ITK_REQUIRED "")
56  IF(ITK_FIND_REQUIRED)
57  SET(_ITK_REQUIRED REQUIRED)
58  ENDIF()
59  SET(_ITK_QUIET "")
60  IF(ITK_FIND_QUIETLY)
61  SET(_ITK_QUIET QUIET)
62  ENDIF()
63  FIND_PACKAGE(ITK ${ITK_FIND_VERSION} ${_ITK_REQUIRED} ${_ITK_QUIET} NO_MODULE
64  NAMES ITK InsightToolkit
65  CONFIGS ITKConfig.cmake
66  )
67 ENDIF()
68 
69 IF(ITK_FOUND)
70  # Set USE_ITK_FILE for backward-compatability.
71  SET(USE_ITK_FILE ${ITK_USE_FILE})
72 ENDIF()