summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutogen/mocRerun/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/QtAutogen/mocRerun/CMakeLists.txt')
-rw-r--r--Tests/QtAutogen/mocRerun/CMakeLists.txt18
1 files changed, 12 insertions, 6 deletions
diff --git a/Tests/QtAutogen/mocRerun/CMakeLists.txt b/Tests/QtAutogen/mocRerun/CMakeLists.txt
index ca0eedf..6689f50 100644
--- a/Tests/QtAutogen/mocRerun/CMakeLists.txt
+++ b/Tests/QtAutogen/mocRerun/CMakeLists.txt
@@ -17,13 +17,19 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
configure_file(test1a.h.in test1.h COPYONLY)
+# Generated source file
+add_custom_command(OUTPUT main.cpp
+ COMMAND ${CMAKE_COMMAND} -E sleep 3
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
+ )
-add_executable(test1
+add_executable(mocRerun
${CMAKE_CURRENT_BINARY_DIR}/test1.h
- test1.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
res1.qrc
)
-target_include_directories(test1 PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
-target_link_libraries(test1 ${QT_CORE_TARGET})
-add_custom_command(TARGET test1 POST_BUILD COMMAND
- ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:test1>" > target1.txt)
+target_include_directories(mocRerun PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+target_link_libraries(mocRerun ${QT_CORE_TARGET})
+# Write target name to text file
+add_custom_command(TARGET mocRerun POST_BUILD COMMAND
+ ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:mocRerun>" > target1.txt)