[Cmake-commits] CMake branch, next, updated. v3.5.0-rc2-104-geb9e0d1

Brad King brad.king at kitware.com
Thu Feb 11 08:47:40 EST 2016


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  eb9e0d130321d0538e3d3cc3e373581f007995dc (commit)
       via  51b0501a7ff3812a2669caf474742b164d776e81 (commit)
       via  d83abbf9e3f0d5c46ef7f828c7b49f3413647fee (commit)
      from  92b83e8a59da7486afa330f7cd0b8f6201892650 (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=eb9e0d130321d0538e3d3cc3e373581f007995dc
commit eb9e0d130321d0538e3d3cc3e373581f007995dc
Merge: 92b83e8 51b0501
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Feb 11 08:47:39 2016 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Feb 11 08:47:39 2016 -0500

    Merge topic 'FindProtobuf-select-library-config' into next
    
    51b0501a FindProtobuf: prevent redundant PROTOBUF_LIBRARIES
    d83abbf9 CMake Nightly Date Stamp


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51b0501a7ff3812a2669caf474742b164d776e81
commit 51b0501a7ff3812a2669caf474742b164d776e81
Author:     Antonio Perez Barrero <apbarrero at gmail.com>
AuthorDate: Thu Feb 11 09:24:27 2016 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Feb 11 08:45:41 2016 -0500

    FindProtobuf: prevent redundant PROTOBUF_LIBRARIES
    
    Before this change, the variable PROTOBUF_LIBRARIES might get redundant
    value for debug and optimized configurations, e.g.
    `optimized;/usr/lib/libprotobuf.so;debug;/usr/lib/libprotobuf.so`.

diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 2f13b09..0875349 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -210,32 +210,33 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
   set(_PROTOBUF_ARCH_DIR x64/)
 endif()
 
+include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+
 # Internal function: search for normal library as well as a debug one
 #    if the debug one is specified also include debug/optimized keywords
 #    in *_LIBRARIES variable
 function(_protobuf_find_libraries name filename)
-   find_library(${name}_LIBRARY
-       NAMES ${filename}
-       PATHS ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Release)
-   mark_as_advanced(${name}_LIBRARY)
-
-   find_library(${name}_LIBRARY_DEBUG
-       NAMES ${filename}
-       PATHS ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Debug)
-   mark_as_advanced(${name}_LIBRARY_DEBUG)
-
-   if(NOT ${name}_LIBRARY_DEBUG)
-      # There is no debug library
-      set(${name}_LIBRARY_DEBUG ${${name}_LIBRARY} PARENT_SCOPE)
-      set(${name}_LIBRARIES     ${${name}_LIBRARY} PARENT_SCOPE)
-   else()
-      # There IS a debug library
-      set(${name}_LIBRARIES
-          optimized ${${name}_LIBRARY}
-          debug     ${${name}_LIBRARY_DEBUG}
-          PARENT_SCOPE
-      )
-   endif()
+  if(${name}_LIBRARIES)
+    # Use result recorded by a previous call.
+    return()
+  elseif(${name}_LIBRARY)
+    # Honor cache entry used by CMake 3.5 and lower.
+    set(${name}_LIBRARIES "${${name}_LIBRARY}" PARENT_SCOPE)
+  else()
+    find_library(${name}_LIBRARY_RELEASE
+      NAMES ${filename}
+      PATHS ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Release)
+    mark_as_advanced(${name}_LIBRARY_RELEASE)
+
+    find_library(${name}_LIBRARY_DEBUG
+      NAMES ${filename}
+      PATHS ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Debug)
+    mark_as_advanced(${name}_LIBRARY_DEBUG)
+
+    select_library_configurations(${name})
+    set(${name}_LIBRARY "${${name}_LIBRARY}" PARENT_SCOPE)
+    set(${name}_LIBRARIES "${${name}_LIBRARIES}" PARENT_SCOPE)
+  endif()
 endfunction()
 
 # Internal function: find threads library

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

Summary of changes:
 Modules/FindProtobuf.cmake |   45 ++++++++++++++++++++++----------------------
 Source/CMakeVersion.cmake  |    2 +-
 2 files changed, 24 insertions(+), 23 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list