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  8fd481a899b651150d317cdfe448cbf628933e4d (commit)
       via  618bd463ad853da9cd4594bc1ff08fb272a7450d (commit)
       via  bd2793b6e90c9c990a3cd4db260503e19e9a8ae0 (commit)
       via  f08dcbffecd45889d8aeabdfa504ee76ef54e351 (commit)
       via  d6be117ca06154bdf9f0b72c6159a496da1646f7 (commit)
      from  af3278af3612e9bc0599617767047eaeb186c998 (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=8fd481a899b651150d317cdfe448cbf628933e4d
commit 8fd481a899b651150d317cdfe448cbf628933e4d
Merge: 618bd46 d6be117
Author:     Kyle Edwards <kyle.edwa...@kitware.com>
AuthorDate: Fri Jul 26 16:02:15 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Jul 26 12:02:34 2019 -0400

    Merge topic 'ep_support_no_submodule_init'
    
    d6be117ca0 ExternalProject: Support not initializing any submodules
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !3579


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=618bd463ad853da9cd4594bc1ff08fb272a7450d
commit 618bd463ad853da9cd4594bc1ff08fb272a7450d
Merge: af3278a bd2793b
Author:     Kyle Edwards <kyle.edwa...@kitware.com>
AuthorDate: Fri Jul 26 16:01:15 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Jul 26 12:01:27 2019 -0400

    Merge topic 'remove_compiler_rpath'
    
    bd2793b6e9 Help: Add documentation for INSTALL_REMOVE_ENVIROMENT_RPATH
    f08dcbffec Property: Add INSTALL_REMOVE_ENVIROMENT_RPATH property
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !3544


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bd2793b6e90c9c990a3cd4db260503e19e9a8ae0
commit bd2793b6e90c9c990a3cd4db260503e19e9a8ae0
Author:     Jiang Yue <jiangyue12...@gmail.com>
AuthorDate: Wed Jul 24 10:38:07 2019 +0800
Commit:     Kyle Edwards <kyle.edwa...@kitware.com>
CommitDate: Thu Jul 25 12:30:24 2019 -0400

    Help: Add documentation for INSTALL_REMOVE_ENVIROMENT_RPATH

diff --git a/Help/manual/cmake-properties.7.rst 
b/Help/manual/cmake-properties.7.rst
index ae4be3e..62d23c7 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -228,6 +228,7 @@ Properties on Targets
    /prop_tgt/IMPORT_SUFFIX
    /prop_tgt/INCLUDE_DIRECTORIES
    /prop_tgt/INSTALL_NAME_DIR
+   /prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH
    /prop_tgt/INSTALL_RPATH
    /prop_tgt/INSTALL_RPATH_USE_LINK_PATH
    /prop_tgt/INTERFACE_AUTOUIC_OPTIONS
diff --git a/Help/manual/cmake-variables.7.rst 
b/Help/manual/cmake-variables.7.rst
index c3f6f8a..432d7fc 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -372,6 +372,7 @@ Variables that Control the Build
    /variable/CMAKE_INCLUDE_CURRENT_DIR
    /variable/CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE
    /variable/CMAKE_INSTALL_NAME_DIR
+   /variable/CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH
    /variable/CMAKE_INSTALL_RPATH
    /variable/CMAKE_INSTALL_RPATH_USE_LINK_PATH
    /variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION
diff --git a/Help/prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH.rst 
b/Help/prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH.rst
new file mode 100644
index 0000000..a474fc6
--- /dev/null
+++ b/Help/prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH.rst
@@ -0,0 +1,10 @@
+INSTALL_REMOVE_ENVIRONMENT_RPATH
+--------------------------------
+
+Removes compiler defined rpaths durimg installation.
+
+``INSTALL_REMOVE_ENVIRONMENT_RPATH`` is a boolean that if set to ``True`` will
+remove compiler defined rpaths from the project if the user also defines rpath
+with :prop_tgt:`INSTALL_RPATH`.  This property is initialized by whether the
+value of :variable:`CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH` is set when a
+target is created.
diff --git a/Help/release/dev/add-install-remove-environment-rpath.rst 
b/Help/release/dev/add-install-remove-environment-rpath.rst
new file mode 100644
index 0000000..156106c
--- /dev/null
+++ b/Help/release/dev/add-install-remove-environment-rpath.rst
@@ -0,0 +1,6 @@
+add-install-remove-environment-rpath
+------------------------------------
+
+* A new target property, :prop_tgt:`INSTALL_REMOVE_ENVIRONMENT_RPATH`, was
+  added which removes compiler-defined rpaths from a target. This property is
+  initialized by :variable:`CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH`.
diff --git a/Help/variable/CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH.rst 
b/Help/variable/CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH.rst
new file mode 100644
index 0000000..19ae5f3
--- /dev/null
+++ b/Help/variable/CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH.rst
@@ -0,0 +1,9 @@
+CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH
+--------------------------------------
+
+Removes compiler defined rpaths durimg installation.
+
+``CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH`` is a boolean that if set to ``true``
+removes compiler defined rpaths from the project if the user also defines rpath
+with :prop_tgt:`INSTALL_RPATH`. This is used to initialize the target property
+:prop_tgt:`INSTALL_REMOVE_ENVIRONMENT_RPATH` for all targets.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f08dcbffecd45889d8aeabdfa504ee76ef54e351
commit f08dcbffecd45889d8aeabdfa504ee76ef54e351
Author:     Jiang Yue <jiangyue12...@gmail.com>
AuthorDate: Fri Jul 12 11:33:36 2019 +0800
Commit:     Kyle Edwards <kyle.edwa...@kitware.com>
CommitDate: Thu Jul 25 12:30:23 2019 -0400

    Property: Add INSTALL_REMOVE_ENVIROMENT_RPATH property

diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 9871f49..807b5b3 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -1071,6 +1071,7 @@ bool cmFileCommand::HandleRPathChangeCommand(
   std::string file;
   const char* oldRPath = nullptr;
   const char* newRPath = nullptr;
+  bool removeEnvironmentRPath = false;
   enum Doing
   {
     DoingNone,
@@ -1086,6 +1087,8 @@ bool cmFileCommand::HandleRPathChangeCommand(
       doing = DoingNew;
     } else if (args[i] == "FILE") {
       doing = DoingFile;
+    } else if (args[i] == "INSTALL_REMOVE_ENVIRONMENT_RPATH") {
+      removeEnvironmentRPath = true;
     } else if (doing == DoingFile) {
       file = args[i];
       doing = DoingNone;
@@ -1124,7 +1127,9 @@ bool cmFileCommand::HandleRPathChangeCommand(
   cmFileTimes const ft(file);
   std::string emsg;
   bool changed;
-  if (!cmSystemTools::ChangeRPath(file, oldRPath, newRPath, &emsg, &changed)) {
+
+  if (!cmSystemTools::ChangeRPath(file, oldRPath, newRPath,
+                                  removeEnvironmentRPath, &emsg, &changed)) {
     std::ostringstream e;
     /* clang-format off */
     e << "RPATH_CHANGE could not write new RPATH:\n"
diff --git a/Source/cmInstallTargetGenerator.cxx 
b/Source/cmInstallTargetGenerator.cxx
index d891ad8..a61239e 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -767,12 +767,18 @@ void cmInstallTargetGenerator::AddChrpathPatchRule(
         this->IssueCMP0095Warning(newRpath);
         CM_FALLTHROUGH;
       case cmPolicies::OLD:
-        os << indent << "     NEW_RPATH \"" << newRpath << "\")\n";
+        os << indent << "     NEW_RPATH \"" << newRpath << "\"";
         break;
       default:
-        os << indent << "     NEW_RPATH " << escapedNewRpath << ")\n";
+        os << indent << "     NEW_RPATH " << escapedNewRpath;
         break;
     }
+
+    if (this->Target->GetPropertyAsBool("INSTALL_REMOVE_ENVIRONMENT_RPATH")) {
+      os << "\n" << indent << "     INSTALL_REMOVE_ENVIRONMENT_RPATH)\n";
+    } else {
+      os << indent << ")\n";
+    }
   }
 }
 
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 723f280..a7e0398 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2397,7 +2397,8 @@ struct cmSystemToolsRPathInfo
 #if defined(CMAKE_USE_ELF_PARSER)
 bool cmSystemTools::ChangeRPath(std::string const& file,
                                 std::string const& oldRPath,
-                                std::string const& newRPath, std::string* emsg,
+                                std::string const& newRPath,
+                                bool removeEnvironmentRPath, std::string* emsg,
                                 bool* changed)
 {
   if (changed) {
@@ -2484,7 +2485,9 @@ bool cmSystemTools::ChangeRPath(std::string const& file,
 
       // Construct the new value which preserves the part of the path
       // not being changed.
-      rp[rp_count].Value = se[i]->Value.substr(0, prefix_len);
+      if (!removeEnvironmentRPath) {
+        rp[rp_count].Value = se[i]->Value.substr(0, prefix_len);
+      }
       rp[rp_count].Value += newRPath;
       rp[rp_count].Value += se[i]->Value.substr(pos + oldRPath.length());
 
@@ -2570,6 +2573,7 @@ bool cmSystemTools::ChangeRPath(std::string const& file,
 bool cmSystemTools::ChangeRPath(std::string const& /*file*/,
                                 std::string const& /*oldRPath*/,
                                 std::string const& /*newRPath*/,
+                                bool /*removeEnvironmentRPath*/,
                                 std::string* /*emsg*/, bool* /*changed*/)
 {
   return false;
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index a9c03bd..087eca7 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -473,6 +473,7 @@ public:
   /** Try to set the RPATH in an ELF binary.  */
   static bool ChangeRPath(std::string const& file, std::string const& oldRPath,
                           std::string const& newRPath,
+                          bool removeEnvironmentRPath,
                           std::string* emsg = nullptr,
                           bool* changed = nullptr);
 
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b1a0127..beccfce 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -282,6 +282,7 @@ cmTarget::cmTarget(std::string const& name, 
cmStateEnums::TargetType type,
     initProp("BUILD_RPATH");
     initProp("BUILD_RPATH_USE_ORIGIN");
     initProp("INSTALL_NAME_DIR");
+    initProp("INSTALL_REMOVE_ENVIRONMENT_RPATH");
     initPropValue("INSTALL_RPATH", "");
     initPropValue("INSTALL_RPATH_USE_LINK_PATH", "OFF");
     initProp("INTERPROCEDURAL_OPTIMIZATION");
diff --git a/Tests/CMakeTests/ELFTest.cmake.in 
b/Tests/CMakeTests/ELFTest.cmake.in
index 4635778..85c2360 100644
--- a/Tests/CMakeTests/ELFTest.cmake.in
+++ b/Tests/CMakeTests/ELFTest.cmake.in
@@ -25,13 +25,38 @@ foreach(f ${files})
   # Change the RPATH.
   file(RPATH_CHANGE FILE "${f}"
     OLD_RPATH "/sample/rpath"
-    NEW_RPATH "/rpath/sample")
+    NEW_RPATH "/path1:/path2")
   set(rpath)
-  file(STRINGS "${f}" rpath REGEX "/rpath/sample" LIMIT_COUNT 1)
+  file(STRINGS "${f}" rpath REGEX "/path1:/path2" LIMIT_COUNT 1)
   if(NOT rpath)
     message(FATAL_ERROR "RPATH not changed in ${f}")
   endif()
 
+  # Change the RPATH without compiler defined rpath removed
+  file(RPATH_CHANGE FILE "${f}"
+    OLD_RPATH "/path2"
+    NEW_RPATH "/path3")
+  set(rpath)
+  file(STRINGS "${f}" rpath REGEX "/path1:/path3" LIMIT_COUNT 1)
+  if(NOT rpath)
+    message(FATAL_ERROR "RPATH not updated in ${f}")
+  endif()
+
+  # Change the RPATH with compiler defined rpath removed
+  file(RPATH_CHANGE FILE "${f}"
+    OLD_RPATH "/path3"
+    NEW_RPATH "/rpath/sample"
+    INSTALL_REMOVE_ENVIRONMENT_RPATH)
+  set(rpath)
+  file(STRINGS "${f}" rpath REGEX "/rpath/sample" LIMIT_COUNT 1)
+  if(NOT rpath)
+    message(FATAL_ERROR "RPATH not updated in ${f}")
+  endif()
+  file(STRINGS "${f}" rpath REGEX "/path1" LIMIT_COUNT 1)
+  if(rpath)
+    message(FATAL_ERROR "RPATH not removed in ${f}")
+  endif()
+
   # Remove the RPATH.
   file(RPATH_REMOVE FILE "${f}")
   set(rpath)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d6be117ca06154bdf9f0b72c6159a496da1646f7
commit d6be117ca06154bdf9f0b72c6159a496da1646f7
Author:     Robert Maynard <robert.mayn...@kitware.com>
AuthorDate: Tue Jul 16 14:13:43 2019 -0400
Commit:     Robert Maynard <robert.mayn...@kitware.com>
CommitDate: Wed Jul 24 09:36:30 2019 -0400

    ExternalProject: Support not initializing any submodules
    
    Fixes #15592

diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 6bdabaf..44ea1a8 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -57,6 +57,7 @@ Policies Introduced by CMake 3.16
 .. toctree::
    :maxdepth: 1
 
+   CMP0097: ExternalProject_Add with GIT_SUBMODULES "" initializes no 
submodules. </policy/CMP0097>
    CMP0096: project() preserves leading zeros in version components. 
</policy/CMP0096>
    CMP0095: RPATH entries are properly escaped in the intermediary CMake 
install script. </policy/CMP0095>
 
diff --git a/Help/policy/CMP0097.rst b/Help/policy/CMP0097.rst
new file mode 100644
index 0000000..8a5ff88
--- /dev/null
+++ b/Help/policy/CMP0097.rst
@@ -0,0 +1,23 @@
+CMP0097
+-------
+
+:command:`ExternalProject_Add` with ``GIT_SUBMODULES ""`` initializes no
+submodules.
+
+The module provides a ``GIT_SUBMODULES`` option which controls what submodules
+to initialize and update. Starting with CMake 3.16, explicitly setting
+``GIT_SUBMODULES`` to an empty string means no submodules will be initialized
+or updated.
+
+This policy provides compatibility for projects that have not been updated
+to expect the new behavior.
+
+The ``OLD`` behavior for this policy is for ``GIT_SUBMODULES`` when set to
+an empty string to initialize and update all git submodules.
+The ``New`` behavior for this policy is for ``GIT_SUBMODULES`` when set to
+an empty string to initialize and update no git submodules.
+
+This policy was introduced in CMake version 3.16.  Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+Unlike most policies, CMake version |release| does *not* warn
+when this policy is not set and simply uses ``OLD`` behavior.
diff --git a/Help/release/dev/external-project-support-no-git-submodules.rst 
b/Help/release/dev/external-project-support-no-git-submodules.rst
new file mode 100644
index 0000000..1d4be66
--- /dev/null
+++ b/Help/release/dev/external-project-support-no-git-submodules.rst
@@ -0,0 +1,6 @@
+external-project-support-no-git-submodules
+------------------------------------------
+
+* The :module:`ExternalProject` module's ``ExternalProject_Add`` command
+  has been updated so that ``GIT_SUBMODULES ""`` initializes no submodules. See
+  policy :policy:`CMP0097`.
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 20b37d2..14fc231 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -261,7 +261,9 @@ External Project Definition
 
       ``GIT_SUBMODULES <module>...``
         Specific git submodules that should also be updated. If this option is
-        not provided, all git submodules will be updated.
+        not provided, all git submodules will be updated. When 
:policy:`CMP0097`
+        is set to ``NEW`` if this value is set to an empty string then no 
submodules
+        are initialized or updated.
 
       ``GIT_SHALLOW <bool>``
         When this option is enabled, the ``git clone`` operation will be given
@@ -1016,6 +1018,9 @@ function(_ep_parse_arguments f name ns args)
       endif()
     else()
       set(key "${arg}")
+      if(key MATCHES GIT)
+       get_property(have_key TARGET ${name} PROPERTY ${ns}${key} SET)
+      endif()
     endif()
   endforeach()
 endfunction()
@@ -1060,7 +1065,7 @@ define_property(DIRECTORY PROPERTY 
"EP_UPDATE_DISCONNECTED" INHERITED
   "ExternalProject module."
   )
 
-function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE 
git_repository git_tag git_remote_name git_submodules git_shallow git_progress 
git_config src_name work_dir gitclone_infofile gitclone_stampfile tls_verify)
+function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE 
git_repository git_tag git_remote_name init_submodules git_submodules 
git_shallow git_progress git_config src_name work_dir gitclone_infofile 
gitclone_stampfile tls_verify)
   if(NOT GIT_VERSION_STRING VERSION_LESS 1.8.5)
     # Use `git checkout <tree-ish> --` to avoid ambiguity with a local path.
     set(git_checkout_explicit-- "--")
@@ -1145,11 +1150,14 @@ if(error_code)
   message(FATAL_ERROR \"Failed to checkout tag: '${git_tag}'\")
 endif()
 
-execute_process(
-  COMMAND \"${git_EXECUTABLE}\" ${git_options} submodule update --recursive 
--init ${git_submodules}
-  WORKING_DIRECTORY \"${work_dir}/${src_name}\"
-  RESULT_VARIABLE error_code
-  )
+set(init_submodules ${init_submodules})
+if(init_submodules)
+  execute_process(
+    COMMAND \"${git_EXECUTABLE}\" ${git_options} submodule update --recursive 
--init ${git_submodules}
+    WORKING_DIRECTORY \"${work_dir}/${src_name}\"
+    RESULT_VARIABLE error_code
+    )
+endif()
 if(error_code)
   message(FATAL_ERROR \"Failed to update submodules in: 
'${work_dir}/${src_name}'\")
 endif()
@@ -1226,7 +1234,7 @@ endif()
 endfunction()
 
 
-function(_ep_write_gitupdate_script script_filename git_EXECUTABLE git_tag 
git_remote_name git_submodules git_repository work_dir)
+function(_ep_write_gitupdate_script script_filename git_EXECUTABLE git_tag 
git_remote_name init_submodules git_submodules git_repository work_dir)
   if("${git_tag}" STREQUAL "")
     message(FATAL_ERROR "Tag for git checkout should not be empty.")
   endif()
@@ -1383,11 +1391,14 @@ if(error_code OR is_remote_ref OR NOT (\"\${tag_sha}\" 
STREQUAL \"\${head_sha}\"
     endif()
   endif()
 
-  execute_process(
-    COMMAND \"${git_EXECUTABLE}\" submodule update --recursive --init 
${git_submodules}
-    WORKING_DIRECTORY \"${work_dir}/${src_name}\"
-    RESULT_VARIABLE error_code
-    )
+  set(init_submodules ${init_submodules})
+  if(init_submodules)
+    execute_process(
+      COMMAND \"${git_EXECUTABLE}\" submodule update --recursive --init 
${git_submodules}
+      WORKING_DIRECTORY \"${work_dir}/${src_name}\"
+      RESULT_VARIABLE error_code
+      )
+  endif()
   if(error_code)
     message(FATAL_ERROR \"Failed to update submodules in: 
'${work_dir}/${src_name}'\")
   endif()
@@ -1972,7 +1983,7 @@ endif()
     set(stderr_log "${logbase}-err.log")
   endif()
   set(code "
-cmake_minimum_required(VERSION 3.13)
+cmake_minimum_required(VERSION 3.15)
 ${code_cygpath_make}
 set(command \"${command}\")
 set(log_merged \"${log_merged}\")
@@ -2420,7 +2431,15 @@ function(_ep_add_download_command name)
     if(NOT git_tag)
       set(git_tag "master")
     endif()
-    get_property(git_submodules TARGET ${name} PROPERTY _EP_GIT_SUBMODULES)
+
+    set(git_init_submodules TRUE)
+    get_property(git_submodules_set TARGET ${name} PROPERTY _EP_GIT_SUBMODULES 
SET)
+    if(git_submodules_set)
+      get_property(git_submodules TARGET ${name} PROPERTY _EP_GIT_SUBMODULES)
+      if(git_submodules  STREQUAL "" AND _EP_CMP0097 STREQUAL "NEW")
+        set(git_init_submodules FALSE)
+      endif()
+    endif()
 
     get_property(git_remote_name TARGET ${name} PROPERTY _EP_GIT_REMOTE_NAME)
     if(NOT git_remote_name)
@@ -2458,7 +2477,7 @@ function(_ep_add_download_command name)
     # The script will delete the source directory and then call git clone.
     #
     _ep_write_gitclone_script(${tmp_dir}/${name}-gitclone.cmake ${source_dir}
-      ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${git_remote_name} 
"${git_submodules}" "${git_shallow}" "${git_progress}" "${git_config}" 
${src_name} ${work_dir}
+      ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${git_remote_name} 
${git_init_submodules} "${git_submodules}" "${git_shallow}" "${git_progress}" 
"${git_config}" ${src_name} ${work_dir}
       ${stamp_dir}/${name}-gitinfo.txt 
${stamp_dir}/${name}-gitclone-lastrun.txt "${tls_verify}"
       )
     set(comment "Performing download step (git clone) for '${name}'")
@@ -2723,9 +2742,18 @@ function(_ep_add_update_command name)
     if(NOT git_remote_name)
       set(git_remote_name "origin")
     endif()
-    get_property(git_submodules TARGET ${name} PROPERTY _EP_GIT_SUBMODULES)
+
+    set(git_init_submodules TRUE)
+    get_property(git_submodules_set TARGET ${name} PROPERTY _EP_GIT_SUBMODULES 
SET)
+    if(git_submodules_set)
+      get_property(git_submodules TARGET ${name} PROPERTY _EP_GIT_SUBMODULES)
+      if(git_submodules  STREQUAL "" AND _EP_CMP0097 STREQUAL "NEW")
+        set(git_init_submodules FALSE)
+      endif()
+    endif()
+
     _ep_write_gitupdate_script(${tmp_dir}/${name}-gitupdate.cmake
-      ${GIT_EXECUTABLE} ${git_tag} ${git_remote_name} "${git_submodules}" 
${git_repository} ${work_dir}
+      ${GIT_EXECUTABLE} ${git_tag} ${git_remote_name} ${git_init_submodules} 
"${git_submodules}" ${git_repository} ${work_dir}
       )
     set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitupdate.cmake)
     set(always 1)
@@ -3138,6 +3166,10 @@ endfunction()
 
 
 function(ExternalProject_Add name)
+  cmake_policy(GET CMP0097 _EP_CMP0097
+    PARENT_SCOPE # undocumented, do not use outside of CMake
+    )
+
   _ep_get_configuration_subdir_suffix(cfgdir)
 
   # Add a custom target for the external project.
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index e0f48de..92c80bb 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -286,7 +286,11 @@ class cmMakefile;
          3, 16, 0, cmPolicies::WARN)                                          \
   SELECT(POLICY, CMP0096,                                                     \
          "project() preserves leading zeros in version components.", 3, 16,   \
-         0, cmPolicies::WARN)
+         0, cmPolicies::WARN)                                                 \
+  SELECT(POLICY, CMP0097,                                                     \
+         "ExternalProject_Add with GIT_SUBMODULES \"\" initializes no "       \
+         "submodules.",                                                       \
+         3, 16, 0, cmPolicies::WARN)
 
 #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
 #define CM_FOR_EACH_POLICY_ID(POLICY)                                         \
diff --git a/Tests/ExternalProject/CMakeLists.txt 
b/Tests/ExternalProject/CMakeLists.txt
index 5adcbd9..093391e 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -421,7 +421,7 @@ if(do_git_tests)
 
   set(local_git_repo "../../LocalRepositories/GIT-with-submodules")
 
-  set(proj TS1-GIT-no-GIT_SUBMODULES)
+  set(proj TS1-GIT-all-GIT_SUBMODULES)
   ExternalProject_Add(${proj}
     GIT_REPOSITORY "${local_git_repo}"
     CMAKE_GENERATOR "${CMAKE_GENERATOR}"
@@ -435,7 +435,8 @@ if(do_git_tests)
   )
   set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
 
-  set(proj TS1-GIT-empty-GIT_SUBMODULES)
+  set(proj TS1-GIT-all-GIT_SUBMODULES-via-CMP0097-OLD)
+  cmake_policy(SET CMP0097 OLD)
   ExternalProject_Add(${proj}
     GIT_REPOSITORY "${local_git_repo}"
     GIT_SUBMODULES ""
@@ -450,6 +451,22 @@ if(do_git_tests)
   )
   set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
 
+  set(proj TS1-GIT-no-GIT_SUBMODULES)
+  cmake_policy(SET CMP0097 NEW)
+  ExternalProject_Add(${proj}
+    GIT_REPOSITORY "${local_git_repo}"
+    GIT_SUBMODULES ""
+    CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+               -DWITH_m1:BOOL=OFF
+               -DWITH_m2:BOOL=OFF
+    BUILD_COMMAND ""
+    INSTALL_COMMAND ""
+    DEPENDS "SetupLocalGITRepository"
+            "SetupLocalGITRepositoryWithSubmodules"
+  )
+  set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+
   set(proj TS1-GIT-some-GIT_SUBMODULES)
   ExternalProject_Add(${proj}
     GIT_REPOSITORY "${local_git_repo}"

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

Summary of changes:
 Help/manual/cmake-policies.7.rst                   |  1 +
 Help/manual/cmake-properties.7.rst                 |  1 +
 Help/manual/cmake-variables.7.rst                  |  1 +
 Help/policy/CMP0097.rst                            | 23 ++++++++
 Help/prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH.rst | 10 ++++
 .../dev/add-install-remove-environment-rpath.rst   |  6 ++
 .../external-project-support-no-git-submodules.rst |  6 ++
 .../CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH.rst     |  9 +++
 Modules/ExternalProject.cmake                      | 68 ++++++++++++++++------
 Source/cmFileCommand.cxx                           |  7 ++-
 Source/cmInstallTargetGenerator.cxx                | 10 +++-
 Source/cmPolicies.h                                |  6 +-
 Source/cmSystemTools.cxx                           |  8 ++-
 Source/cmSystemTools.h                             |  1 +
 Source/cmTarget.cxx                                |  1 +
 Tests/CMakeTests/ELFTest.cmake.in                  | 29 ++++++++-
 Tests/ExternalProject/CMakeLists.txt               | 21 ++++++-
 17 files changed, 180 insertions(+), 28 deletions(-)
 create mode 100644 Help/policy/CMP0097.rst
 create mode 100644 Help/prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH.rst
 create mode 100644 Help/release/dev/add-install-remove-environment-rpath.rst
 create mode 100644 
Help/release/dev/external-project-support-no-git-submodules.rst
 create mode 100644 Help/variable/CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH.rst


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to