Fix link on MacOS
Needs RevisionPublic

Authored by darcyshen on Nov 20 2018, 3:47 PM.

Details

Reviewers
rjvbb
aacid
Group Reviewers
Okular
Summary

CoreGraphics, CoreFoundation, IOKit are required.

Test Plan

Tested using Homebrew on MacOS.

See https://github.com/KDE-mac/homebrew-kde/pull/270

Diff Detail

Repository
R223 Okular
Lint
Lint Skipped
Unit
Unit Tests Skipped
darcyshen created this revision.Nov 20 2018, 3:47 PM
darcyshen created this object with edit policy "Administrators".
Restricted Application added a project: Okular. · View Herald TranscriptNov 20 2018, 3:47 PM
Restricted Application added a subscriber: okular-devel. · View Herald Transcript
darcyshen requested review of this revision.Nov 20 2018, 3:47 PM
darcyshen added a reviewer: Okular.

@rjvbb what do you say? makes sense?

rjvbb requested changes to this revision.Nov 21 2018, 12:15 AM

@rjvbb what do you say? makes sense?

Yes, this is required. I've got a bunch of patches for Okular I never got around to sub/committing.
The patch as proposed is OK as a packaging patch, but requires some polishing before it's fit for upstreaming. You can take inspiration from my version of this patch:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -216,7 +216,7 @@ generate_export_header(okularcore BASE_NAME okularcore EXPORT_FILE_NAME "${CMAKE
 
 # Special handling for linking okularcore on OSX/Apple
 IF(APPLE)
-    SET(OKULAR_IOKIT "-framework IOKit" CACHE STRING "Apple IOKit framework")
+    SET(OKULAR_APPLE_FRAMEWORKS "-framework IOKit -framework CoreGraphics -framework CoreFoundation" CACHE STRING "required Apple frameworks")
 ENDIF(APPLE)
 
 # Extra library needed by imported synctex code on Windows
@@ -226,7 +226,7 @@ endif(WIN32)
 
 target_link_libraries(okularcore
 PRIVATE
-    ${OKULAR_IOKIT}
+    ${OKULAR_APPLE_FRAMEWORKS}
     ${SHLWAPI}
     KF5::Archive
     KF5::JS
This revision now requires changes to proceed.Nov 21 2018, 12:15 AM
darcyshen updated this revision to Diff 48352.Dec 29 2018, 2:58 PM

Update the framework name from IOKIT to APPLE_FRAMEWORKS

darcyshen edited the summary of this revision. (Show Details)Dec 29 2018, 3:00 PM
aacid requested changes to this revision.Feb 21 2020, 6:55 PM

Please move as a Merge Request in https://invent.kde.org/kde/okular

We have pre-commit CI and lots of checks including clazy and clang-tidy there so it's a much better place for doing the review/approval/merge of the code.

This revision now requires changes to proceed.Feb 21 2020, 6:55 PM