summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Michaël Celerier <jeanmichael.celerier@gmail.com>2019-06-05 10:08:44 +0200
committerJean-Michaël Celerier <jean-michael.celerier@kdab.com>2019-06-05 08:53:34 +0000
commitfecd9d90daa22b33c40a709da21cef62bfa44a15 (patch)
tree864943309ab14b3c4422cd3195ab25857d01742b
parentc220974ed8c6c972d43f535afa7b1bbcb1ccc5e2 (diff)
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>
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/FindATSPI2.cmake3
-rw-r--r--cmake/FindGTK3.cmake4
-rw-r--r--cmake/FindTslib.cmake4
-rw-r--r--cmake/FindXKB_COMMON_X11.cmake7
-rw-r--r--cmake/QtBuild.cmake35
-rw-r--r--cmake/QtFeature.cmake2
-rw-r--r--cmake/QtModuleDependencies.cmake.in8
-rw-r--r--cmake/QtProperties.cmake42
-rw-r--r--src/gui/configure.cmake1
-rw-r--r--src/plugins/platforms/xcb/CMakeLists.txt17
11 files changed, 97 insertions, 28 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d70beff2e9..8344d22c0d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.14.0)
+cmake_minimum_required(VERSION 3.15.0)
project(QtBase
VERSION 5.14.0
diff --git a/cmake/FindATSPI2.cmake b/cmake/FindATSPI2.cmake
index 4e1ade0d07..87e3838ee9 100644
--- a/cmake/FindATSPI2.cmake
+++ b/cmake/FindATSPI2.cmake
@@ -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()
diff --git a/cmake/FindGTK3.cmake b/cmake/FindGTK3.cmake
index f4476c167b..9423eb4b9b 100644
--- a/cmake/FindGTK3.cmake
+++ b/cmake/FindGTK3.cmake
@@ -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()
diff --git a/cmake/FindTslib.cmake b/cmake/FindTslib.cmake
index 979291a5f6..3c50116d0a 100644
--- a/cmake/FindTslib.cmake
+++ b/cmake/FindTslib.cmake
@@ -1,3 +1,7 @@
find_package(PkgConfig)
pkg_check_modules(Tslib tslib IMPORTED_TARGET)
+
+if (NOT TARGET PkgConfig::Tslib)
+ set(Tslib_FOUND 0)
+endif()
diff --git a/cmake/FindXKB_COMMON_X11.cmake b/cmake/FindXKB_COMMON_X11.cmake
new file mode 100644
index 0000000000..61b4ba82e7
--- /dev/null
+++ b/cmake/FindXKB_COMMON_X11.cmake
@@ -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()
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index bd18d48beb..85ee030822 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -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
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake
index c7e4764751..758605c05a 100644
--- a/cmake/QtFeature.cmake
+++ b/cmake/QtFeature.cmake
@@ -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)
diff --git a/cmake/QtModuleDependencies.cmake.in b/cmake/QtModuleDependencies.cmake.in
index f94ba22d9e..5d9164bd11 100644
--- a/cmake/QtModuleDependencies.cmake.in
+++ b/cmake/QtModuleDependencies.cmake.in
@@ -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()
+ find_dependency(${find_package_args})
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()
+ find_dependency(${pkg} ${version})
if (NOT ${pkg}_FOUND)
set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE)
diff --git a/cmake/QtProperties.cmake b/cmake/QtProperties.cmake
index f2bb2c5c59..b0621e7b46 100644
--- a/cmake/QtProperties.cmake
+++ b/cmake/QtProperties.cmake
@@ -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
+ ""
)
diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake
index 71c3bb15c1..58f34239e4 100644
--- a/src/gui/configure.cmake
+++ b/src/gui/configure.cmake
@@ -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
diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt
index 2d5dbbef1d..9f94791550 100644
--- a/src/plugins/platforms/xcb/CMakeLists.txt
+++ b/src/plugins/platforms/xcb/CMakeLists.txt
@@ -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:
#####################################################################