aboutsummaryrefslogtreecommitdiff
path: root/tests/ECMConfiguredInstallTest/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Edmundson <kde@davidedmundson.co.uk>2020-06-08 15:29:40 +0100
committerDavid Edmundson <davidedmundson@kde.org>2020-07-10 12:12:58 +0000
commit0ae520199d0e0523f4f0aa847b7567d72ae9553d (patch)
tree4dc13a76d6dfb691b629962b21abbc2fa5ddfce6 /tests/ECMConfiguredInstallTest/CMakeLists.txt
parent4ad3d1615f90adc66f053183f82eec572b35d011 (diff)
downloadextra-cmake-modules-0ae520199d0e0523f4f0aa847b7567d72ae9553d.tar.gz
extra-cmake-modules-0ae520199d0e0523f4f0aa847b7567d72ae9553d.tar.bz2
Introduce function ecm_install_configured_file
Summary: This, as the name suggests, configures a file and installs it. It's not very complicated but it's a repeated pattern in plasma that gets quite messy dealing with temporary files. Test Plan: Used in a project Reviewers: #build_system Subscribers: apol, kossebau, pino, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D28355
Diffstat (limited to 'tests/ECMConfiguredInstallTest/CMakeLists.txt')
-rw-r--r--tests/ECMConfiguredInstallTest/CMakeLists.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ECMConfiguredInstallTest/CMakeLists.txt b/tests/ECMConfiguredInstallTest/CMakeLists.txt
new file mode 100644
index 00000000..a698dd0b
--- /dev/null
+++ b/tests/ECMConfiguredInstallTest/CMakeLists.txt
@@ -0,0 +1,21 @@
+cmake_minimum_required(VERSION 3.5)
+project(ECMConfiguredInstallTest)
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../modules)
+
+# make sure the test install dir is clean
+file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}")
+include(ECMConfiguredInstall)
+
+# run test
+
+set(FOO myFoo)
+set(BAR myBar)
+
+ecm_install_configured_files(INPUT configured.txt DESTINATION ${CMAKE_INSTALL_PREFIX}/test)
+
+ecm_install_configured_files(INPUT configured_atOnly.txt.in DESTINATION ${CMAKE_INSTALL_PREFIX}/test @ONLY ESCAPE_QUOTES)
+
+ecm_install_configured_files(INPUT multi1.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/multi2.txt.in DESTINATION ${CMAKE_INSTALL_PREFIX}/test)
+
+# this will be run by CTest
+configure_file(check_tree.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/check_tree.cmake" @ONLY)