[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2267-g53b2797

Alexander Neundorf neundorf at kde.org
Thu Feb 21 15:50:12 EST 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  53b2797e114a3773a18051149b4a83da2d035902 (commit)
       via  fedcd8d61a843a51f3c3354890653e9e97cd069e (commit)
       via  ebbf9b67c57df290d182a042fe80163908918240 (commit)
      from  e11a7cea7486cf214bece3a913b60402ffd52f75 (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=53b2797e114a3773a18051149b4a83da2d035902
commit 53b2797e114a3773a18051149b4a83da2d035902
Merge: e11a7ce fedcd8d
Author:     Alexander Neundorf <neundorf at kde.org>
AuthorDate: Thu Feb 21 15:50:07 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Feb 21 15:50:07 2013 -0500

    Merge topic 'FPHSA_FOUND_VAR_OPTION' into next
    
    fedcd8d FPHSA: improve documentation
    ebbf9b6 FPHSA: add argument FOUND_VAR instead of USE_ORIGINAL_CASE


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fedcd8d61a843a51f3c3354890653e9e97cd069e
commit fedcd8d61a843a51f3c3354890653e9e97cd069e
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Thu Feb 21 21:49:29 2013 +0100
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Thu Feb 21 21:49:29 2013 +0100

    FPHSA: improve documentation
    
    Alex

diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index ce89c05..5f92a86 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -30,6 +30,7 @@
 # Other names for the result-variable are not allowed.
 # So for a Find-module named FindFooBar.cmake, the two possible names are
 # FooBar_FOUND and FOOBAR_FOUND. It is recommended to use the original case version.
+# If the FOUND_VAR option is not used, the default is <UPPERCASED_NAME>_FOUND.
 #
 # As in the simple mode, if <var1> through <varN> are all valid,
 # <packagename>_FOUND will be set to TRUE.
@@ -54,7 +55,7 @@
 #
 # Example for mode 1:
 #
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2  DEFAULT_MSG  LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
+#    find_package_handle_standard_args(LibXml2  DEFAULT_MSG  LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
 #
 # LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
 # LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
@@ -65,20 +66,23 @@
 #
 # Example for mode 2:
 #
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON  REQUIRED_VARS BISON_EXECUTABLE
-#                                             VERSION_VAR BISON_VERSION)
-# In this case, BISON is considered to be found if the variable(s) listed
-# after REQUIRED_VAR are all valid, i.e. BISON_EXECUTABLE in this case.
-# Also the version of BISON will be checked by using the version contained
-# in BISON_VERSION.
+#    find_package_handle_standard_args(LibXslt FOUND_VAR LibXslt_FOUND
+#                                             REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS
+#                                             VERSION_VAR LibXslt_VERSION_STRING)
+# In this case, LibXslt is considered to be found if the variable(s) listed
+# after REQUIRED_VAR are all valid, i.e. LibXslt_LIBRARIES and LibXslt_INCLUDE_DIRS
+# in this case. The result will then be stored in LibXslt_FOUND .
+# Also the version of LibXslt will be checked by using the version contained
+# in LibXslt_VERSION_STRING.
 # Since no FAIL_MESSAGE is given, the default messages will be printed.
 #
 # Another example for mode 2:
 #
 #    find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(Automoc4  CONFIG_MODE)
+#    find_package_handle_standard_args(Automoc4  CONFIG_MODE)
 # In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4 NO_MODULE)
 # and adds an additional search directory for automoc4.
+# Here the result will be stored in AUTOMOC4_FOUND.
 # The following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper
 # success/error message.
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ebbf9b67c57df290d182a042fe80163908918240
commit ebbf9b67c57df290d182a042fe80163908918240
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Thu Feb 21 21:40:56 2013 +0100
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Thu Feb 21 21:40:56 2013 +0100

    FPHSA: add argument FOUND_VAR instead of USE_ORIGINAL_CASE
    
    In the new mode FPHSA now accepts a FOUND_VAR option, which can be
    set either to ExactCase_FOUND or UPPERCASE_FOUND, no other values
    are accepted.
    Also add tests for that, including failure.
    
    Alex

diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index 3729c15..ce89c05 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -18,20 +18,21 @@
 # for the failure case. This is not recommended.
 #
 # The second mode is more powerful and also supports version checking:
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [USE_ORIGINAL_CASE]
+#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [FOUND_VAR <resultVar>]
 #                                           [REQUIRED_VARS <var1>...<varN>]
 #                                           [VERSION_VAR   <versionvar>]
 #                                           [HANDLE_COMPONENTS]
 #                                           [CONFIG_MODE]
 #                                           [FAIL_MESSAGE "Custom failure message"] )
 #
-# If USE_ORIGINAL_CASE is used, then the name of the _FOUND-variable will be
-# the name of the package in original casing and _FOUND appended, e.g. SomePackage_FOUND.
-# If USE_ORIGINAL_CASE is not used, the package name will be uppercased, e.g
-# SOMEPACKAGE_FOUND. This was the only behaviour before CMake 2.8.11.
+# In this mode, the name of the result-variable can be set either to either
+# <UPPERCASED_NAME>_FOUND or <OriginalCase_Name>_FOUND using the FOUND_VAR option.
+# Other names for the result-variable are not allowed.
+# So for a Find-module named FindFooBar.cmake, the two possible names are
+# FooBar_FOUND and FOOBAR_FOUND. It is recommended to use the original case version.
 #
 # As in the simple mode, if <var1> through <varN> are all valid,
-# <packagename_NAME>_FOUND will be set to TRUE.
+# <packagename>_FOUND will be set to TRUE.
 # After REQUIRED_VARS the variables which are required for this package are listed.
 # Following VERSION_VAR the name of the variable can be specified which holds
 # the version of the package which has been found. If this is done, this version
@@ -143,8 +144,8 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
 
 # set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
 # new extended or in the "old" mode:
-  set(options  CONFIG_MODE  HANDLE_COMPONENTS  USE_ORIGINAL_CASE)
-  set(oneValueArgs FAIL_MESSAGE VERSION_VAR)
+  set(options  CONFIG_MODE  HANDLE_COMPONENTS)
+  set(oneValueArgs  FAIL_MESSAGE  VERSION_VAR  FOUND_VAR)
   set(multiValueArgs REQUIRED_VARS)
   set(_KEYWORDS_FOR_EXTENDED_MODE  ${options} ${oneValueArgs} ${multiValueArgs} )
   list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
@@ -189,8 +190,12 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
   string(TOUPPER ${_NAME} _NAME_UPPER)
   string(TOLOWER ${_NAME} _NAME_LOWER)
 
-  if(FPHSA_USE_ORIGINAL_CASE)
-    set(_FOUND_VAR ${_NAME}_FOUND)
+  if(FPHSA_FOUND_VAR)
+    if("${FPHSA_FOUND_VAR}" MATCHES "^${_NAME}_FOUND$"  OR  "${FPHSA_FOUND_VAR}" MATCHES "^${_NAME_UPPER}_FOUND$")
+      set(_FOUND_VAR ${FPHSA_FOUND_VAR})
+    else()
+      message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.")
+    endif()
   else()
     set(_FOUND_VAR ${_NAME_UPPER}_FOUND)
   endif()
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index f8e4afd..2725202 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -147,6 +147,9 @@ if(BUILD_TESTING)
   # add a bunch of standard build-and-test style tests
   ADD_TEST_MACRO(CommandLineTest CommandLineTest)
   ADD_TEST_MACRO(FindPackageTest FindPackageTest)
+  ADD_TEST_MACRO(FPHSA_InvalidFOUND_VAR FPHSA_InvalidFOUND_VAR)
+  set_tests_properties(FPHSA_InvalidFOUND_VAR PROPERTIES
+                       PASS_REGULAR_EXPRESSION "The argument for FOUND_VAR is .badfoundvar_FOUND., but only")
   ADD_TEST_MACRO(FindModulesExecuteAll FindModulesExecuteAll)
   ADD_TEST_MACRO(StringFileTest StringFileTest)
   ADD_TEST_MACRO(TryCompile TryCompile)
diff --git a/Tests/FPHSA_InvalidFOUND_VAR/CMakeLists.txt b/Tests/FPHSA_InvalidFOUND_VAR/CMakeLists.txt
new file mode 100644
index 0000000..6a88cf5
--- /dev/null
+++ b/Tests/FPHSA_InvalidFOUND_VAR/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8)
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
+
+find_package(BadFoundVar REQUIRED)
diff --git a/Tests/FPHSA_InvalidFOUND_VAR/FindBadFoundVar.cmake b/Tests/FPHSA_InvalidFOUND_VAR/FindBadFoundVar.cmake
new file mode 100644
index 0000000..152df5c
--- /dev/null
+++ b/Tests/FPHSA_InvalidFOUND_VAR/FindBadFoundVar.cmake
@@ -0,0 +1,6 @@
+set(BFV_FOO TRUE)
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(BadFoundVar REQUIRED_VARS BFV_FOO
+                                              FOUND_VAR badfoundvar_FOUND )
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index 8af13ae..a77713f 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -45,7 +45,12 @@ endif()
 
 find_package(SomePackage)
 if(NOT SomePackage_FOUND)
-  message(SEND_ERROR "SomePackage with USE_ORIGINAL_CASE not found !")
+  message(SEND_ERROR "SomePackage with FOUND_VAR SomePackage_FOUND not found !")
+endif()
+
+find_package(UpperCasePackage)
+if(NOT UPPERCASEPACKAGE_FOUND)
+  message(SEND_ERROR "UpperCasePackage with FOUND_VAR UPPERCASEPACKAGE_FOUND not found !")
 endif()
 
 #-----------------------------------------------------------------------------
diff --git a/Tests/FindPackageTest/FindSomePackage.cmake b/Tests/FindPackageTest/FindSomePackage.cmake
index a2fa483..83d1d0e 100644
--- a/Tests/FindPackageTest/FindSomePackage.cmake
+++ b/Tests/FindPackageTest/FindSomePackage.cmake
@@ -3,4 +3,4 @@ set(SOP_FOO TRUE)
 include(FindPackageHandleStandardArgs)
 
 find_package_handle_standard_args(SomePackage REQUIRED_VARS SOP_FOO
-                                              USE_ORIGINAL_CASE )
+                                              FOUND_VAR SomePackage_FOUND )
diff --git a/Tests/FindPackageTest/FindUpperCasePackage.cmake b/Tests/FindPackageTest/FindUpperCasePackage.cmake
new file mode 100644
index 0000000..66c2fea
--- /dev/null
+++ b/Tests/FindPackageTest/FindUpperCasePackage.cmake
@@ -0,0 +1,6 @@
+set(UCP_FOO TRUE)
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(UpperCasePackage REQUIRED_VARS UCP_FOO
+                                                   FOUND_VAR UPPERCASEPACKAGE_FOUND )

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

Summary of changes:
 Modules/FindPackageHandleStandardArgs.cmake        |   45 ++++++++++++--------
 Tests/CMakeLists.txt                               |    3 +
 Tests/FPHSA_InvalidFOUND_VAR/CMakeLists.txt        |    5 ++
 Tests/FPHSA_InvalidFOUND_VAR/FindBadFoundVar.cmake |    6 +++
 Tests/FindPackageTest/CMakeLists.txt               |    7 +++-
 Tests/FindPackageTest/FindSomePackage.cmake        |    2 +-
 Tests/FindPackageTest/FindUpperCasePackage.cmake   |    6 +++
 7 files changed, 54 insertions(+), 20 deletions(-)
 create mode 100644 Tests/FPHSA_InvalidFOUND_VAR/CMakeLists.txt
 create mode 100644 Tests/FPHSA_InvalidFOUND_VAR/FindBadFoundVar.cmake
 create mode 100644 Tests/FindPackageTest/FindUpperCasePackage.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list