Fix static usage requirements for XcbQpa

In particular, Qt targets extended with other qt targets
(eg. Qt::VulkanSupport or Qt::LinuxAccessibilitySupport)
after the first add_qt_module were not taken into account when generating
Depends files.

Note that this patch updates the minimum required version
to CMake 3.15

Change-Id: I747deedd4d59e385876bc1a834ef9bdb6078911b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Jean-Michaël Celerier 2019-06-05 10:08:44 +02:00 committed by Jean-Michaël Celerier
parent c220974ed8
commit fecd9d90da
11 changed files with 97 additions and 28 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14.0)
cmake_minimum_required(VERSION 3.15.0)
project(QtBase
VERSION 5.14.0

View File

@ -2,4 +2,7 @@ include(FindPkgConfig)
if(NOT TARGET PkgConfig::ATSPI2)
pkg_check_modules(ATSPI2 atspi-2 IMPORTED_TARGET)
if (NOT TARGET PkgConfig::ATSPI2)
set(ATSPI2_FOUND 0)
endif()
endif()

View File

@ -1,3 +1,7 @@
include(FindPkgConfig)
pkg_check_modules(GTK3 "gtk+-3.0 >= 3.6" IMPORTED_TARGET)
if (NOT TARGET PkgConfig::GTK3)
set(GTK3_FOUND 0)
endif()

View File

@ -1,3 +1,7 @@
find_package(PkgConfig)
pkg_check_modules(Tslib tslib IMPORTED_TARGET)
if (NOT TARGET PkgConfig::Tslib)
set(Tslib_FOUND 0)
endif()

View File

@ -0,0 +1,7 @@
include(FindPkgConfig)
pkg_check_modules(XKB_COMMON_X11 "xkbcommon-x11>=0.4.1" IMPORTED_TARGET)
if (NOT TARGET PkgConfig::XKB_COMMON_X11)
set(XKB_COMMON_X11_FOUND 0)
endif()

View File

@ -795,7 +795,6 @@ function(extend_target target)
endif()
endif()
endforeach()
# Set-up the target
target_sources("${target}" PRIVATE ${arg_SOURCES} ${dbus_sources})
if (arg_COMPILE_FLAGS)
@ -811,6 +810,23 @@ function(extend_target target)
AUTOMOC_MOC_OPTIONS "${arg_MOC_OPTIONS}"
_qt_target_deps "${target_deps}"
)
# When a public module depends on private, also make its private depend on the other's private
set(qt_libs_private "")
foreach(it ${QT_KNOWN_MODULES})
list(FIND arg_LIBRARIES "Qt::${it}Private" pos)
if(pos GREATER -1)
list(APPEND qt_libs_private "Qt::${it}Private")
endif()
endforeach()
set(target_private "${target}Private")
if(TARGET "${target_private}")
target_link_libraries("${target_private}" INTERFACE "${target}" "${qt_libs_private}")
endif()
qt_register_target_dependencies("${target}" "${arg_PUBLIC_LIBRARIES}" "${qt_libs_private}")
qt_autogen_tools(${target}
ENABLE_AUTOGEN_TOOLS ${arg_ENABLE_AUTOGEN_TOOLS}
DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS})
@ -1045,7 +1061,8 @@ function(add_qt_module target)
ARCHIVE_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_LIBDIR}"
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
OUTPUT_NAME "${INSTALL_CMAKE_NAMESPACE}${target}")
OUTPUT_NAME "${INSTALL_CMAKE_NAMESPACE}${target}"
)
qt_internal_library_deprecation_level(deprecation_define)
@ -1220,16 +1237,6 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
# that belong to Qt.
qt_internal_add_link_flags_no_undefined("${target}")
# When a public module depends on private, also make its private depend on the other's private
set(qt_libs_private "")
foreach(it ${QT_KNOWN_MODULES})
list(FIND arg_LIBRARIES "Qt::${it}Private" pos)
if(pos GREATER -1)
list(APPEND qt_libs_private "Qt::${it}Private")
endif()
endforeach()
target_link_libraries("${target_private}" INTERFACE "${target}" "${qt_libs_private}")
target_include_directories("${target_private}" INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}>
@ -1238,8 +1245,6 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
$<INSTALL_INTERFACE:include/${module}/${PROJECT_VERSION}/${module}>
)
qt_register_target_dependencies("${target}" "${arg_PUBLIC_LIBRARIES}" "${qt_libs_private}")
if(NOT ${arg_DISABLE_TOOLS_EXPORT})
qt_export_tools(${target})
endif()
@ -1399,6 +1404,8 @@ function(add_qt_plugin target)
set_property(TARGET "${qt_module}" APPEND PROPERTY QT_PLUGINS "${target}")
endif()
set_property(TARGET "${target}" APPEND PROPERTY EXPORT_PROPERTIES "QT_PLUGIN_CLASS_NAME;QT_MODULE")
extend_target("${target}"
SOURCES ${arg_SOURCES}
INCLUDE_DIRECTORIES

View File

@ -417,7 +417,7 @@ function(qt_feature_module_end)
set(propertyPrefix "INTERFACE_")
else()
set(propertyPrefix "")
set_target_properties("${target}" PROPERTIES EXPORT_PROPERTIES "QT_ENABLED_PUBLIC_FEATURES;QT_DISABLED_PUBLIC_FEATURES;QT_ENABLED_PRIVATE_FEATURES;QT_DISABLED_PRIVATE_FEATURES")
set_target_properties("${target}" PROPERTIES EXPORT_PROPERTIES "QT_ENABLED_PUBLIC_FEATURES;QT_DISABLED_PUBLIC_FEATURES;QT_ENABLED_PRIVATE_FEATURES;QT_DISABLED_PRIVATE_FEATURES;MODULE_PLUGIN_TYPES;QT_PLUGINS")
endif()
foreach(visibility public private)
string(TOUPPER "${visibility}" capitalVisibility)

View File

@ -21,9 +21,7 @@ foreach(_target_dep ${_third_party_deps})
list(APPEND find_package_args "COMPONENTS" ${components})
endif()
if (NOT ${pkg}_FOUND)
find_dependency(${find_package_args})
endif()
if (NOT ${pkg}_FOUND)
set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE)
@ -40,9 +38,7 @@ foreach(_target_dep ${_tool_deps})
list(GET _target_dep 0 pkg)
list(GET _target_dep 1 version)
if (NOT ${pkg}_FOUND)
find_dependency(${pkg} ${version})
endif()
if (NOT ${pkg}_FOUND)
set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE)

View File

@ -1,8 +1,48 @@
define_property(TARGET
PROPERTY
QT_PLUGINS
BRIEF_DOCS
"List of Qt plug-ins associated with a given Qt module."
FULL_DOCS
"This is a property on Qt modules.
For instance, sqlite;odbc for Sql"
)
define_property(TARGET
PROPERTY
MODULE_PLUGIN_TYPES
BRIEF_DOCS
"List of plugin categories associated to the Qt module"
FULL_DOCS
"This is a property on Qt modules.
For instance, sqldrivers for Sql."
)
define_property(TARGET
PROPERTY
QT_PLUGIN_CLASS_NAME
BRIEF_DOCS
"Class name of the Qt plug-in"
FULL_DOCS
"For instance, QICOPlugin for the qico plug-in"
"This is a property on Qt plug-ins.
For instance, QICOPlugin for the qico plug-in"
)
define_property(TARGET
PROPERTY
QT_MODULE
BRIEF_DOCS
"Qt module associated with a plug-in."
FULL_DOCS
"This is a property on Qt plug-ins.
For instance, Sql for qsqlite"
)
define_property(GLOBAL
PROPERTY
QT_KNOWN_PLUGINS
BRIEF_DOCS
""
FULL_DOCS
""
)

View File

@ -103,7 +103,6 @@ if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS)
qt_find_package(XRender PROVIDED_TARGETS PkgConfig::XRender)
endif()
#### Tests
# angle_d3d11_qdtd

View File

@ -1,16 +1,25 @@
# Generated from xcb.pro.
# begin special case:
qt_find_package(X11_XCB)
qt_find_package(X11)
qt_find_package(X11_XCB
PROVIDED_TARGETS
X11::XCB
)
qt_find_package(X11
PROVIDED_TARGETS
X11::X11
)
qt_find_package(XCB)
qt_find_package(XKB)
qt_find_package(PkgConfig)
qt_find_package(WrapFreetype)
qt_find_package(GLIB2)
qt_find_package(GLIB2
PROVIDED_TARGETS
GLIB2::GLIB2
)
qt_find_package(XRender PROVIDED_TARGETS PkgConfig::XRender)
qt_find_package(XKB_COMMON_X11 PROVIDED_TARGETS PkgConfig::XKB_COMMON_X11)
pkg_check_modules(XKB_COMMON_X11 xkbcommon-x11>=0.4.1 IMPORTED_TARGET) # special case
# end special case:
#####################################################################