[Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-640-g9f2c6ee

Brad King brad.king at kitware.com
Thu Oct 20 13:39:26 EDT 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  9f2c6ee4d0a389aa89f94754f50a59674ab06e67 (commit)
       via  587ab3221300f04a4de0756dc1a44fa0eac9c0d2 (commit)
       via  149d49ea7c009f9965d9be91cdac8ee6cd2cfb91 (commit)
       via  60d73393a50944c1e81472d7e80a458bcb898554 (commit)
      from  dfe2e256cdfdec77894e0fb7832279c996b3d81e (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=9f2c6ee4d0a389aa89f94754f50a59674ab06e67
commit 9f2c6ee4d0a389aa89f94754f50a59674ab06e67
Merge: dfe2e25 587ab32
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 20 13:39:25 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Oct 20 13:39:25 2016 -0400

    Merge topic 'allow-fallback-config-mapping' into next
    
    587ab322 Tests: Add test for MAP_IMPORTED_CONFIG_<CONFIG> empty fallback
    149d49ea Teach MAP_IMPORTED_CONFIG_<CONFIG> to support configuration-less import
    60d73393 Help: Format MAP_IMPORTED_CONFIG_<CONFIG> documentation


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=587ab3221300f04a4de0756dc1a44fa0eac9c0d2
commit 587ab3221300f04a4de0756dc1a44fa0eac9c0d2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 20 11:49:57 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 20 11:51:11 2016 -0400

    Tests: Add test for MAP_IMPORTED_CONFIG_<CONFIG> empty fallback

diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 27f33a2..4f2f434 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -171,6 +171,13 @@ add_executable(Alias::SomeExe ALIAS someexe)
 
 add_library(Alias::SomeLib ALIAS empty1)
 
+add_library(importedFallback STATIC IMPORTED)
+set_property(TARGET importedFallback PROPERTY IMPORTED_LOCATION_DEBUG debug_loc)
+set_property(TARGET importedFallback PROPERTY IMPORTED_LOCATION_RELEASE release_loc)
+set_property(TARGET importedFallback PROPERTY IMPORTED_LOCATION fallback_loc)
+set_property(TARGET importedFallback PROPERTY MAP_IMPORTED_CONFIG_DEBUG "" DEBUG)
+set_property(TARGET importedFallback PROPERTY MAP_IMPORTED_CONFIG_RELEASE "")
+
 add_custom_target(check-part3 ALL
   COMMAND ${CMAKE_COMMAND}
     -Dtest_version_greater_1=$<VERSION_GREATER:1.0,1.1.1>
@@ -184,6 +191,7 @@ add_custom_target(check-part3 ALL
     -Dtest_imported_release=$<TARGET_PROPERTY:imported4,INCLUDE_DIRECTORIES>
     -Dtest_imported_relwithdebinfo=$<TARGET_PROPERTY:imported4,INCLUDE_DIRECTORIES>
     -Dtest_imported_minsizerel=$<TARGET_PROPERTY:imported4,INCLUDE_DIRECTORIES>
+    -Dtest_imported_fallback=$<STREQUAL:$<TARGET_FILE_NAME:importedFallback>,fallback_loc>
     -Dtest_alias_file_exe=$<STREQUAL:$<TARGET_FILE:Alias::SomeExe>,$<TARGET_FILE:someexe>>
     -Dtest_alias_file_lib=$<STREQUAL:$<TARGET_FILE:Alias::SomeLib>,$<TARGET_FILE:empty1>>
     -Dtest_alias_target_name=$<STREQUAL:$<TARGET_PROPERTY:Alias::SomeLib,NAME>,$<TARGET_PROPERTY:empty1,NAME>>
diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake
index 70ccfe1..e12d8c6 100644
--- a/Tests/GeneratorExpression/check-part3.cmake
+++ b/Tests/GeneratorExpression/check-part3.cmake
@@ -21,6 +21,8 @@ foreach(c debug release relwithdebinfo minsizerel)
   endif()
 endforeach()
 
+check(test_imported_fallback "1")
+
 check(test_alias_file_exe "1")
 check(test_alias_file_lib "1")
 check(test_alias_target_name "1")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=149d49ea7c009f9965d9be91cdac8ee6cd2cfb91
commit 149d49ea7c009f9965d9be91cdac8ee6cd2cfb91
Author:     Jens Weggemann <jensweh at gmail.com>
AuthorDate: Wed Oct 19 03:39:51 2016 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 20 11:51:10 2016 -0400

    Teach MAP_IMPORTED_CONFIG_<CONFIG> to support configuration-less import
    
    If this property has an empty list entry, check for `IMPORTED_LOCATION`
    instead of `IMPORTED_LOCATION_<CONFIG>`.  This allows custom imported
    targets to have some configurations mapped and others fall back to a
    default location.
    
    Closes: #16280

diff --git a/Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst b/Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst
index 9eed069..4da855b 100644
--- a/Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst
+++ b/Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst
@@ -10,8 +10,13 @@ imported from another project may not provide the same set of
 configuration names available in the current project.  Setting this
 property tells CMake what imported configurations are suitable for use
 when building the ``<CONFIG>`` configuration.  The first configuration in
-the list found to be provided by the imported target is selected.  If
-this property is set and no matching configurations are available,
+the list found to be provided by the imported target (i.e. via
+:prop_tgt:`IMPORTED_LOCATION_<CONFIG>` for the mapped-to ``<CONFIG>``)
+is selected.  As a special case, an empty list element refers to the
+configuration-less imported target location
+(i.e. :prop_tgt:`IMPORTED_LOCATION`).
+
+If this property is set and no matching configurations are available,
 then the imported target is considered to be not found.  This property
 is ignored for non-imported targets.
 
diff --git a/Help/release/dev/allow-fallback-config-mapping.rst b/Help/release/dev/allow-fallback-config-mapping.rst
new file mode 100644
index 0000000..2522e10
--- /dev/null
+++ b/Help/release/dev/allow-fallback-config-mapping.rst
@@ -0,0 +1,6 @@
+allow-fallback-config-mapping
+-----------------------------
+
+* The :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` target property learned
+  to interpret empty list elements as referring to the configuration-less
+  imported location specified by :prop_tgt:`IMPORTED_LOCATION`.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 3a22309..de30f98 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1395,7 +1395,7 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
     std::string mapProp = "MAP_IMPORTED_CONFIG_";
     mapProp += desired_config;
     if (const char* mapValue = this->GetProperty(mapProp)) {
-      cmSystemTools::ExpandListArgument(mapValue, mappedConfigs);
+      cmSystemTools::ExpandListArgument(mapValue, mappedConfigs, true);
     }
   }
 
@@ -1408,20 +1408,33 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
   for (std::vector<std::string>::const_iterator mci = mappedConfigs.begin();
        !*loc && !*imp && mci != mappedConfigs.end(); ++mci) {
     // Look for this configuration.
-    std::string mcUpper = cmSystemTools::UpperCase(*mci);
-    std::string locProp = "IMPORTED_LOCATION_";
-    locProp += mcUpper;
-    *loc = this->GetProperty(locProp);
-    if (allowImp) {
-      std::string impProp = "IMPORTED_IMPLIB_";
-      impProp += mcUpper;
-      *imp = this->GetProperty(impProp);
-    }
+    if (mci->empty()) {
+      // An empty string in the mapping has a special meaning:
+      // look up the config-less properties.
+      *loc = this->GetProperty("IMPORTED_LOCATION");
+      if (allowImp) {
+        *imp = this->GetProperty("IMPORTED_IMPLIB");
+      }
+      // If it was found, set the suffix.
+      if (*loc || *imp) {
+        suffix = "";
+      }
+    } else {
+      std::string mcUpper = cmSystemTools::UpperCase(*mci);
+      std::string locProp = "IMPORTED_LOCATION_";
+      locProp += mcUpper;
+      *loc = this->GetProperty(locProp);
+      if (allowImp) {
+        std::string impProp = "IMPORTED_IMPLIB_";
+        impProp += mcUpper;
+        *imp = this->GetProperty(impProp);
+      }
 
-    // If it was found, use it for all properties below.
-    if (*loc || *imp) {
-      suffix = "_";
-      suffix += mcUpper;
+      // If it was found, use it for all properties below.
+      if (*loc || *imp) {
+        suffix = "_";
+        suffix += mcUpper;
+      }
     }
   }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=60d73393a50944c1e81472d7e80a458bcb898554
commit 60d73393a50944c1e81472d7e80a458bcb898554
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 20 11:28:39 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 20 11:31:13 2016 -0400

    Help: Format MAP_IMPORTED_CONFIG_<CONFIG> documentation

diff --git a/Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst b/Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst
index 09ff0ce..9eed069 100644
--- a/Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst
+++ b/Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst
@@ -1,19 +1,20 @@
 MAP_IMPORTED_CONFIG_<CONFIG>
 ----------------------------
 
-Map from project configuration to IMPORTED target's configuration.
+Map from project configuration to
+:ref:`imported target <IMPORTED targets>`'s configuration.
 
 Set this to the list of configurations of an imported target that may
-be used for the current project's <CONFIG> configuration.  Targets
+be used for the current project's ``<CONFIG>`` configuration.  Targets
 imported from another project may not provide the same set of
 configuration names available in the current project.  Setting this
 property tells CMake what imported configurations are suitable for use
-when building the <CONFIG> configuration.  The first configuration in
+when building the ``<CONFIG>`` configuration.  The first configuration in
 the list found to be provided by the imported target is selected.  If
 this property is set and no matching configurations are available,
 then the imported target is considered to be not found.  This property
 is ignored for non-imported targets.
 
-This property is initialized by the value of the variable
-CMAKE_MAP_IMPORTED_CONFIG_<CONFIG> if it is set when a target is
-created.
+This property is initialized by the value of the
+:variable:`CMAKE_MAP_IMPORTED_CONFIG_<CONFIG>` variable if it is set when a
+target is created.

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

Summary of changes:
 Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst       |   22 +++++++----
 Help/release/dev/allow-fallback-config-mapping.rst |    6 +++
 Source/cmTarget.cxx                                |   41 +++++++++++++-------
 Tests/GeneratorExpression/CMakeLists.txt           |    8 ++++
 Tests/GeneratorExpression/check-part3.cmake        |    2 +
 5 files changed, 57 insertions(+), 22 deletions(-)
 create mode 100644 Help/release/dev/allow-fallback-config-mapping.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list