cmake/Tests/QtAutogen/MocOnly/CMakeLists.txt

30 lines
953 B
CMake
Raw Normal View History

2021-11-20 13:41:27 +01:00
cmake_minimum_required(VERSION 3.16)
2018-04-23 21:13:27 +02:00
project(MocOnly)
2019-11-11 23:01:05 +01:00
include("../AutogenCoreTest.cmake")
2018-04-23 21:13:27 +02:00
add_executable(mocOnly
main.cpp
# Test different Q_OBJECT position styles
StyleA.cpp
StyleB.cpp
# Test different moc_/.moc include positions
IncA.cpp
IncB.cpp
)
2021-09-14 00:13:48 +02:00
# 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()
2018-04-23 21:13:27 +02:00
set_property(TARGET mocOnly PROPERTY AUTOMOC ON)
target_link_libraries(mocOnly ${QT_LIBRARIES})
2019-11-11 23:01:05 +01:00
# Add compile definitions with unusual characters
target_compile_definitions(mocOnly PUBLIC "TOKEN=\"hello\;\"" )