Propagate QT_CMAKE_EXPORT_NAMESPACE via QtCore package
QT_CMAKE_EXPORT_NAMESPACE is used by the Qt packages to make features
available to the consuming CMake project. The value was moved to the
BuildInternals Config file, but that's wrong because consuming
applications not including the BuildInternals component would fail
to use any other Qt package.
Move QT_CMAKE_EXPORT_NAMESPACE to be propagated with QtCore package
again.
Amends 9542e78525
.
Change-Id: I9841ac8c2828b00c0111d59e8976c889554e0ce1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
parent
85b038a0a2
commit
140b65e36f
@ -930,6 +930,16 @@ function(add_qt_module target)
|
||||
list(APPEND extra_cmake_includes "${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake")
|
||||
endif()
|
||||
|
||||
set(extra_cmake_code "")
|
||||
|
||||
if(target STREQUAL Core)
|
||||
# Propagate non-build related variables that are needed for consuming Qt packages.
|
||||
# Do this in CoreConfig instead of Qt5Config, so that consumers can also use
|
||||
# find_package(Qt5Core) instead of find_package(Qt5 COMPONENTS Core)
|
||||
string(APPEND extra_cmake_code "
|
||||
set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
|
||||
endif()
|
||||
|
||||
configure_package_config_file(
|
||||
"${QT_CMAKE_DIR}/QtModuleConfig.cmake.in"
|
||||
"${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake"
|
||||
|
@ -5,6 +5,10 @@ include(CMakeFindDependencyMacro)
|
||||
get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component(_import_prefix "${_import_prefix}" REALPATH)
|
||||
|
||||
# Extra cmake code begin
|
||||
@extra_cmake_code@
|
||||
# Extra cmake code end
|
||||
|
||||
# Find required dependencies, if any.
|
||||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake")
|
||||
|
Loading…
Reference in New Issue
Block a user