diff options
author | Sebastian Holtermann <sebholt@web.de> | 2019-12-30 15:00:15 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@web.de> | 2020-01-04 10:33:05 (GMT) |
commit | 9eab3cad6a118b1dc3b8bcb4da3d6f29c67fce43 (patch) | |
tree | e5a52bff402d634c609da7fbd8d6d05dd7c10400 /Tests/QtAutogen/MocCMP0100/OLD | |
parent | 8c2be3ae94986586aedc3c710694ee7f38296412 (diff) | |
download | CMake-9eab3cad6a118b1dc3b8bcb4da3d6f29c67fce43.zip CMake-9eab3cad6a118b1dc3b8bcb4da3d6f29c67fce43.tar.gz CMake-9eab3cad6a118b1dc3b8bcb4da3d6f29c67fce43.tar.bz2 |
Tests: Add AUTOGEN policy CMP0100 test
Add a test for policy CMP0100 that configures whether or not
AUTOMOC and AUTOUIC should process .hh header files.
Diffstat (limited to 'Tests/QtAutogen/MocCMP0100/OLD')
-rw-r--r-- | Tests/QtAutogen/MocCMP0100/OLD/CMakeLists.txt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Tests/QtAutogen/MocCMP0100/OLD/CMakeLists.txt b/Tests/QtAutogen/MocCMP0100/OLD/CMakeLists.txt new file mode 100644 index 0000000..2be0535 --- /dev/null +++ b/Tests/QtAutogen/MocCMP0100/OLD/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.16) +cmake_policy(SET CMP0100 OLD) + +# Generate moc files externally. +# If AUTOMOC generates the header moc files as well +# (it should not in OLD behavior), the test will fail with a +# multiple definition error when linking the executable. +qtx_wrap_cpp(mocCMP0100OldMoc ${CSD}/Obj.hh ${CSD}/Obj2.hh) +qtx_generate_moc(${CBD}/Obj.cpp ${CMAKE_CURRENT_BINARY_DIR}/Obj.moc) +qtx_generate_moc(${CBD}/Obj2.cpp ${CMAKE_CURRENT_BINARY_DIR}/Obj2.moc) + +# Make sure AUTOGEN file skipping is disabled +set_source_files_properties( + ${CSD}/Obj.hh + ${CBD}/Obj.cpp + ${CSD}/Obj2.hh + ${CBD}/Obj2.cpp + PROPERTIES + SKIP_AUTOGEN OFF + SKIP_AUTOMOC OFF +) + +add_executable(mocCMP0100Old + ${CSD}/main.cpp + ${CSD}/Obj.hh # Manually include Obj.hh + ${CSD}/Obj.cpp + ${CSD}/Obj2.cpp # Let AUTOMOC detect Obj2.hh + ${mocCMP0100OldMoc} +) +target_link_libraries(mocCMP0100Old ${QT_LIBRARIES}) +target_include_directories(mocCMP0100Old PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) |