[Cmake-commits] CMake branch, next, updated. v2.8.3-680-ge96366a

Brad King brad.king at kitware.com
Mon Nov 22 14:15:55 EST 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  e96366a6950e942e8b10d9875ce96e7d555d97ea (commit)
       via  38b0a84eeaecfc587222e04bb7a425b1de1f5f00 (commit)
      from  b9b5aee2a6a761066f2f2c7fc94c93de3402b2ba (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e96366a6950e942e8b10d9875ce96e7d555d97ea
commit e96366a6950e942e8b10d9875ce96e7d555d97ea
Merge: b9b5aee 38b0a84
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 22 14:15:52 2010 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Nov 22 14:15:52 2010 -0500

    Merge topic 'FindITK-use-find_package' into next
    
    38b0a84 Modernize FindITK module (#11494)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=38b0a84eeaecfc587222e04bb7a425b1de1f5f00
commit 38b0a84eeaecfc587222e04bb7a425b1de1f5f00
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 22 13:52:58 2010 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 22 13:52:58 2010 -0500

    Modernize FindITK module (#11494)
    
    Use the Config mode of find_package to search for ITKConfig.  This makes
    FindITK a thin-wrapper around a standard find_package, bringing benefits
    like searching lib64 paths when appropriate.  This does for FindITK what
    commit 2c1a01dc (Modernize FindVTK module, 2009-10-07) did for FindVTK.

diff --git a/Modules/FindITK.cmake b/Modules/FindITK.cmake
index 244ce54..5f43dd9 100644
--- a/Modules/FindITK.cmake
+++ b/Modules/FindITK.cmake
@@ -21,7 +21,7 @@
 #                 instead.
 
 #=============================================================================
-# Copyright 2001-2009 Kitware, Inc.
+# Copyright 2001-2010 Kitware, Inc.
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
@@ -33,67 +33,23 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-SET(ITK_DIR_STRING "directory containing ITKConfig.cmake.  This is either the root of the build tree, or PREFIX/lib/InsightToolkit for an installation.")
+# Use the Config mode of the find_package() command to find ITKConfig.
+# 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
+    NAMES ITK InsightToolkit
+    CONFIGS ITKConfig.cmake
+    )
+ENDIF()
 
-# Search only if the location is not already known.
-IF(NOT ITK_DIR)
-  # Get the system search path as a list.
-  IF(UNIX)
-    STRING(REGEX MATCHALL "[^:]+" ITK_DIR_SEARCH1 "$ENV{PATH}")
-  ELSE(UNIX)
-    STRING(REGEX REPLACE "\\\\" "/" ITK_DIR_SEARCH1 "$ENV{PATH}")
-  ENDIF(UNIX)
-  STRING(REGEX REPLACE "/;" ";" ITK_DIR_SEARCH2 ${ITK_DIR_SEARCH1})
-
-  # Construct a set of paths relative to the system search path.
-  SET(ITK_DIR_SEARCH "")
-  FOREACH(dir ${ITK_DIR_SEARCH2})
-    SET(ITK_DIR_SEARCH ${ITK_DIR_SEARCH} "${dir}/../lib/InsightToolkit")
-  ENDFOREACH(dir)
-
-  #
-  # Look for an installation or build tree.
-  #
-  FIND_PATH(ITK_DIR ITKConfig.cmake
-    # Look for an environment variable ITK_DIR.
-    $ENV{ITK_DIR}
-
-    # Look in places relative to the system executable search path.
-    ${ITK_DIR_SEARCH}
-
-    # Look in standard UNIX install locations.
-    /usr/local/lib/InsightToolkit
-    /usr/lib/InsightToolkit
-
-    # Read from the CMakeSetup registry entries.  It is likely that
-    # ITK will have been recently built.
-    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild1]
-    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild2]
-    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild3]
-    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild4]
-    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild5]
-    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild6]
-    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild7]
-    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild8]
-    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild9]
-    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild10]
-
-    # Help the user find it if we cannot.
-    DOC "The ${ITK_DIR_STRING}"
-  )
-ENDIF(NOT ITK_DIR)
-
-# If ITK was found, load the configuration file to get the rest of the
-# settings.
-IF(ITK_DIR)
-  SET(ITK_FOUND 1)
-  INCLUDE(${ITK_DIR}/ITKConfig.cmake)
+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})
-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)
+ELSEIF(ITK_FIND_REQUIRED)
+  MESSAGE(FATAL_ERROR ${ITK_DIR_MESSAGE})
+ELSEIF(NOT ITK_FIND_QUIETLY)
+  MESSAGE(STATUS ${ITK_DIR_MESSAGE})
+ENDIF()

-----------------------------------------------------------------------

Summary of changes:
 Modules/FindITK.cmake |   78 ++++++++++--------------------------------------
 1 files changed, 17 insertions(+), 61 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list