diff options
author | Nils Gladitz <n.gladitz@abberior-instruments.com> | 2021-05-19 10:10:58 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2021-05-23 22:21:49 (GMT) |
commit | 26e36111d326bbf69f437ef1335423ea3b2835e2 (patch) | |
tree | badbd556c99870e9729e9fdc84eb304d70d34876 /Tests | |
parent | d98a7cdb25611ed6f1e856fd4c4ff980225b89cd (diff) | |
download | CMake-26e36111d326bbf69f437ef1335423ea3b2835e2.zip CMake-26e36111d326bbf69f437ef1335423ea3b2835e2.tar.gz CMake-26e36111d326bbf69f437ef1335423ea3b2835e2.tar.bz2 |
CPack: Implement new variable CPACK_CUSTOM_INSTALL_VARIABLES
The new variable allows projects to define custom key=value pairs of
variables to be set in CPack cmake_install.cmake script invocations.
This allows install(SCRIPT|CODE) to be parameterized at runtime.
Diffstat (limited to 'Tests')
3 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index a3c72a1..746ff8b 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -37,6 +37,7 @@ unset(ENVIRONMENT) run_cpack_test(USER_FILELIST "RPM.USER_FILELIST" false "MONOLITHIC") 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(CPACK_CUSTOM_INSTALL_VARIABLES "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") run_cpack_test_subtests( diff --git a/Tests/RunCMake/CPack/tests/CPACK_CUSTOM_INSTALL_VARIABLES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/CPACK_CUSTOM_INSTALL_VARIABLES/ExpectedFiles.cmake new file mode 100644 index 0000000..a05513b --- /dev/null +++ b/Tests/RunCMake/CPack/tests/CPACK_CUSTOM_INSTALL_VARIABLES/ExpectedFiles.cmake @@ -0,0 +1,7 @@ +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_CONTENT_1_LIST + "/foo" + "/foo/bar.txt" + "/foo/baz.txt" + "/foo/foo.txt" +) diff --git a/Tests/RunCMake/CPack/tests/CPACK_CUSTOM_INSTALL_VARIABLES/test.cmake b/Tests/RunCMake/CPack/tests/CPACK_CUSTOM_INSTALL_VARIABLES/test.cmake new file mode 100644 index 0000000..4a12f19 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/CPACK_CUSTOM_INSTALL_VARIABLES/test.cmake @@ -0,0 +1,7 @@ +set(CPACK_CUSTOM_INSTALL_VARIABLES "FOO=foo.txt" "BAR=bar.txt") + +install(CODE [[ + file(WRITE ${CMAKE_INSTALL_PREFIX}/foo/${FOO}) + file(WRITE ${CMAKE_INSTALL_PREFIX}/foo/${BAR}) + file(WRITE ${CMAKE_INSTALL_PREFIX}/foo/baz.txt) +]]) |