diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 7bb4795d35..7bb55ba3d9 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -63,7 +63,7 @@ target_include_directories(GlobalConfig INTERFACE $ $ ) -qt_feature_module_begin(LIBRARY Core +qt_feature_module_begin(NO_MODULE PUBLIC_FILE src/corelib/global/qconfig.h PRIVATE_FILE src/corelib/global/qconfig_p.h ) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 50c672d08c..6c6c2eedbb 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -397,15 +397,19 @@ function(qt_feature_module_end) # Extra header injections which have to have forwarding headers created by # qt_install_injections. - set(injections "") - qt_compute_injection_forwarding_header("${__QtFeature_library}" - SOURCE "${__QtFeature_public_file}" - OUT_VAR injections) - qt_compute_injection_forwarding_header("${__QtFeature_library}" - SOURCE "${__QtFeature_private_file}" PRIVATE - OUT_VAR injections) + # Skip creating forwarding headers if qt_feature_module_begin was called with NO_MODULE, aka + # there is no include/ so there's no place to put the forwarding headers. + if(__QtFeature_library) + set(injections "") + qt_compute_injection_forwarding_header("${__QtFeature_library}" + SOURCE "${__QtFeature_public_file}" + OUT_VAR injections) + qt_compute_injection_forwarding_header("${__QtFeature_library}" + SOURCE "${__QtFeature_private_file}" PRIVATE + OUT_VAR injections) - set(${arg_OUT_VAR_PREFIX}extra_library_injections ${injections} PARENT_SCOPE) + set(${arg_OUT_VAR_PREFIX}extra_library_injections ${injections} PARENT_SCOPE) + endif() if (NOT ("${target}" STREQUAL "NO_MODULE")) get_target_property(targetType "${target}" TYPE)