[KDE/Mac] OSX/CI: okular fails to build on branch frameworks

Marko Käning mk-lists at email.de
Sat Apr 11 20:45:31 UTC 2015


Hi René,

On 11 Apr 2015, at 22:39 , René J.V. Bertin <rjvbertin at gmail.com> wrote:
> -framework CoreFoundation -framework CoreGraphics
> 
> to the library list of the failing target.

I have used this:
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 56c9976..5a76ea4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -182,10 +182,14 @@ generate_export_header(okularcore BASE_NAME okularcore)
 # Special handling for linking okularcore on OSX/Apple
 IF(APPLE)
     SET(OKULAR_IOKIT "-framework IOKit" CACHE STRING "Apple IOKit framework")
+    SET(OKULAR_CF "-framework CoreFoundation" CACHE STRING "Apple CoreFoundation framework")
+    SET(OKULAR_CG "-framework CoreGraphics" CACHE STRING "Apple CoreGraphics framework")
 ENDIF(APPLE)
 
 target_link_libraries(okularcore
     ${OKULAR_IOKIT}
+    ${OKULAR_CF}
+    ${OKULAR_CG}
     KF5::Archive
     KF5::JS
     KF5::JSApi

---
Why on earth are those SET() statements needed here?
Yet, it seems to work...


...but now I end up with two other link failures:
---
Linking CXX shared library libokularplugin.dylib
ld: can't link with bundle (MH_BUNDLE) only dylibs (MH_DYLIB) file '../../okularpart.so' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [active/components/libokularplugin.dylib] Error 1
make[1]: *** [active/components/CMakeFiles/okularplugin.dir/all] Error 2
2 warnings generated.
Linking CXX executable mainshelltest
ld: can't link with bundle (MH_BUNDLE) only dylibs (MH_DYLIB) file '../okularpart.so' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [autotests/mainshelltest] Error 1
make[1]: *** [autotests/CMakeFiles/mainshelltest.dir/all] Error 2
make: *** [all] Error 2

KDE Continuous Integration Build
== Building Project: okular - Branch frameworks
---

Looks like clang is not happy about the *.so’s.

How can that be fixed?

Greets,
Marko



More information about the kde-mac mailing list