summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-18 16:49:09 (GMT)
committerBrad King <brad.king@kitware.com>2020-09-18 16:49:09 (GMT)
commit5a15fcf5970f1ba8b5fe86494ffbf0128ba08e96 (patch)
treeea1b2e77f1e1eb1f16caaa359a81dbb6fc8f0b48
parent0fa9392583f2e1dbe5badd9279e5c5b907221b76 (diff)
downloadCMake-5a15fcf5970f1ba8b5fe86494ffbf0128ba08e96.zip
CMake-5a15fcf5970f1ba8b5fe86494ffbf0128ba08e96.tar.gz
CMake-5a15fcf5970f1ba8b5fe86494ffbf0128ba08e96.tar.bz2
Tests: Avoid duplicate custom commands in QtAutogen.AutogenOriginDependsOff
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt13
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp2
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp2
3 files changed, 11 insertions, 6 deletions
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt b/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt
index 9e6fe8b..d9fc2b0 100644
--- a/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt
@@ -9,8 +9,8 @@ include_directories(${CBD})
# A GENERATED file ensures there will be an _autogen target in VS
add_custom_command (
- OUTPUT "${CBD}/config.hpp"
- COMMAND ${CMAKE_COMMAND} -E copy "${CSD}/config.hpp.in" "${CBD}/config.hpp"
+ OUTPUT "${CBD}/config_a.hpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CSD}/config.hpp.in" "${CBD}/config_a.hpp"
)
@@ -30,13 +30,18 @@ add_dependencies ( a_mc a_qt_autogen )
# - depends on a GENERATED file
# - AUTOMOC enabled
# - depends on a target (a_mc) that depends on a_qt_qutogen
-add_library ( a_qt a_qt.cpp "${CBD}/config.hpp" )
+add_library ( a_qt a_qt.cpp "${CBD}/config_a.hpp" )
add_dependencies ( a_qt a_mc )
target_link_libraries ( a_qt ${QT_QTCORE_TARGET})
set_target_properties ( a_qt PROPERTIES AUTOMOC TRUE)
# Disable AUTOGEN_ORIGIN_DEPENDS to avoid loop dependencies
set_target_properties ( a_qt PROPERTIES AUTOGEN_ORIGIN_DEPENDS OFF)
+# A GENERATED file ensures there will be an _autogen target in VS
+add_custom_command (
+ OUTPUT "${CBD}/config_b.hpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CSD}/config.hpp.in" "${CBD}/config_b.hpp"
+ )
# Library "b_mc" provides a header that holds a string function that returns
# the content of mocs_compilation.cpp from b_qt.
@@ -57,7 +62,7 @@ add_library ( b_mc ${CSD}/b_mc.hpp ${CBD}/b_mc.cpp )
# - depends on a GENERATED file
# - AUTOMOC enabled
# - depends on a library (b_mc) that depends on b_qt_qutogen
-add_library ( b_qt b_qt.cpp "${CBD}/config.hpp" )
+add_library ( b_qt b_qt.cpp "${CBD}/config_b.hpp" )
target_link_libraries ( b_qt b_mc )
target_link_libraries ( b_qt ${QT_QTCORE_TARGET})
set_target_properties ( b_qt PROPERTIES AUTOMOC TRUE)
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp b/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp
index fafc8a2..313b58b 100644
--- a/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp
@@ -3,7 +3,7 @@
#include <string>
-#include <config.hpp>
+#include <config_a.hpp>
#include <QObject>
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp b/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp
index b798e71..2e5775e 100644
--- a/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp
@@ -3,7 +3,7 @@
#include <string>
-#include <config.hpp>
+#include <config_b.hpp>
#include <QObject>