diff options
author | Brad King <brad.king@kitware.com> | 2017-09-22 14:15:47 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-09-22 14:15:54 (GMT) |
commit | 7df7eea7cf9c0bcaa7c690a6f56995704c78a7b6 (patch) | |
tree | 95df6934359165b9935e09259615121ca5c25589 /Tests/QtAutogenRerun/rccDepends | |
parent | 33eec572328847da74f87c99bde3c5f0eef992bb (diff) | |
parent | 51fd7b714ba518e70f4aa192b1d39e32eea79aef (diff) | |
download | CMake-7df7eea7cf9c0bcaa7c690a6f56995704c78a7b6.zip CMake-7df7eea7cf9c0bcaa7c690a6f56995704c78a7b6.tar.gz CMake-7df7eea7cf9c0bcaa7c690a6f56995704c78a7b6.tar.bz2 |
Merge topic 'autogen-generators-refactor'
51fd7b71 Autogen: Tests: Add a change-not test to the mocRerun test
c8f92db7 Autogen: Tests: Disable an AUTOMOC_DEPENDS_FILTER test for Ninja
3c77515e Autogen: Tests: Refactor the QtAutogenRebuild rccDepends test
04a0daee Autogen: Tests: Move each rerun test script to a NAME.cmake file
e5c6610a Autogen: Tests: Extend CMAKE_AUTOMOC_DEPEND_FILTERS rebuild test
93265652 Autogen: Tests: Add <SUBDIR>/ui_view.h AUTOUIC includes to sameName test
4eb7d817 Autogen: Tests: Add <SUBDIR>/item.moc includes to sameName test
3f223743 Autogen: Read relative paths from rcc output
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1244
Diffstat (limited to 'Tests/QtAutogenRerun/rccDepends')
15 files changed, 51 insertions, 43 deletions
diff --git a/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt b/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt index edc0ac3..291592e 100644 --- a/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt +++ b/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.9) project(rccDepends CXX) -set(CMAKE_AUTORCC ON) - if (QT_TEST_VERSION STREQUAL 4) find_package(Qt4 REQUIRED) set(QT_CORE_TARGET Qt4::QtCore) @@ -15,21 +13,29 @@ else() set(QT_CORE_TARGET Qt5::Core) endif() -configure_file(res/input1.txt.in res1/input.txt COPYONLY) -configure_file(res/input1.txt.in res1/inputAdded.txt COPYONLY) -configure_file(res/input2.txt.in res2/input.txt COPYONLY) -configure_file(res/input2.txt.in res2/inputAdded.txt COPYONLY) -# Dependency generated qrc file -add_custom_command(OUTPUT res2.qrc - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/res2.qrc.in - COMMAND ${CMAKE_COMMAND} -E sleep 2 - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/res2.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/res2.qrc - ) +# Enable AUTORCC for all targets +set(CMAKE_AUTORCC ON) + +# Initial resource files setup +configure_file(resPlain/input.txt.in resPlain/input.txt COPYONLY) +configure_file(resPlain/input.txt.in resPlain/inputAdded.txt COPYONLY) +configure_file(resGen/input.txt.in resGen/input.txt COPYONLY) +configure_file(resGen/input.txt.in resGen/inputAdded.txt COPYONLY) + +# Generated qrc file with dependency +add_custom_command(OUTPUT resGen.qrc + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc.in + COMMAND ${CMAKE_COMMAND} -E sleep 2 + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc) + +# Target that uses a plain .qrc file +add_executable(rccDependsPlain main.cpp ${CMAKE_CURRENT_BINARY_DIR}/resPlain.qrc) +target_link_libraries(rccDependsPlain ${QT_CORE_TARGET}) +add_custom_command(TARGET rccDependsPlain POST_BUILD COMMAND + ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:rccDependsPlain>" > targetPlain.txt) -add_executable(rccDepends - main.cpp - ${CMAKE_CURRENT_BINARY_DIR}/res1.qrc - ${CMAKE_CURRENT_BINARY_DIR}/res2.qrc ) -target_link_libraries(rccDepends ${QT_CORE_TARGET}) -add_custom_command(TARGET rccDepends POST_BUILD COMMAND - ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:rccDepends>" > target.txt) +# Target that uses a GENERATED .qrc file +add_executable(rccDependsGen main.cpp ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc ) +target_link_libraries(rccDependsGen ${QT_CORE_TARGET}) +add_custom_command(TARGET rccDependsGen POST_BUILD COMMAND + ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:rccDependsGen>" > targetGen.txt) diff --git a/Tests/QtAutogenRerun/rccDepends/res/input1.txt.in b/Tests/QtAutogenRerun/rccDepends/res/input1.txt.in deleted file mode 100644 index da62762..0000000 --- a/Tests/QtAutogenRerun/rccDepends/res/input1.txt.in +++ /dev/null @@ -1 +0,0 @@ -Res1 input. diff --git a/Tests/QtAutogenRerun/rccDepends/res/input2.txt.in b/Tests/QtAutogenRerun/rccDepends/res/input2.txt.in deleted file mode 100644 index 08e14b7..0000000 --- a/Tests/QtAutogenRerun/rccDepends/res/input2.txt.in +++ /dev/null @@ -1 +0,0 @@ -Res2 input. diff --git a/Tests/QtAutogenRerun/rccDepends/res1a.qrc.in b/Tests/QtAutogenRerun/rccDepends/res1a.qrc.in deleted file mode 100644 index d111ffb..0000000 --- a/Tests/QtAutogenRerun/rccDepends/res1a.qrc.in +++ /dev/null @@ -1,5 +0,0 @@ -<RCC> - <qresource prefix="/Texts1"> - <file>res1/input.txt</file> - </qresource> -</RCC> diff --git a/Tests/QtAutogenRerun/rccDepends/res1b.qrc.in b/Tests/QtAutogenRerun/rccDepends/res1b.qrc.in deleted file mode 100644 index 4cb3f04..0000000 --- a/Tests/QtAutogenRerun/rccDepends/res1b.qrc.in +++ /dev/null @@ -1,6 +0,0 @@ -<RCC> - <qresource prefix="/Texts1"> - <file>res1/input.txt</file> - <file alias="Added">res1/inputAdded.txt</file> - </qresource> -</RCC> diff --git a/Tests/QtAutogenRerun/rccDepends/res2a.qrc.in b/Tests/QtAutogenRerun/rccDepends/res2a.qrc.in deleted file mode 100644 index 19f34ac..0000000 --- a/Tests/QtAutogenRerun/rccDepends/res2a.qrc.in +++ /dev/null @@ -1,5 +0,0 @@ -<RCC> - <qresource prefix="/Texts2"> - <file>res2/input.txt</file> - </qresource> -</RCC> diff --git a/Tests/QtAutogenRerun/rccDepends/res2b.qrc.in b/Tests/QtAutogenRerun/rccDepends/res2b.qrc.in deleted file mode 100644 index 19e8ba1..0000000 --- a/Tests/QtAutogenRerun/rccDepends/res2b.qrc.in +++ /dev/null @@ -1,6 +0,0 @@ -<RCC> - <qresource prefix="/Texts2"> - <file>res2/input.txt</file> - <file alias="Added">res2/inputAdded.txt</file> - </qresource> -</RCC> diff --git a/Tests/QtAutogenRerun/rccDepends/resGen/input.txt.in b/Tests/QtAutogenRerun/rccDepends/resGen/input.txt.in new file mode 100644 index 0000000..4f24589 --- /dev/null +++ b/Tests/QtAutogenRerun/rccDepends/resGen/input.txt.in @@ -0,0 +1 @@ +Generated resource input. diff --git a/Tests/QtAutogenRerun/rccDepends/resGen/inputAdded.txt.in b/Tests/QtAutogenRerun/rccDepends/resGen/inputAdded.txt.in new file mode 100644 index 0000000..4f24589 --- /dev/null +++ b/Tests/QtAutogenRerun/rccDepends/resGen/inputAdded.txt.in @@ -0,0 +1 @@ +Generated resource input. diff --git a/Tests/QtAutogenRerun/rccDepends/resGenA.qrc.in b/Tests/QtAutogenRerun/rccDepends/resGenA.qrc.in new file mode 100644 index 0000000..c131a34 --- /dev/null +++ b/Tests/QtAutogenRerun/rccDepends/resGenA.qrc.in @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/TextsGenerated"> + <file>resGen/input.txt</file> + </qresource> +</RCC> diff --git a/Tests/QtAutogenRerun/rccDepends/resGenB.qrc.in b/Tests/QtAutogenRerun/rccDepends/resGenB.qrc.in new file mode 100644 index 0000000..8c7e643 --- /dev/null +++ b/Tests/QtAutogenRerun/rccDepends/resGenB.qrc.in @@ -0,0 +1,6 @@ +<RCC> + <qresource prefix="/TextsGenerated"> + <file>resGen/input.txt</file> + <file alias="Added">resGen/inputAdded.txt</file> + </qresource> +</RCC> diff --git a/Tests/QtAutogenRerun/rccDepends/resPlain/input.txt.in b/Tests/QtAutogenRerun/rccDepends/resPlain/input.txt.in new file mode 100644 index 0000000..a5e407a --- /dev/null +++ b/Tests/QtAutogenRerun/rccDepends/resPlain/input.txt.in @@ -0,0 +1 @@ +Plaint resource input. diff --git a/Tests/QtAutogenRerun/rccDepends/resPlain/inputAdded.txt.in b/Tests/QtAutogenRerun/rccDepends/resPlain/inputAdded.txt.in new file mode 100644 index 0000000..a5e407a --- /dev/null +++ b/Tests/QtAutogenRerun/rccDepends/resPlain/inputAdded.txt.in @@ -0,0 +1 @@ +Plaint resource input. diff --git a/Tests/QtAutogenRerun/rccDepends/resPlainA.qrc.in b/Tests/QtAutogenRerun/rccDepends/resPlainA.qrc.in new file mode 100644 index 0000000..c135d85 --- /dev/null +++ b/Tests/QtAutogenRerun/rccDepends/resPlainA.qrc.in @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/TextsPlain"> + <file>resPlain/input.txt</file> + </qresource> +</RCC> diff --git a/Tests/QtAutogenRerun/rccDepends/resPlainB.qrc.in b/Tests/QtAutogenRerun/rccDepends/resPlainB.qrc.in new file mode 100644 index 0000000..186b653 --- /dev/null +++ b/Tests/QtAutogenRerun/rccDepends/resPlainB.qrc.in @@ -0,0 +1,6 @@ +<RCC> + <qresource prefix="/TextsPlain"> + <file>resPlain/input.txt</file> + <file alias="Added">resPlain/inputAdded.txt</file> + </qresource> +</RCC> |