Imported Upstream version 2.8.10.2
[platform/upstream/cmake.git] / Modules / FindITK.cmake
1 # - Find an ITK installation or build tree.
2
3 # When ITK is found, the ITKConfig.cmake file is sourced to setup the
4 # location and configuration of ITK.  Please read this file, or
5 # ITKConfig.cmake.in from the ITK source tree for the full list of
6 # definitions.  Of particular interest is ITK_USE_FILE, a CMake source file
7 # that can be included to set the include directories, library directories,
8 # and preprocessor macros.  In addition to the variables read from
9 # ITKConfig.cmake, this find module also defines
10 #  ITK_DIR  - The directory containing ITKConfig.cmake.
11 #             This is either the root of the build tree,
12 #             or the lib/InsightToolkit directory.
13 #             This is the only cache entry.
14 #
15 #  ITK_FOUND - Whether ITK was found.  If this is true,
16 #              ITK_DIR is okay.
17 #
18 #  USE_ITK_FILE - The full path to the UseITK.cmake file.
19 #                 This is provided for backward
20 #                 compatability.  Use ITK_USE_FILE
21 #                 instead.
22
23 #=============================================================================
24 # Copyright 2001-2010 Kitware, Inc.
25 #
26 # Distributed under the OSI-approved BSD License (the "License");
27 # see accompanying file Copyright.txt for details.
28 #
29 # This software is distributed WITHOUT ANY WARRANTY; without even the
30 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
31 # See the License for more information.
32 #=============================================================================
33 # (To distribute this file outside of CMake, substitute the full
34 #  License text for the above reference.)
35
36 # Use the Config mode of the find_package() command to find ITKConfig.
37 # If this succeeds (possibly because ITK_DIR is already set), the
38 # command will have already loaded ITKConfig.cmake and set ITK_FOUND.
39 if(NOT ITK_FOUND)
40   set(_ITK_REQUIRED "")
41   if(ITK_FIND_REQUIRED)
42     set(_ITK_REQUIRED REQUIRED)
43   endif()
44   set(_ITK_QUIET "")
45   if(ITK_FIND_QUIETLY)
46     set(_ITK_QUIET QUIET)
47   endif()
48   find_package(ITK ${_ITK_REQUIRED} ${_ITK_QUIET} NO_MODULE
49     NAMES ITK InsightToolkit
50     CONFIGS ITKConfig.cmake
51     )
52 endif()
53
54 if(ITK_FOUND)
55   # Set USE_ITK_FILE for backward-compatability.
56   set(USE_ITK_FILE ${ITK_USE_FILE})
57 endif()