[Cmake-commits] CMake branch, next, updated. v2.8.9-1176-g61af315

Rolf Eike Beer eike at sf-mail.de
Sun Oct 21 09:25:49 EDT 2012


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  61af3150500ca2657c86268e11dd6f40e3d55b4b (commit)
       via  a22f4fabb7eb6a978c5f0ddf7988d1c57793f7e6 (commit)
       via  5052fbc93d8158e44d1a44f167ba00f39813b82f (commit)
      from  f461abbc352b2e44943e1589f0e0527657cac9c7 (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=61af3150500ca2657c86268e11dd6f40e3d55b4b
commit 61af3150500ca2657c86268e11dd6f40e3d55b4b
Merge: f461abb a22f4fa
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Sun Oct 21 09:25:47 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Oct 21 09:25:47 2012 -0400

    Merge topic 'test-SelectLibraryConfigurations' into next
    
    a22f4fa SelectLibraryConfigurations: fix for release and debug libs being the same
    5052fbc SelectLibraryConfigurations: add testcase


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a22f4fabb7eb6a978c5f0ddf7988d1c57793f7e6
commit a22f4fabb7eb6a978c5f0ddf7988d1c57793f7e6
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Sun Oct 21 15:24:25 2012 +0200
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Sun Oct 21 15:24:25 2012 +0200

    SelectLibraryConfigurations: fix for release and debug libs being the same

diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake
index 82bb173..709f345 100644
--- a/Modules/SelectLibraryConfigurations.cmake
+++ b/Modules/SelectLibraryConfigurations.cmake
@@ -48,6 +48,15 @@ macro( select_library_configurations basename )
     # if only the debug version was found, set the release value to be the
     # debug value.
     _set_library_name( ${basename} DEBUG RELEASE )
+
+    # Set a default case, which will come into effect if
+    # -no build type is set and the generator only supports one build type
+    #  at a time (i.e. CMAKE_CONFIGURATION_TYPES is false)
+    # -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are the same
+    # -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are both empty
+    set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
+    set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} )
+
     if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
            NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE )
         # if the generator supports configuration types or CMAKE_BUILD_TYPE
@@ -61,11 +70,6 @@ macro( select_library_configurations basename )
                 list( APPEND ${basename}_LIBRARY debug "${_libname}" )
             endforeach()
             set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
-        else()
-            # If there are no configuration types or build type, just use
-            # the release version
-            set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
-            set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} )
         endif()
     endif()
 
diff --git a/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt
index b3b05c3..5bf0f8a 100644
--- a/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt
+++ b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt
@@ -37,6 +37,10 @@ check_slc(OPTONLY "opt")
 set(DBGONLY_LIBRARY_RELEASE "dbg")
 check_slc(DBGONLY "dbg")
 
+set(SAME_LIBRARY_RELEASE "same")
+set(SAME_LIBRARY_DEBUG "same")
+check_slc(SAME "same")
+
 set(OPTONLYLIST_LIBRARY_RELEASE "opt1;opt2")
 check_slc(OPTONLYLIST "opt1;opt2")
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5052fbc93d8158e44d1a44f167ba00f39813b82f
commit 5052fbc93d8158e44d1a44f167ba00f39813b82f
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Sun Oct 21 15:17:20 2012 +0200
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Sun Oct 21 15:17:20 2012 +0200

    SelectLibraryConfigurations: add testcase

diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
index ba681d8..51a630f 100644
--- a/Tests/CMakeOnly/CMakeLists.txt
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -27,6 +27,8 @@ endif()
 
 add_CMakeOnly_test(AllFindModules)
 
+add_CMakeOnly_test(SelectLibraryConfigurations)
+
 add_CMakeOnly_test(TargetScope)
 
 add_CMakeOnly_test(find_library)
diff --git a/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt
new file mode 100644
index 0000000..b3b05c3
--- /dev/null
+++ b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt
@@ -0,0 +1,60 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(SelectLibraryConfigurations NONE)
+
+include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
+
+macro(check_slc basename expect)
+  message(STATUS "checking select_library_configurations(${basename})")
+  select_library_configurations(${basename})
+  if (NOT ${basename}_LIBRARY STREQUAL "${expect}")
+    message(SEND_ERROR "select_library_configurations(${basename}) returned '${${basename}_LIBRARY}' but '${expect}' was expected")
+  endif ()
+  if (NOT ${basename}_LIBRARY STREQUAL "${${basename}_LIBRARIES}")
+    message(SEND_ERROR "select_library_configurations(${basename}) LIBRARY: '${${basename}_LIBRARY}' LIBRARIES: '${${basename}_LIBRARIES}'")
+  endif ()
+endmacro(check_slc)
+
+if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
+  set(NOTYPE_RELONLY_LIBRARY_RELEASE "opt")
+  check_slc(NOTYPE_RELONLY "opt")
+
+  set(NOTYPE_DBGONLY_LIBRARY_DEBUG "dbg")
+  check_slc(NOTYPE_DBGONLY "dbg")
+
+  set(NOTYPE_RELDBG_LIBRARY_RELEASE "opt")
+  set(NOTYPE_RELDBG_LIBRARY_DEBUG "dbg")
+  check_slc(NOTYPE_RELDBG "opt")
+
+  set(CMAKE_BUILD_TYPE Debug)
+endif ()
+
+check_slc(empty "")
+
+set(OPTONLY_LIBRARY_RELEASE "opt")
+check_slc(OPTONLY "opt")
+
+set(DBGONLY_LIBRARY_RELEASE "dbg")
+check_slc(DBGONLY "dbg")
+
+set(OPTONLYLIST_LIBRARY_RELEASE "opt1;opt2")
+check_slc(OPTONLYLIST "opt1;opt2")
+
+set(DBGONLYLIST_LIBRARY_RELEASE "dbg1;dbg2")
+check_slc(DBGONLYLIST "dbg1;dbg2")
+
+set(OPT1DBG1_LIBRARY_RELEASE "opt")
+set(OPT1DBG1_LIBRARY_DEBUG "dbg")
+check_slc(OPT1DBG1 "optimized;opt;debug;dbg")
+
+set(OPT1DBG2_LIBRARY_RELEASE "opt")
+set(OPT1DBG2_LIBRARY_DEBUG "dbg1;dbg2")
+check_slc(OPT1DBG2 "optimized;opt;debug;dbg1;debug;dbg2")
+
+set(OPT2DBG1_LIBRARY_RELEASE "opt1;opt2")
+set(OPT2DBG1_LIBRARY_DEBUG "dbg")
+check_slc(OPT2DBG1 "optimized;opt1;optimized;opt2;debug;dbg")
+
+set(OPT2DBG2_LIBRARY_RELEASE "opt1;opt2")
+set(OPT2DBG2_LIBRARY_DEBUG "dbg1;dbg2")
+check_slc(OPT2DBG2 "optimized;opt1;optimized;opt2;debug;dbg1;debug;dbg2")

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

Summary of changes:
 Modules/SelectLibraryConfigurations.cmake          |   14 +++--
 Tests/CMakeOnly/CMakeLists.txt                     |    2 +
 .../SelectLibraryConfigurations/CMakeLists.txt     |   64 ++++++++++++++++++++
 3 files changed, 75 insertions(+), 5 deletions(-)
 create mode 100644 Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list