diff options
author | Brad King <brad.king@kitware.com> | 2014-06-24 15:18:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-06-24 17:18:20 (GMT) |
commit | c9568de52c4e11c04a9f758ea9ecc1e72ea7cbfb (patch) | |
tree | 650b97387b48c5e3851d857955ca3ea2d17e1d29 /Tests | |
parent | ec7cf7ea1311adaf6eb8dd1ab5c2aa8e3745339e (diff) | |
download | CMake-c9568de52c4e11c04a9f758ea9ecc1e72ea7cbfb.zip CMake-c9568de52c4e11c04a9f758ea9ecc1e72ea7cbfb.tar.gz CMake-c9568de52c4e11c04a9f758ea9ecc1e72ea7cbfb.tar.bz2 |
install: Add CMAKE_INSTALL_MESSAGE variable (#13761)
Create a variable to allow users to control which installation
messages are printed. In particular, provide a "LAZY" setting
that prints "Installing" messages but not "Up-to-date" messages.
This is desirable for incremental re-installations.
Suggested-by: J Decker <d3ck0r@gmail.com>
Diffstat (limited to 'Tests')
4 files changed, 29 insertions, 0 deletions
diff --git a/Tests/RunCMake/install/DIRECTORY-message-lazy-check.cmake b/Tests/RunCMake/install/DIRECTORY-message-lazy-check.cmake new file mode 100644 index 0000000..c7e6018 --- /dev/null +++ b/Tests/RunCMake/install/DIRECTORY-message-lazy-check.cmake @@ -0,0 +1,24 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/prefix) +execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake + OUTPUT_VARIABLE out ERROR_VARIABLE err) +set(expect " +-- Installing: [^\n]*/prefix/dir\r? +-- Installing: [^\n]*/prefix/dir/empty.txt\r? +") +if(NOT out MATCHES "${expect}") + string(REGEX REPLACE "\n" "\n " out " ${out}") + set(RunCMake_TEST_FAILED + "${RunCMake_TEST_FAILED}First install did not say 'Installing' as expected:\n${out}") +endif() +set(f ${RunCMake_TEST_BINARY_DIR}/prefix/dir/empty.txt) +if(NOT EXISTS "${f}") + set(RunCMake_TEST_FAILED + "${RunCMake_TEST_FAILED}File was not installed:\n ${f}\n") +endif() +execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake + OUTPUT_VARIABLE out ERROR_VARIABLE err) +if(out MATCHES "(Installing|Up-to-date)") + string(REGEX REPLACE "\n" "\n " out " ${out}") + set(RunCMake_TEST_FAILED + "${RunCMake_TEST_FAILED}Second install was not silent as expected:\n${out}") +endif() diff --git a/Tests/RunCMake/install/DIRECTORY-message-lazy.cmake b/Tests/RunCMake/install/DIRECTORY-message-lazy.cmake new file mode 100644 index 0000000..ed43567 --- /dev/null +++ b/Tests/RunCMake/install/DIRECTORY-message-lazy.cmake @@ -0,0 +1,3 @@ +set(CMAKE_INSTALL_MESSAGE "LAZY") +set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/prefix") +install(DIRECTORY dir/ DESTINATION dir) diff --git a/Tests/RunCMake/install/DIRECTORY-message.cmake b/Tests/RunCMake/install/DIRECTORY-message.cmake index 548e0df..913ed15 100644 --- a/Tests/RunCMake/install/DIRECTORY-message.cmake +++ b/Tests/RunCMake/install/DIRECTORY-message.cmake @@ -1,2 +1,3 @@ +set(CMAKE_INSTALL_MESSAGE "ALWAYS") set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/prefix") install(DIRECTORY dir/ DESTINATION dir) diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index 39d2c1d..8016801 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCMake) run_cmake(DIRECTORY-message) +run_cmake(DIRECTORY-message-lazy) run_cmake(SkipInstallRulesWarning) run_cmake(SkipInstallRulesNoWarning1) run_cmake(SkipInstallRulesNoWarning2) |