Don't add private module headers for private modules when not needed

If a module has the NO_MODULE_HEADERS option, we should not add
the private module header paths to the BUILD_INTERFACE of private
modules.

This fixes building static non-prefix qtdeclarative builds on Linux,
where non-existent QtXcbQpa headers failed the qtdeclarative
generation step.

Change-Id: Ic9fdd8c5688d3449576eb8a5dd852c252e29bf5b
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexandru Croitor 2020-02-06 13:04:45 +01:00
parent b14ee53a08
commit b06f086460

View File

@ -1949,12 +1949,13 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
# Handle cases like QmlDevTools which do not have their own headers, but rather borrow them
# from another module.
if(NOT arg_NO_SYNC_QT)
list(APPEND interface_includes
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
"$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}>"
"$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}/${module}>")
list(APPEND interface_includes "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
if(NOT arg_NO_MODULE_HEADERS)
list(APPEND interface_includes
"$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}>"
"$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}/${module}>")
if(is_framework)
set(fw_headers_dir
"${INSTALL_LIBDIR}/${module}.framework/Headers/")