[Cmake-commits] CMake branch, next, updated. v2.8.11.2-4056-g0570e2d

Stephen Kelly steveire at gmail.com
Fri Aug 30 07:12:48 EDT 2013


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  0570e2d1470add3f03b0dfdec7532092b8317079 (commit)
       via  bb501a2a648f4c2e2dd008b925b87b575b4e2cf1 (commit)
      from  a4bb7f463a9b0ea19a27955b461d0a63f468fce9 (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=0570e2d1470add3f03b0dfdec7532092b8317079
commit 0570e2d1470add3f03b0dfdec7532092b8317079
Merge: a4bb7f4 bb501a2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Aug 30 07:12:36 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Aug 30 07:12:36 2013 -0400

    Merge topic 'add-find_dependency-macro' into next
    
    bb501a2 CMakePackageConfigHelpers: Add a find_dependency macro


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb501a2a648f4c2e2dd008b925b87b575b4e2cf1
commit bb501a2a648f4c2e2dd008b925b87b575b4e2cf1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Aug 30 12:59:42 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Aug 30 13:03:10 2013 +0200

    CMakePackageConfigHelpers: Add a find_dependency macro
    
    This macro handles the EXACT, REQUIRED and QUIET options
    and sets an appropriate NOT_FOUND_MESSAGE for the package
    if a dependency is not found.

diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake
index d042d5e..3c56b7f 100644
--- a/Modules/CMakePackageConfigHelpers.cmake
+++ b/Modules/CMakePackageConfigHelpers.cmake
@@ -3,7 +3,8 @@
 #    CONFIGURE_PACKAGE_CONFIG_FILE(<input> <output> INSTALL_DESTINATION <path>
 #                                                   [PATH_VARS <var1> <var2> ... <varN>]
 #                                                   [NO_SET_AND_CHECK_MACRO]
-#                                                   [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
+#                                                   [NO_CHECK_REQUIRED_COMPONENTS_MACRO]
+#                                                   [NO_FIND_DEPENDENCY_MACRO])
 #
 # CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain
 # configure_file() command when creating the <Name>Config.cmake or <Name>-config.cmake
@@ -154,7 +155,7 @@ endmacro()
 
 
 function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile)
-  set(options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO)
+  set(options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO NO_FIND_DEPENDENCY_MACRO)
   set(oneValueArgs INSTALL_DESTINATION )
   set(multiValueArgs PATH_VARS )
 
@@ -240,6 +241,40 @@ endmacro()
 ")
   endif()
 
+  if(NOT CCF_NO_FIND_DEPENDENCY_MACRO)
+    set(PACKAGE_INIT "${PACKAGE_INIT}
+macro(find_dependency dep)
+  if (NOT \${dep}_FOUND)
+    if (\${ARGV1})
+      set(version \${ARGV1})
+    endif()
+    set(exact_arg)
+    if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION_EXACT)
+      set(exact_arg EXACT)
+    endif()
+    set(quiet_arg)
+    if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
+      set(quiet_arg QUIET)
+    endif()
+    set(required_arg)
+    if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
+      set(required_arg REQUIRED)
+    endif()
+
+    find_package(\${dep} \${version} \${exact_arg} \${quiet_arg} \${required_arg})
+    if (NOT \${dep}_FOUND)
+      set(\${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE \"\${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency \${dep} could not be found.\")
+      set(\${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
+      return()
+    endif()
+    set(required_arg)
+    set(quiet_arg)
+    set(exact_arg)
+  endif()
+endmacro()
+")
+  endif()
+
   set(PACKAGE_INIT "${PACKAGE_INIT}
 ####################################################################################")
 

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

Summary of changes:
 Modules/CMakePackageConfigHelpers.cmake |   39 +++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list