diff options
author | Tobias Hunger <tobias.hunger@gmail.com> | 2018-11-02 12:11:19 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2018-11-05 15:44:43 +0000 |
commit | cda5d06bd83141bef1b3caa10413d39598814b26 (patch) | |
tree | 26b8d01896b300c931c6084122ea9e1f0f2df735 /cmake/QtBuild.cmake | |
parent | b7b4af575f119ddabe0f7f3e8c075306b347dda3 (diff) |
CMake: Fix import of features
Make sure the features of Qt libraries are available when linking to that
library via the add_qt_* functions.
This was broken for any library that did not end with "Privat" or
"Private".
Change-Id: Iff0ad441b601e0d131b0e30f2069110806410297
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 3a4f2fbc9c..a0985918c1 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -435,20 +435,20 @@ function(extend_target target) qt_internal_process_automatic_sources("${target}" "${_arg_SOURCES}") foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES}) - if("${dep}" MATCHES "Qt::(.+)(Private?)") + if("${dep}" MATCHES "^Qt::(.+)(Private)?$") set(depTarget ${CMAKE_MATCH_1}) # Fetch features from dependencies and make them available to the # caller as well as to the local scope for configure.cmake evaluation. + if(NOT TARGET "${dep}") + find_package(Qt${PROJECT_VERSION_MAJOR}${depTarget} REQUIRED) + endif() + if("x${CMAKE_MATCH_2}" STREQUAL "xPrivate") qt_pull_features_into_current_scope(PRIVATE_FEATURES ${depTarget}) endif() qt_pull_features_into_current_scope(PUBLIC_FEATURES ${depTarget}) - if(TARGET "${dep}") - continue() - endif() - find_package(Qt${PROJECT_VERSION_MAJOR}${depTarget} REQUIRED) endif() endforeach() @@ -856,7 +856,7 @@ function(add_qt_test name) "${CMAKE_CURRENT_BINARY_DIR}" "${_arg_INCLUDE_DIRECTORIES}" DEFINES "${_arg_DEFINES}" - LIBRARIES "Qt::Core;Qt::Test;${_arg_LIBRARIES}" + LIBRARIES Qt::Core Qt::Test ${_arg_LIBRARIES} ) add_test(NAME "${name}" COMMAND "${name}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") |