From 15f1a6b49958cc7757f951839b02a00e8c820154 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 16 Apr 2015 13:56:23 -0400 Subject: Tests/QtAutogen: Avoid touching files in the source tree --- Tests/QtAutogen/CMakeLists.txt | 2 +- Tests/QtAutogen/autorcc_depends/CMakeLists.txt | 5 ++++- Tests/QtAutogen/autorcc_depends/res1.qrc | 5 ----- Tests/QtAutogen/autorcc_depends/res1.qrc.in | 5 +++++ Tests/QtAutogen/autorcc_depends/res1_input.txt | 1 - Tests/QtAutogen/autorcc_depends/res1_input.txt.in | 1 + 6 files changed, 11 insertions(+), 8 deletions(-) delete mode 100644 Tests/QtAutogen/autorcc_depends/res1.qrc create mode 100644 Tests/QtAutogen/autorcc_depends/res1.qrc.in delete mode 100644 Tests/QtAutogen/autorcc_depends/res1_input.txt create mode 100644 Tests/QtAutogen/autorcc_depends/res1_input.txt.in diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 81a70f4..67e0f7e 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -147,7 +147,7 @@ set(timeformat "%Y%j%H%M%S") file(TIMESTAMP "${qrc_file1}" file1_before "${timeformat}") execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change. -execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_SOURCE_DIR}/autorcc_depends/res1_input.txt") +execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_BINARY_DIR}/autorcc_depends/res1_input.txt") execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/autorcc_depends" diff --git a/Tests/QtAutogen/autorcc_depends/CMakeLists.txt b/Tests/QtAutogen/autorcc_depends/CMakeLists.txt index 0ba86cf..9faf803 100644 --- a/Tests/QtAutogen/autorcc_depends/CMakeLists.txt +++ b/Tests/QtAutogen/autorcc_depends/CMakeLists.txt @@ -15,9 +15,12 @@ else() set(QT_CORE_TARGET Qt5::Core) endif() +configure_file(res1.qrc.in res1.qrc @ONLY) +configure_file(res1_input.txt.in res1_input.txt @ONLY) + add_executable(test_res1 test_res1.cpp - res1.qrc + ${CMAKE_CURRENT_BINARY_DIR}/res1.qrc ) target_link_libraries(test_res1 ${QT_CORE_TARGET}) add_custom_command(TARGET test_res1 POST_BUILD COMMAND diff --git a/Tests/QtAutogen/autorcc_depends/res1.qrc b/Tests/QtAutogen/autorcc_depends/res1.qrc deleted file mode 100644 index cfea618..0000000 --- a/Tests/QtAutogen/autorcc_depends/res1.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - res1_input.txt - - diff --git a/Tests/QtAutogen/autorcc_depends/res1.qrc.in b/Tests/QtAutogen/autorcc_depends/res1.qrc.in new file mode 100644 index 0000000..cfea618 --- /dev/null +++ b/Tests/QtAutogen/autorcc_depends/res1.qrc.in @@ -0,0 +1,5 @@ + + + res1_input.txt + + diff --git a/Tests/QtAutogen/autorcc_depends/res1_input.txt b/Tests/QtAutogen/autorcc_depends/res1_input.txt deleted file mode 100644 index da62762..0000000 --- a/Tests/QtAutogen/autorcc_depends/res1_input.txt +++ /dev/null @@ -1 +0,0 @@ -Res1 input. diff --git a/Tests/QtAutogen/autorcc_depends/res1_input.txt.in b/Tests/QtAutogen/autorcc_depends/res1_input.txt.in new file mode 100644 index 0000000..da62762 --- /dev/null +++ b/Tests/QtAutogen/autorcc_depends/res1_input.txt.in @@ -0,0 +1 @@ +Res1 input. -- cgit v0.12