summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2018-07-11 21:03:30 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2018-07-17 13:07:01 (GMT)
commitae1c917f1aa6e544f27c5e73ede0edb10da0c3ad (patch)
treedd5455af422b461c3c5c4d3bfafaad0213317b17 /Tests/RunCMake
parent2c62a45a5a11c624f4b1bb882831f696c51818f1 (diff)
downloadCMake-ae1c917f1aa6e544f27c5e73ede0edb10da0c3ad.zip
CMake-ae1c917f1aa6e544f27c5e73ede0edb10da0c3ad.tar.gz
CMake-ae1c917f1aa6e544f27c5e73ede0edb10da0c3ad.tar.bz2
Tests: Add test for install(<SCRIPT|CODE>)
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/install/SCRIPT-all-check.cmake1
-rw-r--r--Tests/RunCMake/install/SCRIPT.cmake4
-rw-r--r--Tests/RunCMake/install/install_script.cmake5
4 files changed, 11 insertions, 0 deletions
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index 5495d56..8bd3c99 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -83,6 +83,7 @@ unset(RunCMake_TEST_OPTIONS)
run_install_test(Deprecated)
run_install_test(PRE_POST_INSTALL_SCRIPT)
+run_install_test(SCRIPT)
set(run_install_test_components 1)
run_install_test(FILES-EXCLUDE_FROM_ALL)
diff --git a/Tests/RunCMake/install/SCRIPT-all-check.cmake b/Tests/RunCMake/install/SCRIPT-all-check.cmake
new file mode 100644
index 0000000..48d8e1a
--- /dev/null
+++ b/Tests/RunCMake/install/SCRIPT-all-check.cmake
@@ -0,0 +1 @@
+check_installed([[^empty1.txt;empty2.txt$]])
diff --git a/Tests/RunCMake/install/SCRIPT.cmake b/Tests/RunCMake/install/SCRIPT.cmake
new file mode 100644
index 0000000..f857b54
--- /dev/null
+++ b/Tests/RunCMake/install/SCRIPT.cmake
@@ -0,0 +1,4 @@
+install(
+ SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/install_script.cmake"
+ CODE "write_empty_file(empty2.txt)"
+ )
diff --git a/Tests/RunCMake/install/install_script.cmake b/Tests/RunCMake/install/install_script.cmake
new file mode 100644
index 0000000..1f8522c
--- /dev/null
+++ b/Tests/RunCMake/install/install_script.cmake
@@ -0,0 +1,5 @@
+function(write_empty_file FILENAME)
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/${FILENAME}" "")
+endfunction()
+
+write_empty_file(empty1.txt)