[Cmake-commits] CMake branch, next, updated. v3.0.0-3902-g507e4bb

Brad King brad.king at kitware.com
Tue Jun 24 14:12:36 EDT 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  507e4bb43abfab9578ce6b019d5cd25c4cff55da (commit)
       via  b5b524aac055db83cf22c28ac4d163d95b1ed5c2 (commit)
       via  38da974d3ba4edf3aa6d233275fac53b08147bbb (commit)
       via  144b255b085095fa396f483ad48c81c3e89cae60 (commit)
      from  773956f770919b1acd0cfd3e8d95fca6a186e7f5 (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=507e4bb43abfab9578ce6b019d5cd25c4cff55da
commit 507e4bb43abfab9578ce6b019d5cd25c4cff55da
Merge: 773956f b5b524a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jun 24 14:12:35 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jun 24 14:12:35 2014 -0400

    Merge topic 'find-module-targets' into next
    
    b5b524aa Help: Add notes for topic 'find-module-targets'
    38da974d FindBoost.cmake: Add Boost::boost and Boost::<C> targets and documentation
    144b255b FindGLUT.cmake: Add imported targets and documentation


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b5b524aac055db83cf22c28ac4d163d95b1ed5c2
commit b5b524aac055db83cf22c28ac4d163d95b1ed5c2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jun 24 14:12:03 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jun 24 14:12:03 2014 -0400

    Help: Add notes for topic 'find-module-targets'

diff --git a/Help/release/dev/find-module-targets.rst b/Help/release/dev/find-module-targets.rst
new file mode 100644
index 0000000..3b3fb0a
--- /dev/null
+++ b/Help/release/dev/find-module-targets.rst
@@ -0,0 +1,10 @@
+find-module-targets
+-------------------
+
+* The :module:`FindBoost` module now provides imported targets.
+
+* The :module:`FindGLUT` module now provides imported targets.
+
+* The :module:`FindGLEW` module now provides imported targets.
+
+* The :module:`FindZLIB` module now provides imported targets.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=38da974d3ba4edf3aa6d233275fac53b08147bbb
commit 38da974d3ba4edf3aa6d233275fac53b08147bbb
Author:     Philipp Moeller <bootsarehax at gmail.com>
AuthorDate: Tue Jun 24 15:48:48 2014 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jun 24 14:08:31 2014 -0400

    FindBoost.cmake: Add Boost::boost and Boost::<C> targets and documentation

diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index dfd4460..ceeb7e5 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -53,6 +53,24 @@
 #   Boost_<C>_LIBRARY_DEBUG   - Component <C> library debug variant
 #   Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
 #
+# In addition to the above variables this module creates the following
+# :prop_tgt:`IMPORTED` targets::
+#
+#   Boost::boost                  - interface target containing the include
+#                                   directory
+#   Boost::<C>                    - shared or static library target for a
+#                                   component (<C> is lower-case)
+#   Boost::diagnostic_definitions - interface target to enable diagnostic
+#                                   information about Boost's automatic linking
+#                                   during compilation
+#
+# Component targets never depend on each even though they might
+# require each other. It is important to note that the imported
+# targets behave differently than variables created by this module:
+# multiple calls to find_package(Boost) in the same directory or
+# sub-directories with different options (e.g. static or shared) will
+# not override the values of the targets created by the first call.
+#
 # Users may set these hints or results as cache entries.  Projects
 # should not read these entries directly but instead use the above
 # result variables.  Note that some hint names start in upper-case
@@ -524,6 +542,13 @@ if(Boost_DEBUG)
                  "Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}")
 endif()
 
+# Supply Boost_LIB_DIAGNOSTIC_DEFINITIONS as a convenience target. It
+# will only contain any interface definitions on WIN32, but is created
+# on all platforms to keep end user code free from platform dependent
+# code.
+if(NOT TARGET Boost::diagnostic_definitions)
+  add_library(Boost::diagnostic_definitions INTERFACE IMPORTED)
+endif()
 if(WIN32)
   # In windows, automatic linking is performed, so you do not have
   # to specify the libraries.  If you are linking to a dynamic
@@ -543,6 +568,8 @@ if(WIN32)
   # code to emit a #pragma message each time a library is selected
   # for linking.
   set(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
+  set_target_properties(Boost::diagnostic_definitions PROPERTIES
+    INTERFACE_COMPILE_DEFINITIONS "BOOST_LIB_DIAGNOSTIC")
 endif()
 
 _Boost_CHECK_SPELLING(Boost_ROOT)
@@ -1155,11 +1182,36 @@ else()
 endif()
 
 # ------------------------------------------------------------------------
-#  Notification to end user about what was found
+#  Notification to end user about what was found and creation of targets.
 # ------------------------------------------------------------------------
 
 set(Boost_LIBRARIES "")
 if(Boost_FOUND)
+  if(NOT TARGET Boost::boost)
+    add_library(Boost::boost INTERFACE IMPORTED)
+    set_target_properties(Boost::boost PROPERTIES
+      INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIR}")
+  endif()
+
+  foreach(COMPONENT ${Boost_FIND_COMPONENTS})
+    string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
+
+    if(NOT TARGET Boost::${COMPONENT})
+      if(Boost_USE_STATIC_LIBS)
+        add_library(Boost::${COMPONENT} STATIC IMPORTED)
+      else()
+        # Even if Boost_USE_STATIC_LIBS is OFF, we might have static
+        # libraries as a result.
+        add_library(Boost::${COMPONENT} UNKNOWN IMPORTED)
+      endif()
+
+      set_target_properties(Boost::${COMPONENT} PROPERTIES
+        IMPORTED_LOCATION "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}"
+        IMPORTED_LOCATION_RELEASE "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}"
+        IMPORTED_LOCATION_DEBUG "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
+    endif()
+  endforeach()
+
   if(NOT Boost_FIND_QUIETLY)
     message(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
     if(Boost_FIND_COMPONENTS)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=144b255b085095fa396f483ad48c81c3e89cae60
commit 144b255b085095fa396f483ad48c81c3e89cae60
Author:     Philipp Moeller <bootsarehax at gmail.com>
AuthorDate: Tue Jun 24 16:06:44 2014 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jun 24 14:08:02 2014 -0400

    FindGLUT.cmake: Add imported targets and documentation
    
    Also let find_library really search for frameworks on OS X.

diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake
index be7c0cd..c9f7597 100644
--- a/Modules/FindGLUT.cmake
+++ b/Modules/FindGLUT.cmake
@@ -2,7 +2,20 @@
 # FindGLUT
 # --------
 #
-# try to find glut library and include files
+# try to find glut library and include files.
+#
+# IMPORTED Targets
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines the :prop_tgt:`IMPORTED` targets:
+#
+# ``GLUT::GLUT``
+#  Defined if the system has GLUT.
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module sets the following variables:
 #
 # ::
 #
@@ -42,13 +55,21 @@ if (WIN32)
 else ()
 
   if (APPLE)
-    # These values for Apple could probably do with improvement.
-    find_path( GLUT_INCLUDE_DIR glut.h
-      /System/Library/Frameworks/GLUT.framework/Versions/A/Headers
-      ${OPENGL_LIBRARY_DIR}
-      )
-    set(GLUT_glut_LIBRARY "-framework GLUT" CACHE STRING "GLUT library for OSX")
-    set(GLUT_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
+    find_path(GLUT_INCLUDE_DIR glut.h ${OPENGL_LIBRARY_DIR})
+    find_library(GLUT_glut_LIBRARY GLUT DOC "GLUT library for OSX")
+    find_library(GLUT_cocoa_LIBRARY Cocoa DOC "Cocoa framework for OSX")
+
+    if(GLUT_cocoa_LIBRARY AND NOT TARGET GLUT::Cocoa)
+      add_library(GLUT::Cocoa UNKNOWN IMPORTED)
+      # Cocoa should always be a Framework, but we check to make sure.
+      if(GLUT_cocoa_LIBRARY MATCHES "/([^/]+)\\.framework$")
+        set_target_properties(GLUT::Cocoa PROPERTIES
+          IMPORTED_LOCATION "${GLUT_cocoa_LIBRARY}/${CMAKE_MATCH_1}")
+      else()
+        set_target_properties(GLUT::Cocoa PROPERTIES
+          IMPORTED_LOCATION "${GLUT_cocoa_LIBRARY}")
+      endif()
+    endif()
   else ()
 
     if (BEOS)
@@ -66,6 +87,18 @@ else ()
         /usr/openwin/lib
         )
 
+      if(GLUT_Xi_LIBRARY AND NOT TARGET GLUT::Xi)
+        add_library(GLUT::Xi UNKNOWN IMPORTED)
+        set_target_properties(GLUT::Xi PROPERTIES
+          IMPORTED_LOCATION "${GLUT_Xi_LIBRARY}")
+      endif()
+
+      if(GLUT_Xmu_LIBRARY AND NOT TARGET GLUT::Xmu)
+        add_library(GLUT::Xmu UNKNOWN IMPORTED)
+        set_target_properties(GLUT::Xmu PROPERTIES
+          IMPORTED_LOCATION "${GLUT_Xmu_LIBRARY}")
+      endif()
+
     endif ()
 
     find_path( GLUT_INCLUDE_DIR GL/glut.h
@@ -102,6 +135,34 @@ if (GLUT_FOUND)
     ${GLUT_cocoa_LIBRARY}
     )
 
+  if(NOT TARGET GLUT::GLUT)
+    add_library(GLUT::GLUT UNKNOWN IMPORTED)
+    set_target_properties(GLUT::GLUT PROPERTIES
+      INTERFACE_INCLUDE_DIRECTORIES "${GLUT_INCLUDE_DIR}")
+    if(GLUT_glut_LIBRARY MATCHES "/([^/]+)\\.framework$")
+      set_target_properties(GLUT::GLUT PROPERTIES
+        IMPORTED_LOCATION "${GLUT_glut_LIBRARY}/${CMAKE_MATCH_1}")
+    else()
+      set_target_properties(GLUT::GLUT PROPERTIES
+        IMPORTED_LOCATION "${GLUT_glut_LIBRARY}")
+    endif()
+
+    if(TARGET GLUT::Xmu)
+      set_property(TARGET GLUT::GLUT APPEND
+        PROPERTY INTERFACE_LINK_LIBRARIES GLUT::Xmu)
+    endif()
+
+    if(TARGET GLUT::Xi)
+      set_property(TARGET GLUT::GLUT APPEND
+        PROPERTY INTERFACE_LINK_LIBRARIES GLUT::Xi)
+    endif()
+
+    if(TARGET GLUT::Cocoa)
+      set_property(TARGET GLUT::GLUT APPEND
+        PROPERTY INTERFACE_LINK_LIBRARIES GLUT::Cocoa)
+    endif()
+  endif()
+
   #The following deprecated settings are for backwards compatibility with CMake1.4
   set (GLUT_LIBRARY ${GLUT_LIBRARIES})
   set (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR})

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

Summary of changes:
 Help/release/dev/find-module-targets.rst |   10 ++++
 Modules/FindBoost.cmake                  |   54 ++++++++++++++++++++-
 Modules/FindGLUT.cmake                   |   77 ++++++++++++++++++++++++++----
 3 files changed, 132 insertions(+), 9 deletions(-)
 create mode 100644 Help/release/dev/find-module-targets.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list