Fix build of installed header-only modules in non-prefix builds

QtUiTools in qttools is a public module that has only headers, so it's
an interface library in cmake. That means INTERFACE_INCLUDE_DIRECTORIES
cannot contain paths to the source or build directory, unless they are
prefixed with BUILD_INTERFACE, which this patch adds.

Change-Id: I047700f447237dfbe5a901072eb413a159ae537d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Simon Hausmann 2019-09-05 15:22:14 +02:00
parent b2a11daaa1
commit bc54f0b164

View File

@ -1305,8 +1305,8 @@ function(add_qt_module target)
endif()
set(private_includes
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
${arg_INCLUDE_DIRECTORIES}
)
@ -1316,8 +1316,8 @@ function(add_qt_module target)
# from another module.
if(NOT arg_NO_SYNC_QT)
list(APPEND private_includes
"${module_include_dir}/${PROJECT_VERSION}"
"${module_include_dir}/${PROJECT_VERSION}/${module}")
"$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}>"
"$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}/${module}>")
list(APPEND public_includes
# For the syncqt headers