[Cmake-commits] CMake branch, next, updated. v2.8.7-2756-g63152d0

Brad King brad.king at kitware.com
Tue Feb 21 15:45:47 EST 2012


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  63152d002f40c9426845246aef04636ce416e72c (commit)
       via  35c48e12706f9426eda43b3b077925a2fab0df44 (commit)
       via  61cb4ea72e608370b581bae9d9810ca6ae8f84d0 (commit)
       via  c9f2886b3db9783eaa455c21288eabdc7e6366a1 (commit)
       via  628f36514070037dd3dc4f09c61c4df8688e3a2b (commit)
      from  82c3726537c24183459270355db507a638ee07e1 (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=63152d002f40c9426845246aef04636ce416e72c
commit 63152d002f40c9426845246aef04636ce416e72c
Merge: 82c3726 35c48e1
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 21 15:45:33 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Feb 21 15:45:33 2012 -0500

    Merge topic 'HandleTargetsInCMakeRequiredLibraries' into next
    
    35c48e1 Check*.cmake: Expand imported targets in CMAKE_REQUIRED_LIBRARIES
    61cb4ea bootstrap: move while() and endwhile() into the bootstrap build
    c9f2886 -don't pull in CheckTypeSize.cmake from the cmake which is being built
    628f365 -remove trailing whitespace


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=35c48e12706f9426eda43b3b077925a2fab0df44
commit 35c48e12706f9426eda43b3b077925a2fab0df44
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Thu Feb 16 23:35:43 2012 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 21 15:38:15 2012 -0500

    Check*.cmake: Expand imported targets in CMAKE_REQUIRED_LIBRARIES
    
    Add the function cmake_expand_imported_targets() to expand imported
    targets in a list of libraries into their on-disk file names for a
    particular configuration.  Adapt the implementation from KDE's
    HANDLE_IMPORTED_TARGETS_IN_CMAKE_REQUIRED_LIBRARIES which has been in
    use for over 2 years.  Call the function from all the Check*.cmake
    macros to handle imported targets named in CMAKE_REQUIRED_LIBRARIES.
    
    Alex

diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake
new file mode 100644
index 0000000..fba071a
--- /dev/null
+++ b/Modules/CMakeExpandImportedTargets.cmake
@@ -0,0 +1,129 @@
+# CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
+#                                     [CONFIGURATION <config>] )
+#
+# CMAKE_EXPAND_IMPORTED_TARGETS() takes a list of libraries and replaces
+# all imported targets contained in this list with their actual file paths
+# of the referenced libraries on disk, including the libraries from their
+# link interfaces.
+# If a CONFIGURATION is given, it uses the respective configuration of the
+# imported targets if it exists. If no CONFIGURATION is given, it uses
+# the first configuration from ${CMAKE_CONFIGURATION_TYPES} if set, otherwise
+# ${CMAKE_BUILD_TYPE}.
+# This macro is used by all Check*.cmake files which use
+# TRY_COMPILE() or TRY_RUN() and support CMAKE_REQUIRED_LIBRARIES , so that
+# these checks support imported targets in CMAKE_REQUIRED_LIBRARIES:
+#    cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
+#                                               CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
+
+
+#=============================================================================
+# Copyright 2012 Kitware, Inc.
+# Copyright 2009-2012 Alexander Neundorf <neundorf at kde.org>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+include(CMakeParseArguments)
+
+function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
+
+   set(options )
+   set(oneValueArgs CONFIGURATION )
+   set(multiValueArgs LIBRARIES )
+
+   cmake_parse_arguments(CEIT "${options}" "${oneValueArgs}" "${multiValueArgs}"  ${ARGN})
+
+   if(CEIT_UNPARSED_ARGUMENTS)
+      message(FATAL_ERROR "Unknown keywords given to CMAKE_EXPAND_IMPORTED_TARGETS(): \"${CEIT_UNPARSED_ARGUMENTS}\"")
+   endif()
+
+   if(NOT CEIT_CONFIGURATION)
+      if(CMAKE_CONFIGURATION_TYPES)
+         list(GET CMAKE_CONFIGURATION_TYPES 0 CEIT_CONFIGURATION)
+      else()
+         set(CEIT_CONFIGURATION ${CMAKE_BUILD_TYPE})
+      endif()
+   endif()
+
+   # handle imported library targets
+
+   set(_CCSR_REQ_LIBS ${CEIT_LIBRARIES})
+
+   set(_CHECK_FOR_IMPORTED_TARGETS TRUE)
+   set(_CCSR_LOOP_COUNTER 0)
+   while(_CHECK_FOR_IMPORTED_TARGETS)
+      math(EXPR _CCSR_LOOP_COUNTER "${_CCSR_LOOP_COUNTER} + 1 ")
+      set(_CCSR_NEW_REQ_LIBS )
+      set(_CHECK_FOR_IMPORTED_TARGETS FALSE)
+      foreach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
+         get_target_property(_importedConfigs "${_CURRENT_LIB}" IMPORTED_CONFIGURATIONS)
+         if (_importedConfigs)
+#            message(STATUS "Detected imported target ${_CURRENT_LIB}")
+            # Ok, so this is an imported target.
+            # First we get the imported configurations.
+            # Then we get the location of the actual library on disk of the first configuration.
+            # then we'll get its link interface libraries property,
+            # iterate through it and replace all imported targets we find there
+            # with there actual location.
+
+            # guard against infinite loop: abort after 100 iterations ( 100 is arbitrary chosen)
+            if ("${_CCSR_LOOP_COUNTER}" LESS 100)
+               set(_CHECK_FOR_IMPORTED_TARGETS TRUE)
+#                else ("${_CCSR_LOOP_COUNTER}" LESS 1)
+#                   message(STATUS "********* aborting loop, counter : ${_CCSR_LOOP_COUNTER}")
+            endif ("${_CCSR_LOOP_COUNTER}" LESS 100)
+
+            # if one of the imported configurations equals ${CMAKE_TRY_COMPILE_CONFIGURATION},
+            # use it, otherwise simply use the first one:
+            list(FIND _importedConfigs "${CEIT_CONFIGURATION}" _configIndexToUse)
+            if("${_configIndexToUse}" EQUAL -1)
+              set(_configIndexToUse 0)
+            endif("${_configIndexToUse}" EQUAL -1)
+            list(GET _importedConfigs ${_configIndexToUse} _importedConfigToUse)
+
+            get_target_property(_importedLocation "${_CURRENT_LIB}" IMPORTED_LOCATION_${_importedConfigToUse})
+            get_target_property(_linkInterfaceLibs "${_CURRENT_LIB}" IMPORTED_LINK_INTERFACE_LIBRARIES_${_importedConfigToUse} )
+
+            list(APPEND _CCSR_NEW_REQ_LIBS  "${_importedLocation}")
+#            message(STATUS "Appending lib ${_CURRENT_LIB} as ${_importedLocation}")
+            if(_linkInterfaceLibs)
+               foreach(_currentLinkInterfaceLib ${_linkInterfaceLibs})
+#                  message(STATUS "Appending link interface lib ${_currentLinkInterfaceLib}")
+                  if(_currentLinkInterfaceLib)
+                     list(APPEND _CCSR_NEW_REQ_LIBS "${_currentLinkInterfaceLib}" )
+                  endif(_currentLinkInterfaceLib)
+               endforeach(_currentLinkInterfaceLib "${_linkInterfaceLibs}")
+            endif(_linkInterfaceLibs)
+         else(_importedConfigs)
+            # "Normal" libraries are just used as they are.
+            list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
+#            message(STATUS "Appending lib directly: ${_CURRENT_LIB}")
+         endif(_importedConfigs)
+      endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
+
+      set(_CCSR_REQ_LIBS ${_CCSR_NEW_REQ_LIBS} )
+   endwhile(_CHECK_FOR_IMPORTED_TARGETS)
+
+   # Finally we iterate once more over all libraries. This loop only removes
+   # all remaining imported target names (there shouldn't be any left anyway).
+   set(_CCSR_NEW_REQ_LIBS )
+   foreach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
+      get_target_property(_importedConfigs "${_CURRENT_LIB}" IMPORTED_CONFIGURATIONS)
+      if (NOT _importedConfigs)
+         list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
+#         message(STATUS "final: appending ${_CURRENT_LIB}")
+      else (NOT _importedConfigs)
+#             message(STATUS "final: skipping ${_CURRENT_LIB}")
+      endif (NOT _importedConfigs)
+   endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
+#   message(STATUS "setting -${_RESULT}- to -${_CCSR_NEW_REQ_LIBS}-")
+   set(${_RESULT} "${_CCSR_NEW_REQ_LIBS}" PARENT_SCOPE)
+
+endfunction()
diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake
index d59fe55..2669336 100644
--- a/Modules/CheckCSourceCompiles.cmake
+++ b/Modules/CheckCSourceCompiles.cmake
@@ -24,6 +24,9 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
+INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+
+
 MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
   IF("${VAR}" MATCHES "^${VAR}$")
     SET(_FAIL_REGEX)
@@ -40,8 +43,10 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
     SET(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
     IF(CMAKE_REQUIRED_LIBRARIES)
+      # this one translates potentially used imported library targets to their files on disk
+      CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
-        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+        "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
     ELSE(CMAKE_REQUIRED_LIBRARIES)
       SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
     ENDIF(CMAKE_REQUIRED_LIBRARIES)
diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake
index cdcde04..feee93a 100644
--- a/Modules/CheckCSourceRuns.cmake
+++ b/Modules/CheckCSourceRuns.cmake
@@ -24,13 +24,18 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
+INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+
+
 MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
   IF("${VAR}" MATCHES "^${VAR}$")
     SET(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
     IF(CMAKE_REQUIRED_LIBRARIES)
+      # this one translates potentially used imported library targets to their files on disk
+      CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
-        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+        "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
     ELSE(CMAKE_REQUIRED_LIBRARIES)
       SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
     ENDIF(CMAKE_REQUIRED_LIBRARIES)
diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake
index 0491b37..7f7336e 100644
--- a/Modules/CheckCXXSourceCompiles.cmake
+++ b/Modules/CheckCXXSourceCompiles.cmake
@@ -24,6 +24,9 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
+INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+
+
 MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
   IF("${VAR}" MATCHES "^${VAR}$")
     SET(_FAIL_REGEX)
@@ -41,8 +44,10 @@ MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
     SET(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
     IF(CMAKE_REQUIRED_LIBRARIES)
+      # this one translates potentially used imported library targets to their files on disk
+      CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
-        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+        "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
     ELSE(CMAKE_REQUIRED_LIBRARIES)
       SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
     ENDIF(CMAKE_REQUIRED_LIBRARIES)
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index dc00701..cd68d57 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -24,13 +24,18 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
+INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+
+
 MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
   IF("${VAR}" MATCHES "^${VAR}$")
     SET(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
     IF(CMAKE_REQUIRED_LIBRARIES)
+      # this one translates potentially used imported library targets to their files on disk
+      CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
-        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+        "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
     ELSE(CMAKE_REQUIRED_LIBRARIES)
       SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
     ENDIF(CMAKE_REQUIRED_LIBRARIES)
diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake
index e0f0158..abec9f7 100644
--- a/Modules/CheckFortranFunctionExists.cmake
+++ b/Modules/CheckFortranFunctionExists.cmake
@@ -22,12 +22,17 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
+INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+
+
 macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
   if(NOT DEFINED ${VARIABLE})
     message(STATUS "Looking for Fortran ${FUNCTION}")
     if(CMAKE_REQUIRED_LIBRARIES)
+      # this one translates potentially used imported library targets to their files on disk
+      cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
-        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+        "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
     else(CMAKE_REQUIRED_LIBRARIES)
       set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
     endif(CMAKE_REQUIRED_LIBRARIES)
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index 6f9e9d1..8c469f0 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -27,14 +27,19 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
+INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+
+
 MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
   IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
     SET(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
     MESSAGE(STATUS "Looking for ${FUNCTION}")
     IF(CMAKE_REQUIRED_LIBRARIES)
+      # this one translates potentially used imported library targets to their files on disk
+      CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
-        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+        "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
     ELSE(CMAKE_REQUIRED_LIBRARIES)
       SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
     ENDIF(CMAKE_REQUIRED_LIBRARIES)
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake
index a170e7a..59fca0a 100644
--- a/Modules/CheckLibraryExists.cmake
+++ b/Modules/CheckLibraryExists.cmake
@@ -26,6 +26,9 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
+INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+
+
 MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
   IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
     SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION
@@ -33,8 +36,10 @@ MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
     MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
     SET(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
     IF(CMAKE_REQUIRED_LIBRARIES)
+      # this one translates potentially used imported library targets to their files on disk
+      CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       SET(CHECK_LIBRARY_EXISTS_LIBRARIES
-        ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES})
+        ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES})
     ENDIF(CMAKE_REQUIRED_LIBRARIES)
     TRY_COMPILE(${VARIABLE}
       ${CMAKE_BINARY_DIR}
diff --git a/Modules/CheckPrototypeDefinition.cmake b/Modules/CheckPrototypeDefinition.cmake
index 244b9b5..63d4242 100644
--- a/Modules/CheckPrototypeDefinition.cmake
+++ b/Modules/CheckPrototypeDefinition.cmake
@@ -34,8 +34,11 @@
 #  License text for the above reference.)
 #
 
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+
 get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
 
+
 function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE)
 
   if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
@@ -43,8 +46,10 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
 
     set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS})
     if (CMAKE_REQUIRED_LIBRARIES)
+      # this one translates potentially used imported library targets to their files on disk
+      cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       set(CHECK_PROTOTYPE_DEFINITION_LIBS
-        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+        "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
     else(CMAKE_REQUIRED_LIBRARIES)
       set(CHECK_PROTOTYPE_DEFINITION_LIBS)
     endif(CMAKE_REQUIRED_LIBRARIES)
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index 515319d..e6e677d 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -35,6 +35,9 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
+INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+
+
 MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
   _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
 ENDMACRO(CHECK_SYMBOL_EXISTS)
@@ -44,8 +47,10 @@ MACRO(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
     SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
     SET(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
     IF(CMAKE_REQUIRED_LIBRARIES)
+      # this one translates potentially used imported library targets to their files on disk
+      CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       SET(CHECK_SYMBOL_EXISTS_LIBS
-        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+        "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
     ELSE(CMAKE_REQUIRED_LIBRARIES)
       SET(CHECK_SYMBOL_EXISTS_LIBS)
     ENDIF(CMAKE_REQUIRED_LIBRARIES)
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 5d5c931..1717718 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -47,6 +47,7 @@
 #  License text for the above reference.)
 
 include(CheckIncludeFile)
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
 
 cmake_policy(PUSH)
 cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
@@ -76,6 +77,10 @@ function(__check_type_size_impl type var map builtin)
   endforeach()
 
   # Perform the check.
+
+  # this one translates potentially used imported library targets to their files on disk
+  cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
+
   set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c)
   set(bin ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.bin)
   configure_file(${__check_type_size_dir}/CheckTypeSize.c.in ${src} @ONLY)
@@ -84,7 +89,7 @@ function(__check_type_size_impl type var map builtin)
     CMAKE_FLAGS
       "-DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}"
       "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}"
-      "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}"
+      "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}"
     OUTPUT_VARIABLE output
     COPY_FILE ${bin}
     )
diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake
index 8517002..7d6c794 100644
--- a/Modules/CheckVariableExists.cmake
+++ b/Modules/CheckVariableExists.cmake
@@ -26,14 +26,19 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
+INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+
+
 MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
   IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
     SET(MACRO_CHECK_VARIABLE_DEFINITIONS
       "-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}")
     MESSAGE(STATUS "Looking for ${VAR}")
     IF(CMAKE_REQUIRED_LIBRARIES)
+      # this one translates potentially used imported library targets to their files on disk
+      CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
-        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+        "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
     ELSE(CMAKE_REQUIRED_LIBRARIES)
       SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES)
     ENDIF(CMAKE_REQUIRED_LIBRARIES)
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index e65e362..a21e1b0 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -137,3 +137,14 @@ add_library(imp_lib1 STATIC imp_lib1.c)
 target_link_libraries(imp_lib1 exp_testLib2)
 add_library(imp_lib1b STATIC imp_lib1.c)
 target_link_libraries(imp_lib1b bld_testLib2)
+
+#-----------------------------------------------------------------------------
+# Test that handling imported targets, including transitive dependencies,
+# works in CheckFunctionExists (...and hopefully all other try_compile() checks
+include(CheckFunctionExists)
+unset(HAVE_TESTLIB1_FUNCTION CACHE)
+set(CMAKE_REQUIRED_LIBRARIES exp_testLib2)
+check_function_exists(testLib1 HAVE_TESTLIB1_FUNCTION)
+if (NOT HAVE_TESTLIB1_FUNCTION)
+  message(SEND_ERROR "Using imported target testLib2 in check_function_exists() failed !")
+endif()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=61cb4ea72e608370b581bae9d9810ca6ae8f84d0
commit 61cb4ea72e608370b581bae9d9810ca6ae8f84d0
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Fri Feb 17 16:42:06 2012 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 21 15:33:40 2012 -0500

    bootstrap: move while() and endwhile() into the bootstrap build
    
    Alex

diff --git a/Source/cmBootstrapCommands.cxx b/Source/cmBootstrapCommands.cxx
index cb5dc4c..9097a74 100644
--- a/Source/cmBootstrapCommands.cxx
+++ b/Source/cmBootstrapCommands.cxx
@@ -38,6 +38,7 @@
 #include "cmEndFunctionCommand.cxx"
 #include "cmEndIfCommand.cxx"
 #include "cmEndMacroCommand.cxx"
+#include "cmEndWhileCommand.cxx"
 #include "cmExecProgramCommand.cxx"
 #include "cmExecuteProcessCommand.cxx"
 #include "cmExternalMakefileProjectGenerator.cxx"
@@ -91,6 +92,7 @@
 #include "cmTryCompileCommand.cxx"
 #include "cmTryRunCommand.cxx"
 #include "cmUnsetCommand.cxx"
+#include "cmWhileCommand.cxx"
 
 void GetBootstrapCommands(std::list<cmCommand*>& commands)
 {
@@ -116,6 +118,7 @@ void GetBootstrapCommands(std::list<cmCommand*>& commands)
   commands.push_back(new cmEndFunctionCommand);
   commands.push_back(new cmEndIfCommand);
   commands.push_back(new cmEndMacroCommand);
+  commands.push_back(new cmEndWhileCommand);
   commands.push_back(new cmExecProgramCommand);
   commands.push_back(new cmExecuteProcessCommand);
   commands.push_back(new cmFileCommand);
@@ -164,4 +167,5 @@ void GetBootstrapCommands(std::list<cmCommand*>& commands)
   commands.push_back(new cmTryCompileCommand);
   commands.push_back(new cmTryRunCommand);
   commands.push_back(new cmUnsetCommand);
+  commands.push_back(new cmWhileCommand);
 }
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index bb1e4e2..49ed967 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -14,7 +14,6 @@
 #include "cmAuxSourceDirectoryCommand.cxx"
 #include "cmBuildNameCommand.cxx"
 #include "cmElseIfCommand.cxx"
-#include "cmEndWhileCommand.cxx"
 #include "cmExportCommand.cxx"
 #include "cmExportLibraryDependencies.cxx"
 #include "cmFLTKWrapUICommand.cxx"
@@ -34,7 +33,6 @@
 #include "cmVariableRequiresCommand.cxx"
 #include "cmVariableWatchCommand.cxx"
 
-#include "cmWhileCommand.cxx"
 #include "cmWriteFileCommand.cxx"
 
 // This one must be last because it includes windows.h and
@@ -53,7 +51,6 @@ void GetPredefinedCommands(std::list<cmCommand*>&
   commands.push_back(new cmAuxSourceDirectoryCommand);
   commands.push_back(new cmBuildNameCommand);
   commands.push_back(new cmElseIfCommand);
-  commands.push_back(new cmEndWhileCommand);
   commands.push_back(new cmExportCommand);
   commands.push_back(new cmExportLibraryDependenciesCommand);
   commands.push_back(new cmFLTKWrapUICommand);
@@ -73,7 +70,6 @@ void GetPredefinedCommands(std::list<cmCommand*>&
   commands.push_back(new cmUtilitySourceCommand);
   commands.push_back(new cmVariableRequiresCommand);
   commands.push_back(new cmVariableWatchCommand);
-  commands.push_back(new cmWhileCommand);
   commands.push_back(new cmWriteFileCommand);
 #endif
 }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c9f2886b3db9783eaa455c21288eabdc7e6366a1
commit c9f2886b3db9783eaa455c21288eabdc7e6366a1
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Thu Feb 16 10:31:32 2012 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 21 15:33:39 2012 -0500

    -don't pull in CheckTypeSize.cmake from the cmake which is being built
    
    We can be sure that at least cmake 2.6.3 is used when building cmcurl.
    This means we always get in the first branch of the if().
    I think it is not a good idea to pull a cmake module from the cmake
    which is being built in, since this may use features which are not
    supported in the cmake which is used to build cmake (e.g. CMAKE_CURRENT_LIST_DIR
    which does not exist in cmake 2.6.3 which is the minimum for cmcurl).
    
    A bit further below there is anyway code to handle the case that cmake is
    older than 2.8.0, so it should be ok.
    
    Alex

diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index e700ed8..ef300bd 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -33,12 +33,7 @@ INCLUDE (CheckIncludeFile)
 INCLUDE (CheckIncludeFiles)
 INCLUDE (CheckLibraryExists)
 INCLUDE (CheckSymbolExists)
-IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4
-    AND CMake_SOURCE_DIR)
-  INCLUDE (${CMake_SOURCE_DIR}/Modules/CheckTypeSize.cmake)
-ELSE()
-  INCLUDE (CheckTypeSize)
-ENDIF()
+INCLUDE (CheckTypeSize)
 
 SET(libCurl_SRCS
   #  amigaos.c - does not build on AmigaOS

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=628f36514070037dd3dc4f09c61c4df8688e3a2b
commit 628f36514070037dd3dc4f09c61c4df8688e3a2b
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Wed Jan 18 21:55:52 2012 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 21 15:33:31 2012 -0500

    -remove trailing whitespace
    
    Alex

diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake
index 764c756..cdcde04 100644
--- a/Modules/CheckCSourceRuns.cmake
+++ b/Modules/CheckCSourceRuns.cmake
@@ -26,7 +26,7 @@
 
 MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
   IF("${VAR}" MATCHES "^${VAR}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS 
+    SET(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
     IF(CMAKE_REQUIRED_LIBRARIES)
       SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
@@ -61,7 +61,7 @@ MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
     IF("${${VAR}_EXITCODE}" EQUAL 0)
       SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
       MESSAGE(STATUS "Performing Test ${VAR} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}}\n"
@@ -74,7 +74,7 @@ MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
       ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
 
       MESSAGE(STATUS "Performing Test ${VAR} - Failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}_EXITCODE}\n"
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index ace60d1..dc00701 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -26,7 +26,7 @@
 
 MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
   IF("${VAR}" MATCHES "^${VAR}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS 
+    SET(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
     IF(CMAKE_REQUIRED_LIBRARIES)
       SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
@@ -62,9 +62,9 @@ MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
     IF("${${VAR}_EXITCODE}" EQUAL 0)
       SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
       MESSAGE(STATUS "Performing Test ${VAR} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
-        "${OUTPUT}\n" 
+        "${OUTPUT}\n"
         "Return value: ${${VAR}}\n"
         "Source file was:\n${SOURCE}\n")
     ELSE("${${VAR}_EXITCODE}" EQUAL 0)
@@ -75,9 +75,9 @@ MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
       ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
 
       MESSAGE(STATUS "Performing Test ${VAR} - Failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
-        "${OUTPUT}\n"  
+        "${OUTPUT}\n"
         "Return value: ${${VAR}_EXITCODE}\n"
         "Source file was:\n${SOURCE}\n")
     ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake
index 6e932d0..e0f0158 100644
--- a/Modules/CheckFortranFunctionExists.cmake
+++ b/Modules/CheckFortranFunctionExists.cmake
@@ -50,13 +50,13 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
     if(${VARIABLE})
       set(${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}")
       message(STATUS "Looking for Fortran ${FUNCTION} - found")
-      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n"
         "${OUTPUT}\n\n")
     else(${VARIABLE})
       message(STATUS "Looking for Fortran ${FUNCTION} - not found")
       set(${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}")
-      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n"
         "${OUTPUT}\n\n")
     endif(${VARIABLE})
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index 0ba36d9..6f9e9d1 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -29,7 +29,7 @@
 
 MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
   IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS 
+    SET(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
     MESSAGE(STATUS "Looking for ${FUNCTION}")
     IF(CMAKE_REQUIRED_LIBRARIES)
@@ -55,13 +55,13 @@ MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
     IF(${VARIABLE})
       SET(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")
       MESSAGE(STATUS "Looking for ${FUNCTION} - found")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the function ${FUNCTION} exists passed with the following output:\n"
         "${OUTPUT}\n\n")
     ELSE(${VARIABLE})
       MESSAGE(STATUS "Looking for ${FUNCTION} - not found")
       SET(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the function ${FUNCTION} exists failed with the following output:\n"
         "${OUTPUT}\n\n")
     ENDIF(${VARIABLE})
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake
index caf4f4c..a170e7a 100644
--- a/Modules/CheckLibraryExists.cmake
+++ b/Modules/CheckLibraryExists.cmake
@@ -28,19 +28,19 @@
 
 MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
   IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-    SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION 
+    SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION
       "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
     MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
     SET(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
     IF(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_LIBRARY_EXISTS_LIBRARIES 
+      SET(CHECK_LIBRARY_EXISTS_LIBRARIES
         ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES})
     ENDIF(CMAKE_REQUIRED_LIBRARIES)
     TRY_COMPILE(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_ROOT}/Modules/CheckFunctionExists.c
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-      CMAKE_FLAGS 
+      CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_LIBRARY_EXISTS_DEFINITION}
       -DLINK_DIRECTORIES:STRING=${LOCATION}
       "-DLINK_LIBRARIES:STRING=${CHECK_LIBRARY_EXISTS_LIBRARIES}"
@@ -49,14 +49,14 @@ MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
     IF(${VARIABLE})
       MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found")
       SET(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
         "passed with the following output:\n"
         "${OUTPUT}\n\n")
     ELSE(${VARIABLE})
       MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
       SET(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
         "failed with the following output:\n"
         "${OUTPUT}\n\n")
diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake
index 9832891..8517002 100644
--- a/Modules/CheckVariableExists.cmake
+++ b/Modules/CheckVariableExists.cmake
@@ -1,6 +1,6 @@
 # - Check if the variable exists.
 #  CHECK_VARIABLE_EXISTS(VAR VARIABLE)
-#  
+#
 #  VAR      - the name of the variable
 #  VARIABLE - variable to store the result
 #
@@ -28,7 +28,7 @@
 
 MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
   IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-    SET(MACRO_CHECK_VARIABLE_DEFINITIONS 
+    SET(MACRO_CHECK_VARIABLE_DEFINITIONS
       "-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}")
     MESSAGE(STATUS "Looking for ${VAR}")
     IF(CMAKE_REQUIRED_LIBRARIES)
@@ -47,13 +47,13 @@ MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
     IF(${VARIABLE})
       SET(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}")
       MESSAGE(STATUS "Looking for ${VAR} - found")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the variable ${VAR} exists passed with the following output:\n"
         "${OUTPUT}\n\n")
     ELSE(${VARIABLE})
       SET(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}")
       MESSAGE(STATUS "Looking for ${VAR} - not found")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the variable ${VAR} exists failed with the following output:\n"
         "${OUTPUT}\n\n")
     ENDIF(${VARIABLE})
diff --git a/Source/cmBootstrapCommands.cxx b/Source/cmBootstrapCommands.cxx
index 554f452..cb5dc4c 100644
--- a/Source/cmBootstrapCommands.cxx
+++ b/Source/cmBootstrapCommands.cxx
@@ -12,7 +12,7 @@
 // This file is used to compile all the commands
 // that CMake knows about at compile time.
 // This is sort of a boot strapping approach since you would
-// like to have CMake to build CMake.   
+// like to have CMake to build CMake.
 #include "cmCommands.h"
 #include "cmAddCustomCommandCommand.cxx"
 #include "cmAddCustomTargetCommand.cxx"
@@ -111,7 +111,7 @@ void GetBootstrapCommands(std::list<cmCommand*>& commands)
   commands.push_back(new cmDefinePropertyCommand);
   commands.push_back(new cmElseCommand);
   commands.push_back(new cmEnableLanguageCommand);
-  commands.push_back(new cmEnableTestingCommand);  
+  commands.push_back(new cmEnableTestingCommand);
   commands.push_back(new cmEndForEachCommand);
   commands.push_back(new cmEndFunctionCommand);
   commands.push_back(new cmEndIfCommand);
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index 7eafda2..4000345 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -25,7 +25,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
   else if (!cmSystemTools::Strucmp(lff.Name.c_str(),"endwhile"))
     {
     // if this is the endwhile for this while loop then execute
-    if (!this->Depth) 
+    if (!this->Depth)
       {
       // Remove the function blocker for this scope or bail.
       cmsys::auto_ptr<cmFunctionBlocker>
@@ -33,16 +33,16 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
       if(!fb.get()) { return false; }
 
       std::string errorString;
-    
+
       std::vector<std::string> expandedArguments;
       mf.ExpandArguments(this->Args, expandedArguments);
       cmake::MessageType messageType;
-      bool isTrue = 
+      bool isTrue =
         cmIfCommand::IsTrue(expandedArguments,errorString,
                             &mf, messageType);
 
       while (isTrue)
-        {      
+        {
         if (errorString.size())
           {
           std::string err = "had incorrect arguments: ";
@@ -86,7 +86,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
           }
         expandedArguments.clear();
         mf.ExpandArguments(this->Args, expandedArguments);
-        isTrue = 
+        isTrue =
           cmIfCommand::IsTrue(expandedArguments,errorString,
                               &mf, messageType);
         }
@@ -101,7 +101,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
 
   // record the command
   this->Functions.push_back(lff);
-  
+
   // always return true
   return true;
 }
@@ -123,7 +123,7 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile& )
 }
 
 bool cmWhileCommand
-::InvokeInitialPass(const std::vector<cmListFileArgument>& args, 
+::InvokeInitialPass(const std::vector<cmListFileArgument>& args,
                     cmExecutionStatus &)
 {
   if(args.size() < 1)
@@ -131,12 +131,12 @@ bool cmWhileCommand
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  
+
   // create a function blocker
   cmWhileFunctionBlocker *f = new cmWhileFunctionBlocker();
   f->Args = args;
   this->Makefile->AddFunctionBlocker(f);
-  
+
   return true;
 }
 
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 7030b2e..e700ed8 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -139,7 +139,7 @@ ENDIF(WIN32)
 # does, it appends library to the list.
 SET(CURL_LIBS "")
 MACRO(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
-  CHECK_LIBRARY_EXISTS("${LIBRARY};${CURL_LIBS}" ${SYMBOL} "" 
+  CHECK_LIBRARY_EXISTS("${LIBRARY};${CURL_LIBS}" ${SYMBOL} ""
     ${VARIABLE})
   IF(${VARIABLE})
     SET(CURL_LIBS ${CURL_LIBS} ${LIBRARY})
@@ -180,7 +180,7 @@ IF(CMAKE_USE_OPENSSL)
   SET(USE_SSLEAY TRUE)
   SET(USE_OPENSSL TRUE)
   IF(WIN32)
-    FIND_PATH(SSLINCLUDE openssl/crypto.h 
+    FIND_PATH(SSLINCLUDE openssl/crypto.h
       PATHS c:/hoffman/Tools/openssl_w32vc6-0.9.8g/inc32)
     INCLUDE_DIRECTORIES(${SSLINCLUDE})
     FIND_LIBRARY(LIBEAY NAMES libeay32)
@@ -221,7 +221,7 @@ IF(HAVE_FEATURES_H)
     getenv.c
     hash.c
     http.c
-    if2ip.c 
+    if2ip.c
     mprintf.c
     multi.c
     sendf.c
@@ -287,9 +287,9 @@ ENDIF(NOT CURL_SPECIAL_LIBZ)
 CHECK_INCLUDE_FILE_CONCAT("sys/socket.h"     HAVE_SYS_SOCKET_H)
 CHECK_INCLUDE_FILE_CONCAT("netinet/in.h"     HAVE_NETINET_IN_H)
 CHECK_INCLUDE_FILE_CONCAT("net/if.h"         HAVE_NET_IF_H)
-CHECK_INCLUDE_FILE_CONCAT("netinet/if_ether.h" 
+CHECK_INCLUDE_FILE_CONCAT("netinet/if_ether.h"
   HAVE_NETINET_IF_ETHER_H)
-CHECK_INCLUDE_FILE_CONCAT("netinet/tcp.h" 
+CHECK_INCLUDE_FILE_CONCAT("netinet/tcp.h"
   HAVE_NETINET_TCP_H)
 CHECK_INCLUDE_FILE_CONCAT("sys/select.h"    HAVE_SYS_SELECT_H)
 CHECK_INCLUDE_FILE_CONCAT("utime.h"         HAVE_UTIME_H)
@@ -421,7 +421,7 @@ IF(CMAKE_USE_OPENSSL)
   CHECK_SYMBOL_EXISTS(RAND_status   "${CURL_INCLUDES}" HAVE_RAND_STATUS)
   CHECK_SYMBOL_EXISTS(RAND_screen   "${CURL_INCLUDES}" HAVE_RAND_SCREEN)
   CHECK_SYMBOL_EXISTS(RAND_egd      "${CURL_INCLUDES}" HAVE_RAND_EGD)
-  CHECK_SYMBOL_EXISTS(CRYPTO_cleanup_all_ex_data "${CURL_INCLUDES}" 
+  CHECK_SYMBOL_EXISTS(CRYPTO_cleanup_all_ex_data "${CURL_INCLUDES}"
     HAVE_CRYPTO_CLEANUP_ALL_EX_DATA)
 ENDIF(CMAKE_USE_OPENSSL)
 CHECK_SYMBOL_EXISTS(gmtime_r      "${CURL_INCLUDES}" HAVE_GMTIME_R)
@@ -485,7 +485,7 @@ ENDIF(NOT HAVE_SIGSETJMP)
 # For other curl specific tests, use this macro.
 MACRO(CURL_INTERNAL_TEST CURL_TEST)
   IF("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS 
+    SET(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-D${CURL_TEST} ${CMAKE_REQUIRED_FLAGS}")
     IF(CMAKE_REQUIRED_LIBRARIES)
       SET(CURL_TEST_ADD_LIBRARIES
@@ -502,18 +502,18 @@ MACRO(CURL_INTERNAL_TEST CURL_TEST)
     IF(${CURL_TEST})
       SET(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}")
       MESSAGE(STATUS "Performing Curl Test ${CURL_TEST} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing Curl Test ${CURL_TEST} passed with the following output:\n"
         "${OUTPUT}\n")
     ELSE(${CURL_TEST})
       MESSAGE(STATUS "Performing Curl Test ${CURL_TEST} - Failed")
       SET(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing Curl Test ${CURL_TEST} failed with the following output:\n"
         "${OUTPUT}\n")
     ENDIF(${CURL_TEST})
   ENDIF("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
-ENDMACRO(CURL_INTERNAL_TEST) 
+ENDMACRO(CURL_INTERNAL_TEST)
 
 # Do curl specific tests
 #OPTION(CURL_HAVE_DISABLED_NONBLOCKING "Disable non-blocking socket detection" OFF)
@@ -527,7 +527,7 @@ IF(NOT CURL_HAVE_DISABLED_NONBLOCKING)
     HAVE_SO_NONBLOCK
     )
 ENDIF(NOT CURL_HAVE_DISABLED_NONBLOCKING)
-FOREACH(CURL_TEST 
+FOREACH(CURL_TEST
     ${CURL_NONBLOCKING_TESTS}
     TIME_WITH_SYS_TIME
     HAVE_O_NONBLOCKHAVE_GETHOSTBYADDR_R_5
@@ -627,12 +627,12 @@ SET(CMAKE_REQUIRED_FLAGS)
 
 # Check for nonblocking
 SET(HAVE_DISABLED_NONBLOCKING 1)
-IF(HAVE_FIONBIO OR 
+IF(HAVE_FIONBIO OR
     HAVE_IOCTLSOCKET OR
     HAVE_IOCTLSOCKET_CASE OR
     HAVE_O_NONBLOCK)
   SET(HAVE_DISABLED_NONBLOCKING)
-ENDIF(HAVE_FIONBIO OR 
+ENDIF(HAVE_FIONBIO OR
   HAVE_IOCTLSOCKET OR
   HAVE_IOCTLSOCKET_CASE OR
   HAVE_O_NONBLOCK)

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list