CMake: Create Config.cmake files for internal modules in static builds

This change will create Config.cmake files for internal modules like
AccessibilitySupport when doing static builds. They need to be
find_package()'ed and linked in when linking in certain qt plugins.

Task-number: QTBUG-38913
Task-number: QTBUG-76562
Change-Id: Ia2e446025c87df48f20bb65cfd9da6c6a4354bb1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Alexandru Croitor 2019-06-20 15:26:39 +02:00
parent 5ca2b081fe
commit 9c7ebd191b
3 changed files with 13 additions and 1 deletions

View File

@ -26,6 +26,10 @@ contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*): CMAKE_USR_MOVE_WORKAROUND
CMAKE_OUT_DIR = $$MODULE_BASE_OUTDIR/lib/cmake
internal_module {
MODULE = "$${MODULE}_private"
}
# Core, Network, an external module named Foo
CMAKE_MODULE_NAME = $$cmakeModuleName($${MODULE})
@ -112,6 +116,10 @@ win32:!static:!staticlib {
static|staticlib:CMAKE_STATIC_TYPE = true
internal_module {
CMAKE_INTERNAL_MODULE = true
}
CMAKE_DEBUG_TYPE =
CMAKE_RELEASE_TYPE =

View File

@ -484,6 +484,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
)
!!ENDIF // TEMPLATE != aux
!!IF isEmpty(CMAKE_INTERNAL_MODULE)
file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*Plugin.cmake\")
macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION)
@ -506,6 +508,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
endforeach()
endif()
!!ENDIF // isEmpty(CMAKE_INTERNAL_MODULE)
!!IF !isEmpty(CMAKE_MODULE_EXTRAS)
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\")

View File

@ -117,7 +117,7 @@ unset(QT_FOR_PRIVATE)
QMAKE_USE_PRIVATE += $$QMAKE_USE_FOR_PRIVATE
unset(QMAKE_USE_FOR_PRIVATE)
!internal_module:CONFIG += create_cmake
CONFIG += create_cmake
contains(TARGET, QtAddOn.*): \
DEFINES += QT_BUILD_ADDON_$${ucmodule}_LIB