[Cmake-commits] CMake branch, next, updated. v3.4.0-rc1-141-g9990bef

Daniele E. Domenichelli daniele.domenichelli at gmail.com
Wed Oct 7 03:25:11 EDT 2015


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  9990befcd93999ac476dd78ef4c74514da0673d2 (commit)
       via  33eb8fa34ba7fd86753a07555d62eef33ed92104 (commit)
      from  16df189e1b4393bea525629cc7cca7da183fc5d7 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9990befcd93999ac476dd78ef4c74514da0673d2
commit 9990befcd93999ac476dd78ef4c74514da0673d2
Merge: 16df189 33eb8fa
Author:     Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
AuthorDate: Wed Oct 7 03:25:09 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Oct 7 03:25:09 2015 -0400

    Merge topic 'FindGTK2_sigc++_c++11' into next
    
    33eb8fa3 FindGTK2: Enable c++11 for sigc++ 2.5.1 or later


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=33eb8fa34ba7fd86753a07555d62eef33ed92104
commit 33eb8fa34ba7fd86753a07555d62eef33ed92104
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Tue Oct 6 13:33:08 2015 +0200
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Tue Oct 6 18:19:07 2015 +0200

    FindGTK2: Enable c++11 for sigc++ 2.5.1 or later
    
    Starting with sigc++ 2.5.1, c++11 must be enabled in order to use
    sigc++. The GTK2::sigc++ imported target will automatically enable the
    required build flags in order to build with the version found on the
    system.

diff --git a/Help/release/dev/FindGTK2_sigc++_c++11.rst b/Help/release/dev/FindGTK2_sigc++_c++11.rst
new file mode 100644
index 0000000..2ba1459
--- /dev/null
+++ b/Help/release/dev/FindGTK2_sigc++_c++11.rst
@@ -0,0 +1,7 @@
+FindGTK2_sigc++_c++11
+---------------------
+
+* Starting with sigc++ 2.5.1, c++11 must be enabled in order to use
+  sigc++. The GTK2::sigc++ imported target will automatically enable the
+  required build flags in order to build with the version found on the
+  system.
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index 72bb8eb..501055b 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -202,6 +202,43 @@ function(_GTK2_GET_VERSION _OUT_major _OUT_minor _OUT_micro _gtkversion_hdr)
     endif()
 endfunction()
 
+
+#=============================================================
+# _GTK2_SIGCXX_GET_VERSION
+# Internal function to parse the version number in
+# sigc++config.h
+#   _OUT_major = Major version number
+#   _OUT_minor = Minor version number
+#   _OUT_micro = Micro version number
+#   _sigcxxversion_hdr = Header file to parse
+#=============================================================
+
+function(_GTK2_SIGCXX_GET_VERSION _OUT_major _OUT_minor _OUT_micro _sigcxxversion_hdr)
+    file(STRINGS ${_sigcxxversion_hdr} _contents REGEX "#define SIGCXX_M[A-Z]+_VERSION[ \t]+")
+    if(_contents)
+        string(REGEX REPLACE ".*#define SIGCXX_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" ${_OUT_major} "${_contents}")
+        string(REGEX REPLACE ".*#define SIGCXX_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" ${_OUT_minor} "${_contents}")
+        string(REGEX REPLACE ".*#define SIGCXX_MICRO_VERSION[ \t]+([0-9]+).*" "\\1" ${_OUT_micro} "${_contents}")
+
+        if(NOT ${_OUT_major} MATCHES "[0-9]+")
+            message(FATAL_ERROR "Version parsing failed for SIGCXX_MAJOR_VERSION!")
+        endif()
+        if(NOT ${_OUT_minor} MATCHES "[0-9]+")
+            message(FATAL_ERROR "Version parsing failed for SIGCXX_MINOR_VERSION!")
+        endif()
+        if(NOT ${_OUT_micro} MATCHES "[0-9]+")
+            message(FATAL_ERROR "Version parsing failed for SIGCXX_MICRO_VERSION!")
+        endif()
+
+        set(${_OUT_major} ${${_OUT_major}} PARENT_SCOPE)
+        set(${_OUT_minor} ${${_OUT_minor}} PARENT_SCOPE)
+        set(${_OUT_micro} ${${_OUT_micro}} PARENT_SCOPE)
+    else()
+        message(FATAL_ERROR "Include file ${_gtkversion_hdr} does not exist")
+    endif()
+endfunction()
+
+
 #=============================================================
 # _GTK2_FIND_INCLUDE_DIR
 # Internal function to find the GTK include directories
@@ -734,6 +771,25 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
         _GTK2_FIND_INCLUDE_DIR(SIGC++CONFIG sigc++config.h)
         _GTK2_FIND_LIBRARY    (SIGC++ sigc true true)
         _GTK2_ADD_TARGET      (SIGC++)
+        # Since sigc++ 2.5.1 c++11 support is required
+        _GTK2_SIGCXX_GET_VERSION(GTK2_SIGC++_VERSION_MAJOR
+                                 GTK2_SIGC++_VERSION_MINOR
+                                 GTK2_SIGC++_VERSION_MICRO
+                                 ${GTK2_SIGC++CONFIG_INCLUDE_DIR}/sigc++config.h)
+        if(NOT ${GTK2_SIGC++_VERSION_MAJOR}.${GTK2_SIGC++_VERSION_MINOR}.${GTK2_SIGC++_VERSION_MICRO} VERSION_LESS 2.5.1)
+            # These are the features needed by clients in order to include the
+            # project headers:
+            set_property(TARGET GTK2::sigc++
+                         PROPERTY INTERFACE_COMPILE_FEATURES cxx_alias_templates
+                                                             cxx_auto_type
+                                                             cxx_decltype
+                                                             cxx_deleted_functions
+                                                             cxx_noexcept
+                                                             cxx_nullptr
+                                                             cxx_right_angle_brackets
+                                                             cxx_rvalue_references
+                                                             cxx_variadic_templates)
+        endif()
 
         _GTK2_FIND_INCLUDE_DIR(GLIBMM glibmm.h)
         _GTK2_FIND_INCLUDE_DIR(GLIBMMCONFIG glibmmconfig.h)

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

Summary of changes:
 Help/release/dev/FindGTK2_sigc++_c++11.rst |    7 ++++
 Modules/FindGTK2.cmake                     |   56 ++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)
 create mode 100644 Help/release/dev/FindGTK2_sigc++_c++11.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list