Merge topic 'ci-script-cmake-version'
[kiteware-cmake.git] / Tests / QtAutogen / MocCMP0100 / OLD / CMakeLists.txt
blob006cda1b4472d6d70bf837ac2cd6f9643720dbeb
1 cmake_policy(SET CMP0100 OLD)
3 # Generate moc files externally.
4 # If AUTOMOC generates the header moc files as well
5 # (it should not in OLD behavior), the test will fail with a
6 # multiple definition error when linking the executable.
7 qtx_wrap_cpp(mocCMP0100OldMoc ${CSD}/Obj.hh ${CSD}/Obj2.hh)
8 qtx_generate_moc(${CBD}/Obj.cpp ${CMAKE_CURRENT_BINARY_DIR}/Obj.moc)
9 qtx_generate_moc(${CBD}/Obj2.cpp ${CMAKE_CURRENT_BINARY_DIR}/Obj2.moc)
11 # Make sure AUTOGEN file skipping is disabled
12 set_source_files_properties(
13   ${CSD}/Obj.hh
14   ${CBD}/Obj.cpp
15   ${CSD}/Obj2.hh
16   ${CBD}/Obj2.cpp
17   PROPERTIES
18   SKIP_AUTOGEN OFF
19   SKIP_AUTOMOC OFF
22 add_executable(mocCMP0100Old
23   ${CSD}/main.cpp
24   ${CSD}/Obj.hh # Manually include Obj.hh
25   ${CSD}/Obj.cpp
26   ${CSD}/Obj2.cpp # Let AUTOMOC detect Obj2.hh
27   ${mocCMP0100OldMoc}
29 target_link_libraries(mocCMP0100Old ${QT_LIBRARIES})
30 target_include_directories(mocCMP0100Old PRIVATE ${CMAKE_CURRENT_BINARY_DIR})