summaryrefslogtreecommitdiffstats
path: root/cmake/Qt3rdPartyLibraryHelpers.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-02-22 16:57:00 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-02-23 15:17:42 +0100
commit56abd7e4e0ac4a382df01575446138809d031da5 (patch)
tree0d07aa860e215234b9861ba3f776ea575a389528 /cmake/Qt3rdPartyLibraryHelpers.cmake
parent2f6faca901442631299af0c0d15b3edf257f225b (diff)
CMake: Fix exclusion of QtFoo in QtBarDepends for 3rd party libs
When configuring a static Qt with the -qt-zlib option and the build system creates a 3rd party header module QtZlib, syncqt does not generate a QtZlib header file that would include all its public headers. Then when the QtSvgDepends header is generated, it would add an #include <QtZlib> which would break compilation of the QtSvg PCH file (which compiles QtSvgDepends). We have logic to exclude addition of headers from regular 3rd party static libraries, but not header only 3rd party libraries. Adjust the code to handle header-only 3rd party libraries, as well as make sure it works across repos by exporting the relevant properties. As a drive-by, also rename and export some other informational properties. Amends af00402d6446c0f8f085a2a482fc83c4318aa457 Amends 6fdeaea24f9035ad53ba2548a9467b3264cf01ad Amends be2745e4788cecb0d3122081e3328e4b66923609 Pick-to: 6.2 6.3 Change-Id: I087f50b193dd845e4a5ec906e8851d63122faf80 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'cmake/Qt3rdPartyLibraryHelpers.cmake')
-rw-r--r--cmake/Qt3rdPartyLibraryHelpers.cmake18
1 files changed, 16 insertions, 2 deletions
diff --git a/cmake/Qt3rdPartyLibraryHelpers.cmake b/cmake/Qt3rdPartyLibraryHelpers.cmake
index 904f81fb76..d562024ca3 100644
--- a/cmake/Qt3rdPartyLibraryHelpers.cmake
+++ b/cmake/Qt3rdPartyLibraryHelpers.cmake
@@ -181,9 +181,14 @@ function(qt_internal_add_3rdparty_library target)
ARCHIVE_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_LIBDIR}"
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
- QT_MODULE_IS_3RDPARTY_LIBRARY TRUE
- QT_MODULE_SKIP_DEPENDS_INCLUDE TRUE
+ _qt_module_is_3rdparty_library TRUE
+ _qt_module_skip_depends_include TRUE
)
+ set_property(TARGET "${target}"
+ APPEND PROPERTY EXPORT_PROPERTIES _qt_module_is_3rdparty_library)
+ set_property(TARGET "${target}"
+ APPEND PROPERTY EXPORT_PROPERTIES _qt_module_skip_depends_include)
+
qt_handle_multi_config_output_dirs("${target}")
set_target_properties(${target} PROPERTIES
@@ -335,4 +340,13 @@ function(qt_internal_add_3rdparty_header_module target)
EXTERNAL_HEADERS ${arg_EXTERNAL_HEADERS}
EXTERNAL_HEADERS_DIR ${arg_EXTERNAL_HEADERS_DIR}
)
+
+ set_target_properties(${target} PROPERTIES
+ _qt_module_is_3rdparty_header_library TRUE
+ _qt_module_skip_depends_include TRUE
+ )
+ set_property(TARGET "${target}"
+ APPEND PROPERTY EXPORT_PROPERTIES _qt_module_is_3rdparty_header_library)
+ set_property(TARGET "${target}"
+ APPEND PROPERTY EXPORT_PROPERTIES _qt_module_skip_depends_include)
endfunction()