diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-05-22 11:06:04 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-05-22 15:06:48 +0000 |
commit | fc8be0ccc65851a943ba36e0309dbc2680989423 (patch) | |
tree | 05bd99ce001cf316bc56c8c375a42eac8c08c09a /src/CMakeLists.txt | |
parent | aa07bf6f70c90943ce25afbad0534a43cdd1f494 (diff) |
CMake build: Fix compilation of tests
Some more explicit mocs needed on macOS/Clang
Change-Id: I0d26f499c4abe70a3fd625752bb28f86a023cd36
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index de0877e9eb..be56ed0bd0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -56,6 +56,12 @@ function(separate_object_libraries libraries REGULAR_LIBS OBJECT_LIBS OBJECT_LIB endif() endfunction(separate_object_libraries) +function(set_explicit_moc target_name file) + set_property(SOURCE "${file}" PROPERTY SKIP_AUTOMOC ON) + qt5_wrap_cpp(file_moc "${file}") + target_sources(${target_name} PRIVATE "${file_moc}") +endfunction() + function(add_qtc_library name) cmake_parse_arguments(_arg "STATIC;OBJECT" "" "DEFINES;DEPENDS;INCLUDES;PUBLIC_DEFINES;PUBLIC_DEPENDS;PUBLIC_INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;PROPERTIES" ${ARGN} @@ -125,9 +131,7 @@ function(add_qtc_library name) endforeach() foreach(file IN LISTS _arg_EXPLICIT_MOC) - set_property(SOURCE ${file} PROPERTY SKIP_AUTOMOC ON) - qt5_wrap_cpp(file_moc ${file}) - target_sources(${name} PRIVATE ${file_moc}) + set_explicit_moc(${name} "${file}") endforeach() foreach(file IN LISTS _arg_SKIP_AUTOMOC) @@ -326,9 +330,7 @@ function(add_qtc_plugin target_name) ) foreach(file IN LISTS _arg_EXPLICIT_MOC) - set_property(SOURCE ${file} PROPERTY SKIP_AUTOMOC ON) - qt5_wrap_cpp(file_moc ${file}) - target_sources(${target_name} PRIVATE ${file_moc}) + set_explicit_moc(${target_name} "${file}") endforeach() install(TARGETS ${target_name} |