[Cmake-commits] CMake branch, next, updated. v3.0.0-rc1-501-g5926b00

Daniele E. Domenichelli daniele.domenichelli at gmail.com
Tue Mar 4 16:53:48 EST 2014


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  5926b000386466034dc84430d1801c7154a8d4a2 (commit)
       via  8372b4553bc58c00ad3ef923919ff5547746b95e (commit)
       via  d348cd1bc50b74786d3e350a3b29aa92eeca1339 (commit)
      from  4931e3ce96b9d0b8f89dd71b7a80d4fa15cad156 (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=5926b000386466034dc84430d1801c7154a8d4a2
commit 5926b000386466034dc84430d1801c7154a8d4a2
Merge: 4931e3c 8372b45
Author:     Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
AuthorDate: Tue Mar 4 16:53:46 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Mar 4 16:53:46 2014 -0500

    Merge topic 'FeatureSummary_combine_WHAT_values' into next
    
    8372b455 FeatureSummary: Add unit tests
    d348cd1b FeatureSummary: Allow to combine and reorder values for the "WHAT" option


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8372b4553bc58c00ad3ef923919ff5547746b95e
commit 8372b4553bc58c00ad3ef923919ff5547746b95e
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Mon Mar 3 19:51:57 2014 +0100
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Mon Mar 3 19:52:13 2014 +0100

    FeatureSummary: Add unit tests

diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 9bb097b..c043e57 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -42,6 +42,7 @@ add_RunCMake_test(CompilerNotFound)
 add_RunCMake_test(Configure)
 add_RunCMake_test(DisallowedCommands)
 add_RunCMake_test(ExternalData)
+add_RunCMake_test(FeatureSummary)
 add_RunCMake_test(FPHSA)
 add_RunCMake_test(GeneratorExpression)
 add_RunCMake_test(GeneratorToolset)
diff --git a/Tests/RunCMake/FeatureSummary/CMakeLists.txt b/Tests/RunCMake/FeatureSummary/CMakeLists.txt
new file mode 100644
index 0000000..72abfc8
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.11)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt
new file mode 100644
index 0000000..9a3f023
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt
@@ -0,0 +1,7 @@
+-- The following features have been enabled:
+
+ \* Foo , Foo\.
+
+-- The following features have been disabled:
+
+ \* Bar , Bar\.
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll.cmake
new file mode 100644
index 0000000..ec5ebcb
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll.cmake
@@ -0,0 +1,9 @@
+include(FeatureSummary)
+
+set(WITH_FOO 1)
+set(WITH_BAR 0)
+
+add_feature_info(Foo WITH_FOO "Foo.")
+add_feature_info(Bar WITH_BAR "Bar.")
+
+feature_summary(WHAT ALL)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt
new file mode 100644
index 0000000..4d8f25f
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt
@@ -0,0 +1,7 @@
+-- The following features have been disabled:
+
+ \* Bar , Bar\.
+
+-- The following features have been enabled:
+
+ \* Foo , Foo\.
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList.cmake
new file mode 100644
index 0000000..d04ba88
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList.cmake
@@ -0,0 +1,9 @@
+include(FeatureSummary)
+
+set(WITH_FOO 1)
+set(WITH_BAR 0)
+
+add_feature_info(Foo WITH_FOO "Foo.")
+add_feature_info(Bar WITH_BAR "Bar.")
+
+feature_summary(WHAT DISABLED_FEATURES ENABLED_FEATURES)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-stderr.txt
new file mode 100644
index 0000000..18d9ebd
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\):
+  The WHAT argument of FEATURE_SUMMARY\(\) contains ALL, which cannot be
+  combined with other values\.
+Call Stack \(most recent call first\):
+  FeatureSummaryWhatListAll\.cmake:[0-9]+ \(feature_summary\)
+  CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll.cmake
new file mode 100644
index 0000000..1877ea5
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll.cmake
@@ -0,0 +1,9 @@
+include(FeatureSummary)
+
+set(WITH_FOO 1)
+set(WITH_BAR 0)
+
+add_feature_info(Foo WITH_FOO "Foo.")
+add_feature_info(Bar WITH_BAR "Bar.")
+
+feature_summary(WHAT ENABLED_FEATURES ALL)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-stderr.txt
new file mode 100644
index 0000000..3ad3750
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\):
+  The WHAT argument of FEATURE_SUMMARY\(\) contains FOO, which is not a valid
+  value\.
+Call Stack \(most recent call first\):
+  FeatureSummaryWhatListUnknown\.cmake:[0-9]+ \(feature_summary\)
+  CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown.cmake
new file mode 100644
index 0000000..46088d4
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown.cmake
@@ -0,0 +1,9 @@
+include(FeatureSummary)
+
+set(WITH_FOO 1)
+set(WITH_BAR 0)
+
+add_feature_info(Foo WITH_FOO "Foo.")
+add_feature_info(Bar WITH_BAR "Bar.")
+
+feature_summary(WHAT ENABLED_FEATURES FOO)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt
new file mode 100644
index 0000000..240632d
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt
@@ -0,0 +1 @@
+ \* Foo , Foo\.
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle.cmake
new file mode 100644
index 0000000..593dfb6
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle.cmake
@@ -0,0 +1,9 @@
+include(FeatureSummary)
+
+set(WITH_FOO 1)
+set(WITH_BAR 0)
+
+add_feature_info(Foo WITH_FOO "Foo.")
+add_feature_info(Bar WITH_BAR "Bar.")
+
+feature_summary(WHAT ENABLED_FEATURES)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-stderr.txt
new file mode 100644
index 0000000..c78853c
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\):
+  The WHAT argument of FEATURE_SUMMARY\(\) contains FOO, which is not a valid
+  value\.
+Call Stack \(most recent call first\):
+  FeatureSummaryWhatSingleUnknown\.cmake:[0-9]+ \(feature_summary\)
+  CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown.cmake
new file mode 100644
index 0000000..c2d6d2e
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown.cmake
@@ -0,0 +1,9 @@
+include(FeatureSummary)
+
+set(WITH_FOO 1)
+set(WITH_BAR 0)
+
+add_feature_info(Foo WITH_FOO "Foo.")
+add_feature_info(Bar WITH_BAR "Bar.")
+
+feature_summary(WHAT FOO)
diff --git a/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake
new file mode 100644
index 0000000..1417338
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake
@@ -0,0 +1,8 @@
+include(RunCMake)
+
+run_cmake(FeatureSummaryWhatAll)
+run_cmake(FeatureSummaryWhatSingle)
+run_cmake(FeatureSummaryWhatSingleUnknown)
+run_cmake(FeatureSummaryWhatList)
+run_cmake(FeatureSummaryWhatListUnknown)
+run_cmake(FeatureSummaryWhatListAll)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d348cd1bc50b74786d3e350a3b29aa92eeca1339
commit d348cd1bc50b74786d3e350a3b29aa92eeca1339
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Fri Feb 28 17:36:38 2014 +0100
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Mon Mar 3 19:52:13 2014 +0100

    FeatureSummary: Allow to combine and reorder values for the "WHAT" option
    
    For example it is now possible to do:
    
      feature_summary(WHAT ENABLED_FEATURES
                           DISABLED_FEATURES)
    
    That produces an output like:
    
      --
      -- The following features have been enabled:
    
       * Feature1
       * Feature2
    
      -- The following features have been disabled:
       * Feature2
    
    Skipping the lists that are empty.
    
    Without this patch this would require to do:
    
      message(STATUS "")
      feature_summary(WHAT ENABLED_FEATURES
          DESCRIPTION "The following features have been enabled:")
      feature_summary(WHAT DISABLED_FEATURES
          DESCRIPTION "The following features have been disabled:")
    
    And empty lists would not be skipped.
    
    The behaviour when WHAT has a single argument (ALL or any option) is
    unchanged.

diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake
index c0e63d5..6696515 100644
--- a/Modules/FeatureSummary.cmake
+++ b/Modules/FeatureSummary.cmake
@@ -71,6 +71,13 @@
 #     RUNTIME_PACKAGES_FOUND: only those packages which have been found which have the type RUNTIME
 #     RUNTIME_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type RUNTIME
 #
+# With the exception of the ``ALL`` value, these values can be combined
+# in order to customize the output. For example:
+#
+# ::
+#
+#    feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)
+#
 #
 #
 # If a FILENAME is given, the information is printed into this file.  If
@@ -417,8 +424,8 @@ endfunction()
 function(FEATURE_SUMMARY)
 # CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
   set(options APPEND INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
-  set(oneValueArgs FILENAME VAR DESCRIPTION WHAT)
-  set(multiValueArgs ) # none
+  set(oneValueArgs FILENAME VAR DESCRIPTION)
+  set(multiValueArgs WHAT)
 
   CMAKE_PARSE_ARGUMENTS(_FS "${options}" "${oneValueArgs}" "${multiValueArgs}"  ${_FIRST_ARG} ${ARGN})
 
@@ -451,20 +458,37 @@ function(FEATURE_SUMMARY)
       set(requiredPackagesNotFound TRUE)
     endif()
 
-  elseif("${_FS_WHAT}" STREQUAL "ALL")
-
-    set(allWhatParts "ENABLED_FEATURES"
-                     "RUNTIME_PACKAGES_FOUND"
-                     "OPTIONAL_PACKAGES_FOUND"
-                     "RECOMMENDED_PACKAGES_FOUND"
-                     "REQUIRED_PACKAGES_FOUND"
+  else()
+    if("${_FS_WHAT}" STREQUAL "ALL")
+
+      set(allWhatParts "ENABLED_FEATURES"
+                       "RUNTIME_PACKAGES_FOUND"
+                       "OPTIONAL_PACKAGES_FOUND"
+                       "RECOMMENDED_PACKAGES_FOUND"
+                       "REQUIRED_PACKAGES_FOUND"
+
+                       "DISABLED_FEATURES"
+                       "RUNTIME_PACKAGES_NOT_FOUND"
+                       "OPTIONAL_PACKAGES_NOT_FOUND"
+                       "RECOMMENDED_PACKAGES_NOT_FOUND"
+                       "REQUIRED_PACKAGES_NOT_FOUND"
+      )
 
-                     "DISABLED_FEATURES"
-                     "RUNTIME_PACKAGES_NOT_FOUND"
-                     "OPTIONAL_PACKAGES_NOT_FOUND"
-                     "RECOMMENDED_PACKAGES_NOT_FOUND"
-                     "REQUIRED_PACKAGES_NOT_FOUND"
-       )
+    else()
+      set(allWhatParts)
+      foreach(part ${_FS_WHAT})
+        list(FIND validWhatParts "${part}" indexInList)
+        if(NOT "${indexInList}" STREQUAL "-1")
+          list(APPEND allWhatParts "${part}")
+        else()
+          if("${part}" STREQUAL "ALL")
+            message(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() contains ALL, which cannot be combined with other values.")
+          else()
+            message(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() contains ${part}, which is not a valid value.")
+          endif()
+        endif()
+      endforeach()
+    endif()
 
     set(title_ENABLED_FEATURES               "The following features have been enabled:")
     set(title_DISABLED_FEATURES              "The following features have been disabled:")
@@ -488,8 +512,6 @@ function(FEATURE_SUMMARY)
         endif()
       endif()
     endforeach()
-  else()
-    message(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() is set to ${_FS_WHAT}, which is not a valid value.")
   endif()
 
   if(_FS_FILENAME)

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

Summary of changes:
 Modules/FeatureSummary.cmake                       |   56 ++++++++++++++------
 Tests/RunCMake/CMakeLists.txt                      |    1 +
 .../{CMP0022 => FeatureSummary}/CMakeLists.txt     |    0
 .../FeatureSummaryWhatAll-stdout.txt               |    7 +++
 .../FeatureSummary/FeatureSummaryWhatAll.cmake     |    9 ++++
 .../FeatureSummaryWhatList-stdout.txt              |    7 +++
 .../FeatureSummary/FeatureSummaryWhatList.cmake    |    9 ++++
 .../FeatureSummaryWhatListAll-result.txt}          |    0
 .../FeatureSummaryWhatListAll-stderr.txt           |    6 +++
 .../FeatureSummary/FeatureSummaryWhatListAll.cmake |    9 ++++
 .../FeatureSummaryWhatListUnknown-result.txt}      |    0
 .../FeatureSummaryWhatListUnknown-stderr.txt       |    6 +++
 .../FeatureSummaryWhatListUnknown.cmake            |    9 ++++
 .../FeatureSummaryWhatSingle-stdout.txt            |    1 +
 .../FeatureSummary/FeatureSummaryWhatSingle.cmake  |    9 ++++
 .../FeatureSummaryWhatSingleUnknown-result.txt}    |    0
 .../FeatureSummaryWhatSingleUnknown-stderr.txt     |    6 +++
 .../FeatureSummaryWhatSingleUnknown.cmake          |    9 ++++
 Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake   |    8 +++
 19 files changed, 135 insertions(+), 17 deletions(-)
 copy Tests/RunCMake/{CMP0022 => FeatureSummary}/CMakeLists.txt (100%)
 create mode 100644 Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt
 create mode 100644 Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll.cmake
 create mode 100644 Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt
 create mode 100644 Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => FeatureSummary/FeatureSummaryWhatListAll-result.txt} (100%)
 create mode 100644 Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-stderr.txt
 create mode 100644 Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => FeatureSummary/FeatureSummaryWhatListUnknown-result.txt} (100%)
 create mode 100644 Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-stderr.txt
 create mode 100644 Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown.cmake
 create mode 100644 Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt
 create mode 100644 Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => FeatureSummary/FeatureSummaryWhatSingleUnknown-result.txt} (100%)
 create mode 100644 Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-stderr.txt
 create mode 100644 Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown.cmake
 create mode 100644 Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list