summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2019-07-09 21:07:55 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-30 15:02:43 (GMT)
commitda5ac4bb602bafb97b4dc0e012f1d26bbab58e3a (patch)
tree52a7e3d270e57688a5aa089986b09d857f8d268c /Tests
parentd4e6b2ae25659699fccf6bc5888e87179f41b23a (diff)
downloadCMake-da5ac4bb602bafb97b4dc0e012f1d26bbab58e3a.zip
CMake-da5ac4bb602bafb97b4dc0e012f1d26bbab58e3a.tar.gz
CMake-da5ac4bb602bafb97b4dc0e012f1d26bbab58e3a.tar.bz2
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.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ExpectedFiles.cmake3
-rw-r--r--Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ZIP-stdout.txt3
-rw-r--r--Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/test.cmake9
4 files changed, 18 insertions, 0 deletions
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})