diff options
Diffstat (limited to 'Tests/QtAutogenRerun/rccDepends/CMakeLists.txt')
-rw-r--r-- | Tests/QtAutogenRerun/rccDepends/CMakeLists.txt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt b/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt new file mode 100644 index 0000000..edc0ac3 --- /dev/null +++ b/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt @@ -0,0 +1,35 @@ +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) +else() + if (NOT QT_TEST_VERSION STREQUAL 5) + message(SEND_ERROR "Invalid Qt version specified.") + endif() + + find_package(Qt5Core REQUIRED) + 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 + ) + +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) |