diff options
author | Mikhail Svetkin <mikhail.svetkin@qt.io> | 2018-11-06 00:08:03 +0100 |
---|---|---|
committer | Mikhail Svetkin <mikhail.svetkin@qt.io> | 2018-11-06 14:32:48 +0000 |
commit | 1dd5acf9aa2b1c9e1efbbacc67c5aa94f3483fd4 (patch) | |
tree | ef16a801918e94428c172d4195e582701337e319 /cmake/QtBuild.cmake | |
parent | 806595c5b6c9fc3bfc3bc843ddd1a4b126d6a426 (diff) |
CMake: Fix import of features while generating CMakeLists
extend_target does not import public and private features.
For example:
Qt::CorePrivate matches as ('CorePrivate'), but it should be ('Core', 'Private')
Change-Id: I99144d42b7e0a8f7c4501d3e0eaf04b270c6b4d6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index a0985918c1..ef4caa27de 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -435,17 +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)?$") - set(depTarget ${CMAKE_MATCH_1}) + if("${dep}" MATCHES "^Qt::((.+)(Private)|(.+))$") + if (${CMAKE_MATCH_COUNT} EQUAL 3) + set(depTarget ${CMAKE_MATCH_2}) + else() + set(depTarget ${CMAKE_MATCH_4}) + endif() # 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") + if("x${CMAKE_MATCH_3}" STREQUAL "xPrivate") qt_pull_features_into_current_scope(PRIVATE_FEATURES ${depTarget}) endif() qt_pull_features_into_current_scope(PUBLIC_FEATURES ${depTarget}) |