summaryrefslogtreecommitdiff
path: root/Tests/QtAutogen/MocOnly/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/QtAutogen/MocOnly/CMakeLists.txt')
-rw-r--r--Tests/QtAutogen/MocOnly/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/QtAutogen/MocOnly/CMakeLists.txt b/Tests/QtAutogen/MocOnly/CMakeLists.txt
index e109154aae..f4fde58e79 100644
--- a/Tests/QtAutogen/MocOnly/CMakeLists.txt
+++ b/Tests/QtAutogen/MocOnly/CMakeLists.txt
@@ -11,6 +11,18 @@ add_executable(mocOnly
IncA.cpp
IncB.cpp
)
+# XXX(xcode-per-cfg-src): Drop the NO_PER_CONFIG_SOURCES exclusion
+# when the Xcode generator supports per-config sources.
+if(NOT NO_PER_CONFIG_SOURCES)
+ target_sources(mocOnly PRIVATE
+ "$<$<CONFIG:Debug>:${CMAKE_CURRENT_SOURCE_DIR}/CfgDebug.cpp>"
+ "$<$<NOT:$<CONFIG:Debug>>:${CMAKE_CURRENT_SOURCE_DIR}/CfgOther.cpp>"
+ )
+ target_compile_definitions(mocOnly PRIVATE
+ "$<$<CONFIG:Debug>:HAVE_CFG_DEBUG>"
+ "$<$<NOT:$<CONFIG:Debug>>:HAVE_CFG_OTHER>"
+ )
+endif()
set_property(TARGET mocOnly PROPERTY AUTOMOC ON)
target_link_libraries(mocOnly ${QT_LIBRARIES})
# Add compile definitions with unusual characters