summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2020-03-05 14:31:13 +0100
committerLeander Beernaert <leander.beernaert@qt.io>2020-03-05 16:14:19 +0100
commitfda03bfed09821f508ff8ec7ebbd411b0a42e4bc (patch)
tree7742c59488f23f26e40d95e3dd3ee4eda7ca5ae9
parent98fb632f4744857c050e06cec790a6b76509c32a (diff)
CMake: Convert Core_qobject to a static module
This removes the last add_custom_target when used in conjunction with the Ninja and CMake >= 3.17. Change-Id: Ibb9bdff4b5bc00542d2a5ba631cea7e0510ad5e9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--src/corelib/CMakeLists.txt22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index 49bc440ea9..da5b6fa670 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -27,10 +27,6 @@ file(RELATIVE_PATH QT_INVERSE_CONFIG_INSTALL_DIR ${_clean_prefix} ${CMAKE_INSTAL
## Core Module:
#####################################################################
-# special case begin
-add_library(Core_qobject OBJECT)
-# special case end
-
qt_add_module(Core
GENERATE_METATYPES
QMAKE_MODULE_CONFIG moc resources
@@ -260,7 +256,6 @@ qt_add_module(Core
QtHarfBuzz # special case
Threads::Threads # special case
WrapDoubleConversion::WrapDoubleConversion # special case
- Core_qobject
PUBLIC_LIBRARIES # special case:
Qt::Platform # special case:
# special case begin
@@ -285,6 +280,13 @@ qt_generate_qconfig_cpp()
# Handle QObject: Automoc does not work for this as it would
# require to spill internals into users:
+qt_add_module(Core_qobject STATIC
+ NO_SYNC_QT
+ NO_CONFIG_HEADER_FILE
+ NO_MODULE_HEADERS
+ INTERNAL_MODULE
+ SKIP_DEPENDS_INCLUDE
+)
set_target_properties(Core_qobject PROPERTIES AUTOMOC OFF)
qt_manual_moc(qobject_moc_files OUTPUT_MOC_JSON_FILES core_qobject_metatypes_json_list kernel/qobject.h global/qnamespace.h)
set_source_files_properties(${qobject_moc_files} PROPERTIES HEADER_FILE_ONLY ON)
@@ -298,7 +300,8 @@ set_target_properties(Core_qobject PROPERTIES
)
target_include_directories(Core_qobject PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/kernel") # for moc_qobject.cpp
target_link_libraries(Core_qobject PRIVATE Qt::Platform Qt::GlobalConfig)
-target_link_libraries(Core PRIVATE Core_qobject)
+extend_target(Core LIBRARIES Qt::Core_qobject)
+add_dependencies(Core_qobject ${QT_CMAKE_EXPORT_NAMESPACE}::moc)
set(core_qobject_metatypes_json_args)
if (NOT QT_WILL_INSTALL)
@@ -310,13 +313,6 @@ qt6_generate_meta_types_json_file(Core_qobject
${core_qobject_metatypes_json_args}
)
-if(NOT BUILD_SHARED_LIBS)
- install(
- TARGETS Core_qobject
- EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets"
- )
-endif()
-
# Core_qobject is never exported so we need to duplicate the metatypes file
# interface on Core
get_target_property(core_qobject_metatypes_file_genex_build Core_qobject QT_MODULE_META_TYPES_FILE_GENEX_BUILD)