[Cmake-commits] CMake branch, master, updated. v3.15.2-939-g2e6effd
Kitware Robot
kwrobot at kitware.com
Tue Sep 3 09:32:27 EDT 2019
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 2e6effd2e0d8e60ede4aa528e771430071c546b4 (commit)
via d615ce4386f98cfac4d90e136cb272ec2d635e15 (commit)
via c1dbbef2395847d9b68e4c7871f97066bdbad3a3 (commit)
via ea63df139efbe70b58fe95c7f0f4b6b35dd04a95 (commit)
via 3b8fa496e7a9482cb4592e9f36b54f5b1bc3cdea (commit)
via 7828577065afe8cf59434166ae0a0589689caea2 (commit)
via cf29fa18c8f0e7e482a0668ac1f36d1928080214 (commit)
via d7df3cd73f00aefd1878d2842ee8b56541ae3c44 (commit)
via 8ff43de1a509b779fe6635086e16f6808a4dc765 (commit)
via da5ac4bb602bafb97b4dc0e012f1d26bbab58e3a (commit)
via 1ae24ee1087c62740a9ed357a81274a9f9e8e70d (commit)
via 5c028c27eb807e22f7d6095da4d9b694487ede05 (commit)
via d4e6b2ae25659699fccf6bc5888e87179f41b23a (commit)
from 917cfecf12b77294370cf96150becbb4c0a9db1c (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=2e6effd2e0d8e60ede4aa528e771430071c546b4
commit 2e6effd2e0d8e60ede4aa528e771430071c546b4
Merge: d615ce4 da5ac4b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 3 13:29:57 2019 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Sep 3 09:30:15 2019 -0400
Merge topic 'cpack-install-multiple-configurations'
da5ac4bb60 cpack: Add `CPACK_INSTALL_CMAKE_CONFIGURATIONS` variable
d4e6b2ae25 Refactor: Use `unique_ptr` instead of raw pointer
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !3533
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d615ce4386f98cfac4d90e136cb272ec2d635e15
commit d615ce4386f98cfac4d90e136cb272ec2d635e15
Merge: c1dbbef 5c028c2
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 3 13:26:58 2019 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Sep 3 09:27:39 2019 -0400
Merge topic 'xcode11-swift'
5c028c27eb Xcode: Relax swift compiler detection regex for Xcode 11
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !3758
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1dbbef2395847d9b68e4c7871f97066bdbad3a3
commit c1dbbef2395847d9b68e4c7871f97066bdbad3a3
Merge: ea63df1 3b8fa49
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 3 09:26:03 2019 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Sep 3 09:26:03 2019 -0400
Merge branch 'release-3.15'
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea63df139efbe70b58fe95c7f0f4b6b35dd04a95
commit ea63df139efbe70b58fe95c7f0f4b6b35dd04a95
Merge: 917cfec 7828577
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 3 13:23:22 2019 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Sep 3 09:23:48 2019 -0400
Merge topic 'FindBoost-1.71'
7828577065 FindBoost: Add support for Boost 1.71
cf29fa18c8 FindBoost: Unwrap compatibility INTERFACE targets for legacy variables
d7df3cd73f FindBoost: Remove incorrect 1.70 timer dependency
8ff43de1a5 FindBoost: Simplify conditional block for last known version
Acked-by: Kitware Robot <kwrobot at kitware.com>
Acked-by: Dennis Klein <d.klein at gsi.de>
Merge-request: !3763
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=da5ac4bb602bafb97b4dc0e012f1d26bbab58e3a
commit da5ac4bb602bafb97b4dc0e012f1d26bbab58e3a
Author: Alex Turbov <i.zaufi at gmail.com>
AuthorDate: Wed Jul 10 00:07:55 2019 +0300
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Aug 30 11:02:43 2019 -0400
cpack: Add `CPACK_INSTALL_CMAKE_CONFIGURATIONS` variable
For the multi-configuration generators one can specify the list
of configurations to include in the package.
E.g. having a project, where debug libraries have a suffix to
distinct them from the release builds, one can build the package
containing both `Debug` and `Release` binaries.
diff --git a/Help/manual/cpack.1.rst b/Help/manual/cpack.1.rst
index 10f617e..f82c466 100644
--- a/Help/manual/cpack.1.rst
+++ b/Help/manual/cpack.1.rst
@@ -48,9 +48,11 @@ Options
the :variable:`CPACK_GENERATOR` variable determines the default set of
generators that will be used.
-``-C <Configuration>``
- Specify the project configuration to be packaged (e.g. ``Debug``,
- ``Release``, etc.). When the CMake project uses a multi-configuration
+``-C <configs>``
+ Specify the project configuration(s) to be packaged (e.g. ``Debug``,
+ ``Release``, etc.), where ``<configs>`` is a
+ :ref:`semicolon-separated list <CMake Language Lists>`.
+ When the CMake project uses a multi-configuration
generator such as Xcode or Visual Studio, this option is needed to tell
``cpack`` which built executables to include in the package.
diff --git a/Help/release/dev/cpack-install-multiple-configurations.rst b/Help/release/dev/cpack-install-multiple-configurations.rst
new file mode 100644
index 0000000..d1692dc
--- /dev/null
+++ b/Help/release/dev/cpack-install-multiple-configurations.rst
@@ -0,0 +1,5 @@
+cpack-install-multiple-configurations
+-------------------------------------
+
+* CPack learned :variable:`CPACK_INSTALL_CMAKE_CONFIGURATIONS` to control
+ what configurations going to be packaged for multi-configuration generators.
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 8a6a712..1809846 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -301,6 +301,13 @@ The following variables are for advanced uses of CPack:
project. Defaults to the value of :variable:`CMAKE_GENERATOR`. Few users
will want to change this setting.
+.. variable:: CPACK_INSTALL_CMAKE_CONFIGURATIONS
+
+ Specify the project configurations to be packaged (e.g. ``Debug``, ``Release``,
+ etc.). When the CMake project uses a multi-configuration generator such as Xcode
+ or Visual Studio, this option can be used to specify what configurations
+ to include in the package.
+
.. variable:: CPACK_INSTALL_CMAKE_PROJECTS
List of four values that specify what project to install. The four values
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 46c602e..065aadf 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -598,8 +598,34 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
componentsVector.push_back(project.Component);
}
- const char* buildConfigCstr = this->GetOption("CPACK_BUILD_CONFIG");
- std::string buildConfig = buildConfigCstr ? buildConfigCstr : "";
+ std::vector<std::string> buildConfigs;
+
+ // Try get configuration names given via `-C` CLI option
+ {
+ const char* const buildConfigCstr =
+ this->GetOption("CPACK_BUILD_CONFIG");
+ auto buildConfig = buildConfigCstr ? buildConfigCstr : std::string{};
+ cmExpandList(buildConfig, buildConfigs);
+ }
+
+ // Try get configurations requested by the user explicitly
+ {
+ const char* const configsCstr =
+ this->GetOption("CPACK_INSTALL_CMAKE_CONFIGURATIONS");
+ auto configs = configsCstr ? configsCstr : std::string{};
+ cmExpandList(configs, buildConfigs);
+ }
+
+ // Remove duplicates
+ std::sort(buildConfigs.begin(), buildConfigs.end());
+ buildConfigs.erase(std::unique(buildConfigs.begin(), buildConfigs.end()),
+ buildConfigs.end());
+
+ // Ensure we have at least one configuration.
+ if (buildConfigs.empty()) {
+ buildConfigs.emplace_back();
+ }
+
std::unique_ptr<cmGlobalGenerator> globalGenerator(
this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator(
cmakeGenerator));
@@ -615,25 +641,29 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// on windows.
cmSystemTools::SetForceUnixPaths(globalGenerator->GetForceUnixPaths());
- if (!this->RunPreinstallTarget(project.ProjectName, project.Directory,
- globalGenerator.get(), buildConfig)) {
- return 0;
- }
-
- cmCPackLogger(cmCPackLog::LOG_OUTPUT,
- "- Install project: " << project.ProjectName << std::endl);
-
- // Run the installation for each component
- for (std::string const& component : componentsVector) {
- if (!this->InstallCMakeProject(
- setDestDir, project.Directory, baseTempInstallDirectory,
- default_dir_mode, component, componentInstall,
- project.SubDirectory, buildConfig, absoluteDestFiles)) {
+ // Run the installation for the selected build configurations
+ for (auto const& buildConfig : buildConfigs) {
+ if (!this->RunPreinstallTarget(project.ProjectName, project.Directory,
+ globalGenerator.get(), buildConfig)) {
return 0;
}
+
+ cmCPackLogger(cmCPackLog::LOG_OUTPUT,
+ "- Install project: " << project.ProjectName << " ["
+ << buildConfig << ']'
+ << std::endl);
+ // Run the installation for each component
+ for (std::string const& component : componentsVector) {
+ if (!this->InstallCMakeProject(
+ setDestDir, project.Directory, baseTempInstallDirectory,
+ default_dir_mode, component, componentInstall,
+ project.SubDirectory, buildConfig, absoluteDestFiles)) {
+ return 0;
+ }
+ }
}
- this->CMakeProjects.push_back(project);
+ this->CMakeProjects.emplace_back(std::move(project));
}
}
this->SetOption("CPACK_ABSOLUTE_DESTINATION_FILES",
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index d93f280..8e98961 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -36,3 +36,6 @@ run_cpack_test(MD5SUMS "DEB.MD5SUMS" false "MONOLITHIC;COMPONENT")
run_cpack_test_subtests(CPACK_INSTALL_SCRIPTS "singular;plural;both" "ZIP" false "MONOLITHIC")
run_cpack_test(DEB_PACKAGE_VERSION_BACK_COMPATIBILITY "DEB.DEB_PACKAGE_VERSION_BACK_COMPATIBILITY" false "MONOLITHIC;COMPONENT")
run_cpack_test_subtests(EXTERNAL "none;good;good_multi;bad_major;bad_minor;invalid_good;invalid_bad;stage_and_package" "External" false "MONOLITHIC;COMPONENT")
+if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode")
+ run_cpack_test(CPACK_INSTALL_CMAKE_CONFIGURATIONS "ZIP" false "MONOLITHIC")
+endif()
diff --git a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ExpectedFiles.cmake
new file mode 100644
index 0000000..34c7f8a
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ExpectedFiles.cmake
@@ -0,0 +1,3 @@
+set(EXPECTED_FILES_COUNT "1")
+
+set(EXPECTED_FILE_CONTENT_1_LIST "foo;foo/debug.txt;foo/release.txt")
diff --git a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ZIP-stdout.txt b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ZIP-stdout.txt
new file mode 100644
index 0000000..2a3aa9e
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ZIP-stdout.txt
@@ -0,0 +1,3 @@
+CPack: Install projects
+CPack: - Install project: CPACK_INSTALL_CMAKE_CONFIGURATIONS-MONOLITHIC-type \[Debug\]
+CPack: - Install project: CPACK_INSTALL_CMAKE_CONFIGURATIONS-MONOLITHIC-type \[Release\]
diff --git a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/test.cmake b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/test.cmake
new file mode 100644
index 0000000..4f562cf
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/test.cmake
@@ -0,0 +1,9 @@
+set(CMAKE_CONFIGURATION_TYPES Debug Release)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/debug.txt" "debug content")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/release.txt" "release content")
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/debug.txt" DESTINATION "foo" CONFIGURATIONS Debug)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/release.txt" DESTINATION "foo" CONFIGURATIONS Release)
+
+set(CPACK_INSTALL_CMAKE_CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES})
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c028c27eb807e22f7d6095da4d9b694487ede05
commit 5c028c27eb807e22f7d6095da4d9b694487ede05
Author: Gregor Jasny <gjasny at googlemail.com>
AuthorDate: Fri Aug 30 09:33:37 2019 +0200
Commit: Gregor Jasny <gjasny at googlemail.com>
CommitDate: Fri Aug 30 10:53:58 2019 +0200
Xcode: Relax swift compiler detection regex for Xcode 11
The Xcode 11 output:
```
CompileSwift normal x86_64
/Users/gregorj/Git/cmake/_build_xcode/Tests/SwiftOnly/CMakeFiles/3.15.20190826-g89479bd/CompilerIdSwift/CompilerId/main.swift
(in target 'CompilerIdSwift' from project 'CompilerIdSwift')
cd /Users/gregorj/Git/cmake/_build_xcode/Tests/SwiftOnly/CMakeFiles/3.15.20190826-g89479bd/CompilerIdSwift
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/gregorj/Git/cmake/_build_xcode/Tests/SwiftOnly/CMakeFiles/3.15.20190826-g89479bd/CompilerIdSwift/CompilerId/main.swift ...
```
The Xcode 10 output:
```
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
cd /Users/gjasny/src/cmake/Tests/SwiftOnly
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name SwiftOnly -O -enable-batch-mode -enforce-exclusivity=checked -swift-version 5.0 -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -target x86_64-apple-macosx10.14 -g -Xfrontend -serialize-debugging-options -swift-version 5 -Xlinker -rpath -Xlinker /usr/lib/swift -I /Users/gjasny/src/cmake/_build_xcode/Tests/SwiftOnly/Debug -F /Users/gjasny/src/cmake/_build_xcode/Tests/SwiftOnly/Debug -c -j24 /Users/gjasny/src/cmake/Tests/SwiftOnly/main.swift ...
CompileSwift normal x86_64 /Users/gjasny/src/cmake/Tests/SwiftOnly/main.swift
cd /Users/gjasny/src/cmake/Tests/SwiftOnly
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/gjasny/src/cmake/Tests/SwiftOnly/main.swift ...
```
The Xcode 11 output lacks the CompileSwiftSources action but the
CompileSwift action is present for both and also look suitable.
diff --git a/Modules/CMakeDetermineSwiftCompiler.cmake b/Modules/CMakeDetermineSwiftCompiler.cmake
index 2fcf7b0..9aafe48 100644
--- a/Modules/CMakeDetermineSwiftCompiler.cmake
+++ b/Modules/CMakeDetermineSwiftCompiler.cmake
@@ -53,7 +53,7 @@ if(NOT CMAKE_Swift_COMPILER_ID_RUN)
list(APPEND CMAKE_Swift_COMPILER_ID_MATCH_VENDORS Apple)
set(CMAKE_Swift_COMPILER_ID_MATCH_VENDOR_REGEX_Apple "com.apple.xcode.tools.swift.compiler")
- set(CMAKE_Swift_COMPILER_ID_TOOL_MATCH_REGEX "\nCompileSwiftSources[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]* -c[^\r\n]*CompilerIdSwift/CompilerId/main.swift")
+ set(CMAKE_Swift_COMPILER_ID_TOOL_MATCH_REGEX "\nCompileSwift[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]* -c[^\r\n]*CompilerIdSwift/CompilerId/main.swift")
set(CMAKE_Swift_COMPILER_ID_TOOL_MATCH_INDEX 2)
endif()
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d4e6b2ae25659699fccf6bc5888e87179f41b23a
commit d4e6b2ae25659699fccf6bc5888e87179f41b23a
Author: Alex Turbov <i.zaufi at gmail.com>
AuthorDate: Tue Jul 9 17:56:47 2019 +0300
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Aug 19 15:25:06 2019 -0400
Refactor: Use `unique_ptr` instead of raw pointer
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index f3de53c..46c602e 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -600,9 +600,9 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
const char* buildConfigCstr = this->GetOption("CPACK_BUILD_CONFIG");
std::string buildConfig = buildConfigCstr ? buildConfigCstr : "";
- cmGlobalGenerator* globalGenerator =
+ std::unique_ptr<cmGlobalGenerator> globalGenerator(
this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator(
- cmakeGenerator);
+ cmakeGenerator));
if (!globalGenerator) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Specified package generator not found. "
@@ -616,12 +616,10 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cmSystemTools::SetForceUnixPaths(globalGenerator->GetForceUnixPaths());
if (!this->RunPreinstallTarget(project.ProjectName, project.Directory,
- globalGenerator, buildConfig)) {
+ globalGenerator.get(), buildConfig)) {
return 0;
}
- delete globalGenerator;
-
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Install project: " << project.ProjectName << std::endl);
-----------------------------------------------------------------------
Summary of changes:
Help/manual/cpack.1.rst | 8 ++-
.../dev/cpack-install-multiple-configurations.rst | 5 ++
Modules/CMakeDetermineSwiftCompiler.cmake | 2 +-
Modules/CPack.cmake | 7 +++
Modules/FindBoost.cmake | 49 +++++++++------
Source/CPack/cmCPackGenerator.cxx | 70 +++++++++++++++-------
Tests/RunCMake/CPack/RunCMakeTest.cmake | 3 +
.../ExpectedFiles.cmake | 3 +
.../ZIP-stdout.txt | 3 +
.../CPACK_INSTALL_CMAKE_CONFIGURATIONS/test.cmake | 9 +++
.../FindBoost/CMakePackage_New/BoostConfig.cmake | 5 ++
11 files changed, 121 insertions(+), 43 deletions(-)
create mode 100644 Help/release/dev/cpack-install-multiple-configurations.rst
create mode 100644 Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ExpectedFiles.cmake
create mode 100644 Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ZIP-stdout.txt
create mode 100644 Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/test.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list