diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2018-07-11 20:42:24 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2018-07-17 13:07:01 (GMT) |
commit | 2c62a45a5a11c624f4b1bb882831f696c51818f1 (patch) | |
tree | eabd7fff8ed353b74eed4739fc82ebb5e25c1b1e /Tests/RunCMake/install | |
parent | db4bc2fa1814a230a8f58293a48465cba9a22a36 (diff) | |
download | CMake-2c62a45a5a11c624f4b1bb882831f696c51818f1.zip CMake-2c62a45a5a11c624f4b1bb882831f696c51818f1.tar.gz CMake-2c62a45a5a11c624f4b1bb882831f696c51818f1.tar.bz2 |
Tests: Add test for <PRE|POST>_INSTALL_SCRIPT
Diffstat (limited to 'Tests/RunCMake/install')
-rw-r--r-- | Tests/RunCMake/install/PRE_POST_INSTALL_SCRIPT-all-check.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/install/PRE_POST_INSTALL_SCRIPT.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/install/RunCMakeTest.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/install/postinstall.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/install/preinstall.cmake | 1 |
5 files changed, 11 insertions, 0 deletions
diff --git a/Tests/RunCMake/install/PRE_POST_INSTALL_SCRIPT-all-check.cmake b/Tests/RunCMake/install/PRE_POST_INSTALL_SCRIPT-all-check.cmake new file mode 100644 index 0000000..16ff1e1 --- /dev/null +++ b/Tests/RunCMake/install/PRE_POST_INSTALL_SCRIPT-all-check.cmake @@ -0,0 +1 @@ +check_installed([[^bin;bin/myexe(\.exe)?;postinstall;preinstall]]) diff --git a/Tests/RunCMake/install/PRE_POST_INSTALL_SCRIPT.cmake b/Tests/RunCMake/install/PRE_POST_INSTALL_SCRIPT.cmake new file mode 100644 index 0000000..357c688 --- /dev/null +++ b/Tests/RunCMake/install/PRE_POST_INSTALL_SCRIPT.cmake @@ -0,0 +1,7 @@ +enable_language(C) + +add_executable(myexe main.c) +set_property(TARGET myexe PROPERTY PRE_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/preinstall.cmake") +set_property(TARGET myexe PROPERTY POST_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/postinstall.cmake") + +install(TARGETS myexe DESTINATION bin) diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index 574bf1a..5495d56 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -82,6 +82,7 @@ run_install_test(TARGETS-OUTPUT_NAME) unset(RunCMake_TEST_OPTIONS) run_install_test(Deprecated) +run_install_test(PRE_POST_INSTALL_SCRIPT) set(run_install_test_components 1) run_install_test(FILES-EXCLUDE_FROM_ALL) diff --git a/Tests/RunCMake/install/postinstall.cmake b/Tests/RunCMake/install/postinstall.cmake new file mode 100644 index 0000000..7607f40 --- /dev/null +++ b/Tests/RunCMake/install/postinstall.cmake @@ -0,0 +1 @@ +file(WRITE "${CMAKE_INSTALL_PREFIX}/postinstall" "postinstall") diff --git a/Tests/RunCMake/install/preinstall.cmake b/Tests/RunCMake/install/preinstall.cmake new file mode 100644 index 0000000..4b28d16 --- /dev/null +++ b/Tests/RunCMake/install/preinstall.cmake @@ -0,0 +1 @@ +file(WRITE "${CMAKE_INSTALL_PREFIX}/preinstall" "preinstall") |