[Cmake-commits] CMake branch, master, updated. v3.10.0-rc4-264-g30fcf13

Kitware Robot kwrobot at kitware.com
Wed Nov 8 09:15:05 EST 2017


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, master has been updated
       via  30fcf13be6680d6a4eb112f98cc2d99c6881f401 (commit)
       via  9f30cd13dad63b2a327162285711cd36dcc20b92 (commit)
       via  f8f3338582c863642fef9a31a8d8345cdd78d263 (commit)
       via  6a3922bebea607dcc23944b1fe79b7b613a893d1 (commit)
       via  517cfe0b8c327ee4d68de777b812c4854e3d46a8 (commit)
       via  dc059ae70b2ec79bce2b534876a2f4006293d3b6 (commit)
       via  854e482a59d6696bbb6988a045ac701e26bb038a (commit)
       via  3c3682289dfe62fa2448e1be7ab714e674b475d8 (commit)
       via  72d27964b92ddb4d8ee85e32a27d0e56d642ec1c (commit)
      from  3b853ffd1605cab8a72a66a6312840644227e1e9 (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=30fcf13be6680d6a4eb112f98cc2d99c6881f401
commit 30fcf13be6680d6a4eb112f98cc2d99c6881f401
Merge: 9f30cd1 6a3922b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Nov 8 14:08:08 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Nov 8 09:08:15 2017 -0500

    Merge topic 'imported-promotion'
    
    6a3922be Add new target-property `IMPORTED_GLOBAL`.
    854e482a cmTarget: Simplified and fixed a string-comparision.
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1254


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9f30cd13dad63b2a327162285711cd36dcc20b92
commit 9f30cd13dad63b2a327162285711cd36dcc20b92
Merge: f8f3338 517cfe0
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Nov 8 14:05:32 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Nov 8 09:05:59 2017 -0500

    Merge topic 'update-kwsys'
    
    517cfe0b Merge branch 'upstream-KWSys' into update-kwsys
    dc059ae7 KWSys 2017-11-07 (5249a82d)
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1458


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f8f3338582c863642fef9a31a8d8345cdd78d263
commit f8f3338582c863642fef9a31a8d8345cdd78d263
Merge: 3b853ff 3c36822
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Nov 8 14:05:01 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Nov 8 09:05:13 2017 -0500

    Merge topic 'flang-windows'
    
    3c368228 Flang: Add support for compiling sources on Windows
    72d27964 Flang: Identify as simulating MSVC on Windows
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1430


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6a3922bebea607dcc23944b1fe79b7b613a893d1
commit 6a3922bebea607dcc23944b1fe79b7b613a893d1
Author:     Deniz Bahadir <dbahadir at benocs.com>
AuthorDate: Tue Sep 5 17:32:32 2017 +0200
Commit:     Deniz Bahadir <dbahadir at benocs.com>
CommitDate: Tue Nov 7 15:08:41 2017 +0100

    Add new target-property `IMPORTED_GLOBAL`.
    
    The purpose of this new `IMPORTED_GLOBAL` target-property is to prolong
    the lifetime and scope of `IMPORTED` targets in such a way as if they
    had been created with the keyword `GLOBAL` in the first place.
    
    * It can only be set to `TRUE`. That means, a local `IMPORTED` target
      can be promoted to global scope but a global `IMPORTED` target cannot
      be degraded to local scope!
    * Setting it to `TRUE` only succeeds if done from within the same
      directory in which the `IMPORTED` target was created in the first
      place.
    
    Fixes #17256.

diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 13b22f8..2c63c4b 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -184,6 +184,7 @@ Properties on Targets
    /prop_tgt/HAS_CXX
    /prop_tgt/IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
    /prop_tgt/IMPORTED_CONFIGURATIONS
+   /prop_tgt/IMPORTED_GLOBAL
    /prop_tgt/IMPORTED_IMPLIB_CONFIG
    /prop_tgt/IMPORTED_IMPLIB
    /prop_tgt/IMPORTED_LIBNAME_CONFIG
diff --git a/Help/prop_tgt/IMPORTED_GLOBAL.rst b/Help/prop_tgt/IMPORTED_GLOBAL.rst
new file mode 100644
index 0000000..1feca04
--- /dev/null
+++ b/Help/prop_tgt/IMPORTED_GLOBAL.rst
@@ -0,0 +1,22 @@
+IMPORTED_GLOBAL
+---------------
+
+Indication of whether an :ref:`IMPORTED target <Imported Targets>` is
+globally visible.
+
+The boolean value of this property is True for targets created with the
+``IMPORTED`` ``GLOBAL`` options to :command:`add_executable()` or
+:command:`add_library()`. It is always False for targets built within the
+project.
+
+For targets created with the ``IMPORTED`` option to
+:command:`add_executable()` or :command:`add_library()` but without the
+additional option ``GLOBAL`` this is False, too. However, setting this
+property for such a locally ``IMPORTED`` target to True promotes that
+target to global scope. This promotion can only be done in the same
+directory where that ``IMPORTED`` target was created in the first place.
+
+Once an imported target has been made global, it cannot be changed back to
+non-global. Therefore, if a project sets this property, it may only
+provide a value of True. CMake will issue an error if the project tries to
+set the property to a non-True value, even if the value was already False.
diff --git a/Help/release/dev/imported-promotion.rst b/Help/release/dev/imported-promotion.rst
new file mode 100644
index 0000000..d184178
--- /dev/null
+++ b/Help/release/dev/imported-promotion.rst
@@ -0,0 +1,15 @@
+imported-promotion
+------------------
+
+* Added new target-property :prop_tgt:`IMPORTED_GLOBAL` which
+  indicates if an :ref:`IMPORTED target <Imported Targets>` is
+  globally visible.
+  It will be set automatically if such an imported target is
+  created with the ``GLOBAL`` flag.
+
+* Additionally, it is now also possible to promote a local imported
+  target to become globally visible by setting its
+  :prop_tgt:`IMPORTED_GLOBAL` property to `TRUE`. (However, this
+  promotion can only succeed if it is done from within the same
+  directory where the imported target was created in the first
+  place.) Setting it to `FALSE` is not supported!
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 58a10b3..9cf835c 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -884,6 +884,13 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
     return;
   }
+  if (prop == "IMPORTED_GLOBAL" && !this->IsImported()) {
+    std::ostringstream e;
+    e << "IMPORTED_GLOBAL property can't be set on non-imported targets (\""
+      << this->Name << "\")\n";
+    this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+    return;
+  }
 
   if (prop == "INCLUDE_DIRECTORIES") {
     this->Internal->IncludeDirectoriesEntries.clear();
@@ -933,6 +940,19 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
       this->Internal->SourceEntries.push_back(value);
       this->Internal->SourceBacktraces.push_back(lfbt);
     }
+  } else if (prop == "IMPORTED_GLOBAL") {
+    if (!cmSystemTools::IsOn(value)) {
+      std::ostringstream e;
+      e << "IMPORTED_GLOBAL property can't be set to FALSE on targets (\""
+        << this->Name << "\")\n";
+      this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+      return;
+    }
+    /* no need to change anything if value does not change */
+    if (!this->ImportedGloballyVisible) {
+      this->ImportedGloballyVisible = true;
+      this->GetGlobalGenerator()->IndexTarget(this);
+    }
   } else if (cmHasLiteralPrefix(prop, "IMPORTED_LIBNAME") &&
              !this->CheckImportedLibName(prop, value ? value : "")) {
     /* error was reported by check method */
@@ -977,6 +997,14 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
     return;
   }
+  if (prop == "IMPORTED_GLOBAL") {
+    std::ostringstream e;
+    e << "IMPORTED_GLOBAL property can't be appended, only set on imported "
+         "targets (\""
+      << this->Name << "\")\n";
+    this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+    return;
+  }
   if (prop == "INCLUDE_DIRECTORIES") {
     if (value && *value) {
       this->Internal->IncludeDirectoriesEntries.push_back(value);
@@ -1143,6 +1171,21 @@ static void cmTargetCheckINTERFACE_LINK_LIBRARIES(const char* value,
   context->IssueMessage(cmake::FATAL_ERROR, e.str());
 }
 
+static void cmTargetCheckIMPORTED_GLOBAL(const cmTarget* target,
+                                         cmMakefile* context)
+{
+  std::vector<cmTarget*> targets = context->GetOwnedImportedTargets();
+  std::vector<cmTarget*>::const_iterator it =
+    std::find(targets.begin(), targets.end(), target);
+  if (it == targets.end()) {
+    std::ostringstream e;
+    e << "Attempt to promote imported target \"" << target->GetName()
+      << "\" to global scope (by setting IMPORTED_GLOBAL) "
+         "which is not built in this directory.";
+    context->IssueMessage(cmake::FATAL_ERROR, e.str());
+  }
+}
+
 void cmTarget::CheckProperty(const std::string& prop,
                              cmMakefile* context) const
 {
@@ -1162,6 +1205,11 @@ void cmTarget::CheckProperty(const std::string& prop,
       cmTargetCheckINTERFACE_LINK_LIBRARIES(value, context);
     }
   }
+  if (prop == "IMPORTED_GLOBAL") {
+    if (this->IsImported()) {
+      cmTargetCheckIMPORTED_GLOBAL(this, context);
+    }
+  }
 }
 
 const char* cmTarget::GetComputedProperty(
@@ -1182,6 +1230,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const
   MAKE_STATIC_PROP(COMPILE_OPTIONS);
   MAKE_STATIC_PROP(COMPILE_DEFINITIONS);
   MAKE_STATIC_PROP(IMPORTED);
+  MAKE_STATIC_PROP(IMPORTED_GLOBAL);
   MAKE_STATIC_PROP(MANUALLY_ADDED_DEPENDENCIES);
   MAKE_STATIC_PROP(NAME);
   MAKE_STATIC_PROP(BINARY_DIR);
@@ -1196,6 +1245,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const
     specialProps.insert(propCOMPILE_OPTIONS);
     specialProps.insert(propCOMPILE_DEFINITIONS);
     specialProps.insert(propIMPORTED);
+    specialProps.insert(propIMPORTED_GLOBAL);
     specialProps.insert(propMANUALLY_ADDED_DEPENDENCIES);
     specialProps.insert(propNAME);
     specialProps.insert(propBINARY_DIR);
@@ -1264,6 +1314,9 @@ const char* cmTarget::GetProperty(const std::string& prop) const
     if (prop == propIMPORTED) {
       return this->IsImported() ? "TRUE" : "FALSE";
     }
+    if (prop == propIMPORTED_GLOBAL) {
+      return this->IsImportedGloballyVisible() ? "TRUE" : "FALSE";
+    }
     if (prop == propNAME) {
       return this->GetName().c_str();
     }
diff --git a/Source/cmTargetPropertyComputer.cxx b/Source/cmTargetPropertyComputer.cxx
index 1d2520d..ed9026e 100644
--- a/Source/cmTargetPropertyComputer.cxx
+++ b/Source/cmTargetPropertyComputer.cxx
@@ -57,6 +57,7 @@ bool cmTargetPropertyComputer::WhiteListedInterfaceProperty(
     builtIns.insert("COMPATIBLE_INTERFACE_STRING");
     builtIns.insert("EXPORT_NAME");
     builtIns.insert("IMPORTED");
+    builtIns.insert("IMPORTED_GLOBAL");
     builtIns.insert("NAME");
     builtIns.insert("TYPE");
   }
diff --git a/Tests/RunCMake/get_property/target_properties-stderr.txt b/Tests/RunCMake/get_property/target_properties-stderr.txt
index 6b3c6ca..df7a2f1 100644
--- a/Tests/RunCMake/get_property/target_properties-stderr.txt
+++ b/Tests/RunCMake/get_property/target_properties-stderr.txt
@@ -7,4 +7,10 @@ get_property: --><--
 get_target_property: -->(.*)/Tests/RunCMake/get_property<--
 get_property: -->(.*)/Tests/RunCMake/get_property<--
 get_target_property: -->(.*)/Tests/RunCMake/get_property/target_properties-build<--
-get_property: -->(.*)/Tests/RunCMake/get_property/target_properties-build<--$
+get_property: -->(.*)/Tests/RunCMake/get_property/target_properties-build<--
+get_target_property: -->FALSE<--
+get_property: -->FALSE<--
+get_target_property: -->FALSE<--
+get_property: -->FALSE<--
+get_target_property: -->TRUE<--
+get_property: -->TRUE<--$
diff --git a/Tests/RunCMake/get_property/target_properties.cmake b/Tests/RunCMake/get_property/target_properties.cmake
index 9ff833a..321d5b5 100644
--- a/Tests/RunCMake/get_property/target_properties.cmake
+++ b/Tests/RunCMake/get_property/target_properties.cmake
@@ -16,3 +16,10 @@ check_target_property(tgt custom)
 check_target_property(tgt noexist)
 check_target_property(tgt SOURCE_DIR)
 check_target_property(tgt BINARY_DIR)
+
+add_library(imported_local_tgt SHARED IMPORTED)
+add_library(imported_global_tgt SHARED IMPORTED GLOBAL)
+
+check_target_property(tgt IMPORTED_GLOBAL)
+check_target_property(imported_local_tgt IMPORTED_GLOBAL)
+check_target_property(imported_global_tgt IMPORTED_GLOBAL)
diff --git a/Tests/RunCMake/set_property/IMPORTED_GLOBAL-result.txt b/Tests/RunCMake/set_property/IMPORTED_GLOBAL-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/set_property/IMPORTED_GLOBAL-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt b/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt
new file mode 100644
index 0000000..f21b1de
--- /dev/null
+++ b/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt
@@ -0,0 +1,61 @@
+^CMake Error at IMPORTED_GLOBAL.cmake:9 \(set_property\):
+  IMPORTED_GLOBAL property can't be set to FALSE on targets
+  \(\"ImportedGlobalTarget\"\)
+
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
+
+
+CMake Error at IMPORTED_GLOBAL.cmake:16 \(set_property\):
+  IMPORTED_GLOBAL property can't be appended, only set on imported targets
+  \(\"ImportedGlobalTarget\"\)
+
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
+
+
+CMake Error at IMPORTED_GLOBAL.cmake:26 \(set_property\):
+  IMPORTED_GLOBAL property can't be set to FALSE on targets
+  \(\"ImportedLocalTarget\"\)
+
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
+
+
+CMake Error at IMPORTED_GLOBAL.cmake:32 \(set_property\):
+  IMPORTED_GLOBAL property can't be set on non-imported targets
+  \(\"NonImportedTarget\"\)
+
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
+
+
+CMake Error at IMPORTED_GLOBAL/CMakeLists.txt:8 \(set_property\):
+  Attempt to promote imported target \"ImportedLocalTarget2\" to global scope
+  \(by setting IMPORTED_GLOBAL\) which is not built in this directory.
+
+
+CMake Error in IMPORTED_GLOBAL/CMakeLists.txt:
+  IMPORTED_GLOBAL property can't be set to FALSE on targets
+  \(\"ImportedSubdirTarget1\"\)
+
+
+
+CMake Error at IMPORTED_GLOBAL.cmake:50 \(set_property\):
+  Attempt to promote imported target \"ImportedSubdirTarget1\" to global scope
+  \(by setting IMPORTED_GLOBAL\) which is not built in this directory.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
+
+
+CMake Error in IMPORTED_GLOBAL/CMakeLists.txt:
+  IMPORTED_GLOBAL property can't be set to FALSE on targets
+  \(\"ImportedSubdirTarget2\"\)
+
+
+
+CMake Error at IMPORTED_GLOBAL.cmake:52 \(set_property\):
+  Attempt to promote imported target \"ImportedSubdirTarget2\" to global scope
+  \(by setting IMPORTED_GLOBAL\) which is not built in this directory.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stdout.txt b/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stdout.txt
new file mode 100644
index 0000000..c5f1d11
--- /dev/null
+++ b/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stdout.txt
@@ -0,0 +1,17 @@
+-- ImportedGlobalTarget: Target IMPORTED_GLOBAL is 'TRUE'
+-- ImportedGlobalTarget: Target IMPORTED_GLOBAL is 'TRUE'
+-- ImportedGlobalTarget: Target IMPORTED_GLOBAL is 'TRUE'
+-- ImportedGlobalTarget: Target IMPORTED_GLOBAL is 'TRUE'
+-- ImportedGlobalTarget: Target IMPORTED_GLOBAL is 'TRUE'
+-- ImportedLocalTarget: Target IMPORTED_GLOBAL is 'FALSE'
+-- ImportedLocalTarget: Target IMPORTED_GLOBAL is 'TRUE'
+-- ImportedLocalTarget: Target IMPORTED_GLOBAL is 'TRUE'
+-- ImportedLocalTarget: Target IMPORTED_GLOBAL is 'TRUE'
+-- NonImportedTarget: Target IMPORTED_GLOBAL is 'FALSE'
+-- NonImportedTarget: Target IMPORTED_GLOBAL is 'FALSE'
+-- ImportedLocalTarget2: Target IMPORTED_GLOBAL is 'FALSE'
+-- ImportedLocalTarget2: Target IMPORTED_GLOBAL is 'TRUE'
+-- ImportedSubdirTarget1: Target IMPORTED_GLOBAL is 'TRUE'
+-- ImportedSubdirTarget2: Target IMPORTED_GLOBAL is 'TRUE'
+-- ImportedSubdirTarget1: Target IMPORTED_GLOBAL is 'TRUE'
+-- ImportedSubdirTarget2: Target IMPORTED_GLOBAL is 'TRUE'
diff --git a/Tests/RunCMake/set_property/IMPORTED_GLOBAL.cmake b/Tests/RunCMake/set_property/IMPORTED_GLOBAL.cmake
new file mode 100644
index 0000000..08308eb
--- /dev/null
+++ b/Tests/RunCMake/set_property/IMPORTED_GLOBAL.cmake
@@ -0,0 +1,53 @@
+macro(print_property TARGET PROP)
+  get_property(val TARGET ${TARGET} PROPERTY ${PROP})
+  message(STATUS "${TARGET}: Target ${PROP} is '${val}'")
+endmacro()
+
+# Changing property on IMPORTED target created with `GLOBAL` option.
+add_library(ImportedGlobalTarget SHARED IMPORTED GLOBAL)
+print_property(ImportedGlobalTarget IMPORTED_GLOBAL)
+set_property(TARGET ImportedGlobalTarget PROPERTY IMPORTED_GLOBAL FALSE)
+print_property(ImportedGlobalTarget IMPORTED_GLOBAL)
+set_property(TARGET ImportedGlobalTarget PROPERTY IMPORTED_GLOBAL TRUE)
+print_property(ImportedGlobalTarget IMPORTED_GLOBAL)
+set_property(TARGET ImportedGlobalTarget PROPERTY IMPORTED_GLOBAL TRUE)
+print_property(ImportedGlobalTarget IMPORTED_GLOBAL)
+# Appending property is never allowed!
+set_property(TARGET ImportedGlobalTarget APPEND PROPERTY IMPORTED_GLOBAL TRUE)
+print_property(ImportedGlobalTarget IMPORTED_GLOBAL)
+
+# Changing property on IMPORTED target created without `GLOBAL` option.
+add_library(ImportedLocalTarget SHARED IMPORTED)
+print_property(ImportedLocalTarget IMPORTED_GLOBAL)
+set_property(TARGET ImportedLocalTarget PROPERTY IMPORTED_GLOBAL TRUE)
+print_property(ImportedLocalTarget IMPORTED_GLOBAL)
+set_property(TARGET ImportedLocalTarget PROPERTY IMPORTED_GLOBAL TRUE)
+print_property(ImportedLocalTarget IMPORTED_GLOBAL)
+set_property(TARGET ImportedLocalTarget PROPERTY IMPORTED_GLOBAL FALSE)
+print_property(ImportedLocalTarget IMPORTED_GLOBAL)
+
+# Setting property on non-IMPORTED target is never allowed!
+add_library(NonImportedTarget SHARED test.cpp)
+print_property(NonImportedTarget IMPORTED_GLOBAL)
+set_property(TARGET NonImportedTarget PROPERTY IMPORTED_GLOBAL TRUE)
+print_property(NonImportedTarget IMPORTED_GLOBAL)
+
+# Local IMPORTED targets can only be promoted from same directory!
+add_library(ImportedLocalTarget2 SHARED IMPORTED)
+print_property(ImportedLocalTarget2 IMPORTED_GLOBAL)
+add_subdirectory(IMPORTED_GLOBAL)
+# Note: The value should not have changed. However, it does change because the
+# check for the same directory comes after it was changed! (At least, that is
+# not really bad because the generation will fail due to this error.)
+print_property(ImportedLocalTarget2 IMPORTED_GLOBAL)
+
+# Global IMPORTED targets from subdir are always visible
+# no matter how they became global.
+print_property(ImportedSubdirTarget1 IMPORTED_GLOBAL)
+print_property(ImportedSubdirTarget2 IMPORTED_GLOBAL)
+
+# Changing property on IMPORTED target from subdir is never possible.
+set_property(TARGET ImportedSubdirTarget1 PROPERTY IMPORTED_GLOBAL FALSE)
+print_property(ImportedSubdirTarget1 IMPORTED_GLOBAL)
+set_property(TARGET ImportedSubdirTarget2 PROPERTY IMPORTED_GLOBAL FALSE)
+print_property(ImportedSubdirTarget2 IMPORTED_GLOBAL)
diff --git a/Tests/RunCMake/set_property/IMPORTED_GLOBAL/CMakeLists.txt b/Tests/RunCMake/set_property/IMPORTED_GLOBAL/CMakeLists.txt
new file mode 100644
index 0000000..468bf78
--- /dev/null
+++ b/Tests/RunCMake/set_property/IMPORTED_GLOBAL/CMakeLists.txt
@@ -0,0 +1,8 @@
+add_library(ImportedSubdirTarget1 SHARED IMPORTED GLOBAL)
+add_library(ImportedSubdirTarget2 SHARED IMPORTED)
+
+# Extend visibility of ImportedSubdirTarget2 to global scope.
+set_property(TARGET ImportedSubdirTarget2 PROPERTY IMPORTED_GLOBAL TRUE)
+
+# Only targets from the same directory can be promoted.
+set_property(TARGET ImportedLocalTarget2 PROPERTY IMPORTED_GLOBAL TRUE)
diff --git a/Tests/RunCMake/set_property/RunCMakeTest.cmake b/Tests/RunCMake/set_property/RunCMakeTest.cmake
index 1ddacee..5b5327d 100644
--- a/Tests/RunCMake/set_property/RunCMakeTest.cmake
+++ b/Tests/RunCMake/set_property/RunCMakeTest.cmake
@@ -3,6 +3,7 @@ include(RunCMake)
 run_cmake(COMPILE_DEFINITIONS)
 run_cmake(COMPILE_FEATURES)
 run_cmake(COMPILE_OPTIONS)
+run_cmake(IMPORTED_GLOBAL)
 run_cmake(INCLUDE_DIRECTORIES)
 run_cmake(LINK_LIBRARIES)
 run_cmake(SOURCES)
diff --git a/Tests/RunCMake/set_property/test.cpp b/Tests/RunCMake/set_property/test.cpp
new file mode 100644
index 0000000..e69de29

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=517cfe0b8c327ee4d68de777b812c4854e3d46a8
commit 517cfe0b8c327ee4d68de777b812c4854e3d46a8
Merge: c37c477 dc059ae
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Nov 7 08:16:14 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 7 08:16:14 2017 -0500

    Merge branch 'upstream-KWSys' into update-kwsys
    
    * upstream-KWSys:
      KWSys 2017-11-07 (5249a82d)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc059ae70b2ec79bce2b534876a2f4006293d3b6
commit dc059ae70b2ec79bce2b534876a2f4006293d3b6
Author:     KWSys Upstream <kwrobot at kitware.com>
AuthorDate: Tue Nov 7 08:15:44 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 7 08:16:13 2017 -0500

    KWSys 2017-11-07 (5249a82d)
    
    Code extracted from:
    
        https://gitlab.kitware.com/utils/kwsys.git
    
    at commit 5249a82d5e617a29659e5881d0df65acb3220eab (master).
    
    Upstream Shortlog
    -----------------
    
    Brad King (1):
          bfdbfe9b Avoid requiring CMake 3.4 string(APPEND)
    
    luzpaz (1):
          9a1d5901 Fix trivial typos in text

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4406e7..51f4088 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1150,17 +1150,17 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
     SET(testProcess_COMPILE_FLAGS "")
     # Some Apple compilers produce bad optimizations in this source.
     IF(APPLE AND CMAKE_C_COMPILER_ID MATCHES "^(GNU|LLVM)$")
-      STRING(APPEND testProcess_COMPILE_FLAGS " -O0")
+      SET(testProcess_COMPILE_FLAGS "${testProcess_COMPILE_FLAGS} -O0")
     ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "XL" AND
            NOT (CMAKE_SYSTEM MATCHES "Linux.*ppc64le" AND
                 NOT CMAKE_C_COMPILER_VERSION VERSION_LESS "13.1.1"))
       # Tell IBM XL not to warn about our test infinite loop
       # v13.1.1 and newer on Linux ppc64le is clang based and does not accept
       # the -qsuppress option
-      STRING(APPEND testProcess_COMPILE_FLAGS " -qsuppress=1500-010")
+      SET(testProcess_COMPILE_FLAGS "${testProcess_COMPILE_FLAGS} -qsuppress=1500-010")
     ENDIF()
     IF(CMAKE_C_FLAGS MATCHES "-fsanitize=")
-      STRING(APPEND testProcess_COMPILE_FLAGS " -DCRASH_USING_ABORT")
+      SET(testProcess_COMPILE_FLAGS "${testProcess_COMPILE_FLAGS} -DCRASH_USING_ABORT")
     ENDIF()
     SET_PROPERTY(SOURCE testProcess.c PROPERTY COMPILE_FLAGS "${testProcess_COMPILE_FLAGS}")
 
diff --git a/DynamicLoader.hxx.in b/DynamicLoader.hxx.in
index 7e71a45..dc34692 100644
--- a/DynamicLoader.hxx.in
+++ b/DynamicLoader.hxx.in
@@ -35,7 +35,7 @@ namespace @KWSYS_NAMESPACE@ {
  * or absolute) pathname.  Otherwise, the dynamic linker searches for the
  * library as follows : see ld.so(8) for further details):
  * Whereas this distinction does not exist on Win32. Therefore ideally you
- * should be doing full path to garantee to have a consistent way of dealing
+ * should be doing full path to guarantee to have a consistent way of dealing
  * with dynamic loading of shared library.
  *
  * \warning the Cygwin implementation do not use the Win32 HMODULE. Put extra
@@ -72,7 +72,7 @@ public:
   static LibraryHandle OpenLibrary(const std::string&);
 
   /** Attempt to detach a dynamic library from the
-   * process.  A value of true is returned if it is sucessful. */
+   * process.  A value of true is returned if it is successful. */
   static int CloseLibrary(LibraryHandle);
 
   /** Find the address of the symbol in the given library. */
diff --git a/Process.h.in b/Process.h.in
index 6cb9443..daf334a 100644
--- a/Process.h.in
+++ b/Process.h.in
@@ -421,7 +421,7 @@ enum kwsysProcess_Pipes_e
 
 /**
  * Block until the child process terminates or the given timeout
- * expires.  If no process is running, returns immediatly.  The
+ * expires.  If no process is running, returns immediately.  The
  * argument is:
  *
  *  timeout = Specifies the maximum time this call may block.  Upon
diff --git a/RegularExpression.hxx.in b/RegularExpression.hxx.in
index 606e3da..763fdab 100644
--- a/RegularExpression.hxx.in
+++ b/RegularExpression.hxx.in
@@ -109,12 +109,12 @@ namespace @KWSYS_NAMESPACE@ {
  * object as an argument and creates an object initialized with the
  * information from the given RegularExpression object.
  *
- * The  find  member function  finds   the  first  occurence   of  the regualr
+ * The  find  member function  finds   the  first  occurrence   of  the regular
  * expression of that object in the string given to find as an argument.  Find
  * returns a boolean, and  if true,  mutates  the private  data appropriately.
  * Find sets pointers to the beginning and end of  the thing last  found, they
  * are pointers into the actual string  that was searched.   The start and end
- * member functions return indicies  into the searched string that  correspond
+ * member functions return indices  into the searched string that  correspond
  * to the beginning   and  end pointers  respectively.   The    compile member
  * function takes a char* and puts the  compiled version of the char* argument
  * into the object's private data fields.  The == and  != operators only check
diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index 366fe30..ab1f40a 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -3633,7 +3633,7 @@ SystemInformationImplementation::GetHostMemoryAvailable(
   // apply resource limits across groups of processes.
   // this is of use on certain SMP systems (eg. SGI UV)
   // where the host has a large amount of ram but a given user's
-  // access to it is severly restricted. The system will
+  // access to it is severely restricted. The system will
   // apply a limit across a set of processes. Units are in KiB.
   if (hostLimitEnvVarName) {
     const char* hostLimitEnvVarValue = getenv(hostLimitEnvVarName);
diff --git a/SystemInformation.hxx.in b/SystemInformation.hxx.in
index 516c505..5678e8a 100644
--- a/SystemInformation.hxx.in
+++ b/SystemInformation.hxx.in
@@ -124,7 +124,7 @@ public:
   // are the processes comprising an mpi program which is running in
   // parallel. The amount of memory reported may differ from the host
   // total if a host wide resource limit is applied. Such reource limits
-  // are reported to us via an applicaiton specified environment variable.
+  // are reported to us via an application specified environment variable.
   LongLong GetHostMemoryAvailable(const char* hostLimitEnvVarName = NULL);
 
   // Get total system RAM in units of KiB available to this process.
diff --git a/SystemTools.cxx b/SystemTools.cxx
index 72babc3..1f7ee10 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -1691,7 +1691,7 @@ bool SystemTools::StringEndsWith(const std::string& str1, const char* str2)
     : false;
 }
 
-// Returns a pointer to the last occurence of str2 in str1
+// Returns a pointer to the last occurrence of str2 in str1
 const char* SystemTools::FindLastString(const char* str1, const char* str2)
 {
   if (!str1 || !str2) {
diff --git a/SystemTools.hxx.in b/SystemTools.hxx.in
index 3d109a8..8a02b75 100644
--- a/SystemTools.hxx.in
+++ b/SystemTools.hxx.in
@@ -107,7 +107,7 @@ public:
   }
 
   /**
-   * Replace replace all occurences of the string in the source string.
+   * Replace replace all occurrences of the string in the source string.
    */
   static void ReplaceString(std::string& source, const char* replace,
                             const char* with);
@@ -175,7 +175,7 @@ public:
   static bool StringEndsWith(const std::string& str1, const char* str2);
 
   /**
-   * Returns a pointer to the last occurence of str2 in str1
+   * Returns a pointer to the last occurrence of str2 in str1
    */
   static const char* FindLastString(const char* str1, const char* str2);
 
@@ -905,7 +905,7 @@ public:
 
   /**
    * Delay the execution for a specified amount of time specified
-   * in miliseconds
+   * in milliseconds
    */
   static void Delay(unsigned int msec);
 
diff --git a/kwsysPlatformTestsCXX.cxx b/kwsysPlatformTestsCXX.cxx
index e67d436..f1f9ed3 100644
--- a/kwsysPlatformTestsCXX.cxx
+++ b/kwsysPlatformTestsCXX.cxx
@@ -281,7 +281,7 @@ int main()
 #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
 #if defined(__PATHSCALE__) || defined(__PATHCC__) ||                          \
   (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41))
-backtrace doesnt work with this compiler or os
+backtrace does not work with this compiler or os
 #endif
 #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
 #define _GNU_SOURCE

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=854e482a59d6696bbb6988a045ac701e26bb038a
commit 854e482a59d6696bbb6988a045ac701e26bb038a
Author:     Deniz Bahadir <dbahadir at benocs.com>
AuthorDate: Fri Nov 3 17:22:12 2017 +0100
Commit:     Deniz Bahadir <dbahadir at benocs.com>
CommitDate: Fri Nov 3 17:22:12 2017 +0100

    cmTarget: Simplified and fixed a string-comparision.
    
    Before this change, `cmTarget::CheckProperty` accepted several strings
    as valid properties, including all strings prefixed with
    "INTERFACE_LINK_LIBRARIES". Now, that particular string is still
    accepted but other strings prefixed with that string are no longer
    accepted.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c6cd502..58a10b3 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1157,7 +1157,7 @@ void cmTarget::CheckProperty(const std::string& prop,
       cmTargetCheckLINK_INTERFACE_LIBRARIES(prop, value, context, true);
     }
   }
-  if (cmHasLiteralPrefix(prop, "INTERFACE_LINK_LIBRARIES")) {
+  if (prop == "INTERFACE_LINK_LIBRARIES") {
     if (const char* value = this->GetProperty(prop)) {
       cmTargetCheckINTERFACE_LINK_LIBRARIES(value, context);
     }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c3682289dfe62fa2448e1be7ab714e674b475d8
commit 3c3682289dfe62fa2448e1be7ab714e674b475d8
Author:     Isuru Fernando <isuruf at gmail.com>
AuthorDate: Mon Oct 30 19:51:45 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Oct 31 08:48:15 2017 -0400

    Flang: Add support for compiling sources on Windows
    
    Define `CMAKE_Fortran_COMPILE_OBJECT` for Flang on Windows.

diff --git a/Modules/Platform/Windows-Flang-Fortran.cmake b/Modules/Platform/Windows-Flang-Fortran.cmake
index 9f20e73..a4b1cf1 100644
--- a/Modules/Platform/Windows-Flang-Fortran.cmake
+++ b/Modules/Platform/Windows-Flang-Fortran.cmake
@@ -1,2 +1,3 @@
 include(Platform/Windows-MSVC)
 __windows_compiler_msvc(Fortran)
+set(CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> ${_COMPILE_Fortran} <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=72d27964b92ddb4d8ee85e32a27d0e56d642ec1c
commit 72d27964b92ddb4d8ee85e32a27d0e56d642ec1c
Author:     Isuru Fernando <isuruf at gmail.com>
AuthorDate: Mon Oct 30 19:51:23 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Oct 31 08:47:06 2017 -0400

    Flang: Identify as simulating MSVC on Windows
    
    In `CMakeFortranCompilerId.F.in`, take the `_MSC_VER` out of the
    Intel-specific block so it will trigger for other compilers like Flang.
    In `Compiler/Clang.cmake`, switch off Fortran too.

diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 49789f1..da3d953 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -2,6 +2,26 @@
 #if 0
 ! Identify the compiler
 #endif
+#if defined(_MSC_VER)
+       PRINT *, 'INFO:simulate[MSVC]'
+# if _MSC_VER >= 1900
+       PRINT *, 'INFO:simulate_version[019.00]'
+# elif _MSC_VER >= 1800
+       PRINT *, 'INFO:simulate_version[018.00]'
+# elif _MSC_VER >= 1700
+       PRINT *, 'INFO:simulate_version[017.00]'
+# elif _MSC_VER >= 1600
+       PRINT *, 'INFO:simulate_version[016.00]'
+# elif _MSC_VER >= 1500
+       PRINT *, 'INFO:simulate_version[015.00]'
+# elif _MSC_VER >= 1400
+       PRINT *, 'INFO:simulate_version[014.00]'
+# elif _MSC_VER >= 1310
+       PRINT *, 'INFO:simulate_version[013.01]'
+# else
+       PRINT *, 'INFO:simulate_version[013.00]'
+# endif
+#endif
 #if defined(__INTEL_COMPILER) || defined(__ICC)
         PRINT *, 'INFO:compiler[Intel]'
 # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
@@ -14,27 +34,6 @@
 # if defined(__INTEL_COMPILER_BUILD_DATE)
 #  define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
 # endif
-
-# if defined(_MSC_VER)
-        PRINT *, 'INFO:simulate[MSVC]'
-#  if _MSC_VER >= 1900
-        PRINT *, 'INFO:simulate_version[019.00]'
-#  elif _MSC_VER >= 1800
-        PRINT *, 'INFO:simulate_version[018.00]'
-#  elif _MSC_VER >= 1700
-        PRINT *, 'INFO:simulate_version[017.00]'
-#  elif _MSC_VER >= 1600
-        PRINT *, 'INFO:simulate_version[016.00]'
-#  elif _MSC_VER >= 1500
-        PRINT *, 'INFO:simulate_version[015.00]'
-#  elif _MSC_VER >= 1400
-        PRINT *, 'INFO:simulate_version[014.00]'
-#  elif _MSC_VER >= 1310
-        PRINT *, 'INFO:simulate_version[013.01]'
-#  else
-        PRINT *, 'INFO:simulate_version[013.00]'
-#  endif
-# endif
 #elif defined(__SUNPRO_F95)
         PRINT *, 'INFO:compiler[SunPro]'
 # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_F95>>8)
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index 9f5e921..7ce1adb 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -11,7 +11,8 @@ set(__COMPILER_CLANG 1)
 include(Compiler/CMakeCommonCompilerMacros)
 
 if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
-    OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+    OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"
+    OR "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC")
   macro(__compiler_clang lang)
   endmacro()
 else()

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

Summary of changes:
 Help/manual/cmake-properties.7.rst                 |    1 +
 Help/prop_tgt/IMPORTED_GLOBAL.rst                  |   22 +++++++
 Help/release/dev/imported-promotion.rst            |   15 +++++
 Modules/CMakeFortranCompilerId.F.in                |   41 +++++++------
 Modules/Compiler/Clang.cmake                       |    3 +-
 Modules/Platform/Windows-Flang-Fortran.cmake       |    1 +
 Source/cmTarget.cxx                                |   55 +++++++++++++++++-
 Source/cmTargetPropertyComputer.cxx                |    1 +
 Source/kwsys/CMakeLists.txt                        |    6 +-
 Source/kwsys/DynamicLoader.hxx.in                  |    4 +-
 Source/kwsys/Process.h.in                          |    2 +-
 Source/kwsys/RegularExpression.hxx.in              |    4 +-
 Source/kwsys/SystemInformation.cxx                 |    2 +-
 Source/kwsys/SystemInformation.hxx.in              |    2 +-
 Source/kwsys/SystemTools.cxx                       |    2 +-
 Source/kwsys/SystemTools.hxx.in                    |    6 +-
 Source/kwsys/kwsysPlatformTestsCXX.cxx             |    2 +-
 .../get_property/target_properties-stderr.txt      |    8 ++-
 .../RunCMake/get_property/target_properties.cmake  |    7 +++
 .../IMPORTED_GLOBAL-result.txt}                    |    0
 .../set_property/IMPORTED_GLOBAL-stderr.txt        |   61 ++++++++++++++++++++
 .../set_property/IMPORTED_GLOBAL-stdout.txt        |   17 ++++++
 Tests/RunCMake/set_property/IMPORTED_GLOBAL.cmake  |   53 +++++++++++++++++
 .../set_property/IMPORTED_GLOBAL/CMakeLists.txt    |    8 +++
 Tests/RunCMake/set_property/RunCMakeTest.cmake     |    1 +
 .../RunCMake/set_property/test.cpp                 |    0
 26 files changed, 285 insertions(+), 39 deletions(-)
 create mode 100644 Help/prop_tgt/IMPORTED_GLOBAL.rst
 create mode 100644 Help/release/dev/imported-promotion.rst
 copy Tests/RunCMake/{Android/BadSYSROOT-result.txt => set_property/IMPORTED_GLOBAL-result.txt} (100%)
 create mode 100644 Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt
 create mode 100644 Tests/RunCMake/set_property/IMPORTED_GLOBAL-stdout.txt
 create mode 100644 Tests/RunCMake/set_property/IMPORTED_GLOBAL.cmake
 create mode 100644 Tests/RunCMake/set_property/IMPORTED_GLOBAL/CMakeLists.txt
 copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/set_property/test.cpp (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list