summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutogen/CMakeLists.txt
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-11-18 07:09:56 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-11-25 21:41:21 (GMT)
commit1320e0768e57754b51294a00480927d50176bf02 (patch)
treeec1847962c1a9562a67056bc63cbab8ee6cb1c00 /Tests/QtAutogen/CMakeLists.txt
parentda6b86f4f031b189768dc474721145a1b99f71ea (diff)
downloadCMake-1320e0768e57754b51294a00480927d50176bf02.zip
CMake-1320e0768e57754b51294a00480927d50176bf02.tar.gz
CMake-1320e0768e57754b51294a00480927d50176bf02.tar.bz2
cmQtAutogen: Allow specifying depends for autogen targets.
Test this by generating files with a custom target, which moc requires to be present when it is run.
Diffstat (limited to 'Tests/QtAutogen/CMakeLists.txt')
-rw-r--r--Tests/QtAutogen/CMakeLists.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 7991c4e..9dd5289 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -43,10 +43,17 @@ add_library(codeeditorLib STATIC codeeditor.cpp)
add_library(privateSlot OBJECT private_slot.cpp)
+add_custom_target(generate_moc_input
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}"
+ COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h"
+)
+# set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/myinterface.h" PROPERTIES GENERATED TRUE)
+
add_executable(QtAutogen main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>
- test.qrc resourcetester.cpp
+ test.qrc resourcetester.cpp generated.cpp
)
+set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input)
set_target_properties(QtAutogen codeeditorLib privateSlot PROPERTIES AUTOMOC TRUE)