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(
22 add_executable(mocCMP0100Old
24 ${CSD}/Obj.hh # Manually include Obj.hh
26 ${CSD}/Obj2.cpp # Let AUTOMOC detect Obj2.hh
29 target_link_libraries(mocCMP0100Old ${QT_LIBRARIES})
30 target_include_directories(mocCMP0100Old PRIVATE ${CMAKE_CURRENT_BINARY_DIR})