summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-07-07 13:39:54 (GMT)
committerBrad King <brad.king@kitware.com>2017-07-07 14:12:15 (GMT)
commit9a34e95a41fff294a7fcd452cb3e78fd4ff021aa (patch)
treeee72009d3092136da8f8e0ebb02e396f70efcd4e /Tests
parent372de3f8039f69b3a2edcf7120083ec4097f8bd3 (diff)
downloadCMake-9a34e95a41fff294a7fcd452cb3e78fd4ff021aa.zip
CMake-9a34e95a41fff294a7fcd452cb3e78fd4ff021aa.tar.gz
CMake-9a34e95a41fff294a7fcd452cb3e78fd4ff021aa.tar.bz2
Autogen: Skip generated files for compatibility with CMake 3.8
The change in commit v3.9.0-rc1~464^2~8 (Autogen: Add AUTOMOC/UIC support for generated source files, 2017-03-02) changes behavior of existing projects that may not expect `AUTOGEN` on generated files and do not yet set `SKIP_AUTOGEN` on them. Disable the behavior change for now to fix the regression for CMake 3.9. We can restore it later with a policy. In order to keep the implementation and tests working, add an undocumented property we can use in the tests to enable the behavior before the policy is introduced. Fixes: #17031 Issue: #16186
Diffstat (limited to 'Tests')
-rw-r--r--Tests/QtAutogen/mocDepends/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/mocRerun/CMakeLists.txt1
2 files changed, 3 insertions, 0 deletions
diff --git a/Tests/QtAutogen/mocDepends/CMakeLists.txt b/Tests/QtAutogen/mocDepends/CMakeLists.txt
index 8bd72eb..a67dcfe 100644
--- a/Tests/QtAutogen/mocDepends/CMakeLists.txt
+++ b/Tests/QtAutogen/mocDepends/CMakeLists.txt
@@ -28,6 +28,7 @@ add_executable(mocDepends1 test1.cpp
)
target_link_libraries(mocDepends1 ${QT_CORE_TARGET})
set_target_properties(mocDepends1 PROPERTIES AUTOMOC TRUE)
+set_property(TARGET mocDepends1 PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1)
# -- Test 2 using generated library
# This tests the dependency of AUTOMOC of mocDepends2 to the
@@ -43,3 +44,4 @@ add_library(SimpleLib STATIC simpleLib.hpp simpleLib.cpp)
add_executable(mocDepends2 test2.cpp )
target_link_libraries(mocDepends2 SimpleLib ${QT_CORE_TARGET})
set_target_properties(mocDepends2 PROPERTIES AUTOMOC TRUE)
+set_property(TARGET mocDepends2 PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1)
diff --git a/Tests/QtAutogen/mocRerun/CMakeLists.txt b/Tests/QtAutogen/mocRerun/CMakeLists.txt
index 69ea8d7..14b077b 100644
--- a/Tests/QtAutogen/mocRerun/CMakeLists.txt
+++ b/Tests/QtAutogen/mocRerun/CMakeLists.txt
@@ -27,6 +27,7 @@ add_executable(mocRerun
${CMAKE_CURRENT_BINARY_DIR}/main.cpp
res1.qrc
)
+set_property(TARGET mocRerun PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1)
target_include_directories(mocRerun PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(mocRerun ${QT_CORE_TARGET})
# Write target name to text file