From 3ef14c8943746673ffc6be62bca1f990b604a092 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 25 Jun 2020 16:43:39 +0200 Subject: 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 --- cmake/QtBuild.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cmake') 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 "$") list(APPEND lib_defines "$") 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() -- cgit v1.2.3