diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-06-25 16:43:39 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-06-26 22:14:24 +0200 |
commit | 3ef14c8943746673ffc6be62bca1f990b604a092 (patch) | |
tree | ed172bfc9ba5c9b71c9f068fea9a682a6f86e8d6 /cmake | |
parent | 167741717ffd7e82cd127b1671b990cd03a8096c (diff) |
CMake: Fix framework handling for .pri files
Rather than embedding the full absolute path to the framework, we
should instead write a -framework Foo flag.
qmake seems to do this by specifying QMAKE_LIBS_FOO in the mkspec.
We'll try to get away with just deriving the name of the framework
from the path, to avoid having to introduce a mkspec equivalent
mapping for CMake.
This doesn't currently handle framework include paths, which qmake
also handled by harcoding QMAKE_INCDIR_FOO in the mkspec, and then
sysrootifying it via mkspecs/common/mac/sdk.prf.
Hopefully that's not really needed, given that -framework flag
should imply include paths as well.
Somewhat partially amends c254254c55b24dd0653331e025cdfdbbdcca2a56
Task-number: QTBUG-85240
Task-number: QTBUG-84781
Change-Id: I70ea5021422d7b1f5afa9c4a595d1a9b8a8217d3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index d99b2145c2..0a4cfed66d 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -656,7 +656,11 @@ function(qt_generate_qmake_libraries_pri_content module_name output_root_dir out list(APPEND lib_incdir "$<TARGET_PROPERTY:${lib_target},INTERFACE_INCLUDE_DIRECTORIES>") list(APPEND lib_defines "$<TARGET_PROPERTY:${lib_target},INTERFACE_COMPILE_DEFINITIONS>") else() - list(APPEND lib_libs "${lib_target}") + if(lib_target MATCHES "/([^/]+).framework$") + list(APPEND lib_libs "-framework" "${CMAKE_MATCH_1}") + else() + list(APPEND lib_libs "${lib_target}") + endif() endif() endwhile() |