From e8d5b16356bd603870eb4788d06abec95427aa6e Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sat, 3 Aug 2024 15:09:39 +0200 Subject: [PATCH] Link libjpeg-turbo on iOS against prebuilt lib This needs to be fixed at some point, see #99 --- 3rdParty/CMakeLists.txt | 2 +- 3rdParty/libjpeg-turbo/CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/3rdParty/CMakeLists.txt b/3rdParty/CMakeLists.txt index d345507..976fbb5 100644 --- a/3rdParty/CMakeLists.txt +++ b/3rdParty/CMakeLists.txt @@ -22,7 +22,7 @@ add_subdirectory(rapidyaml) add_subdirectory(libarchive) add_subdirectory(boost) add_subdirectory(units) +add_subdirectory(libjpeg-turbo) if (NOT IOS) - add_subdirectory(libjpeg-turbo) add_subdirectory(curl) endif() diff --git a/3rdParty/libjpeg-turbo/CMakeLists.txt b/3rdParty/libjpeg-turbo/CMakeLists.txt index 361be53..5a87a88 100644 --- a/3rdParty/libjpeg-turbo/CMakeLists.txt +++ b/3rdParty/libjpeg-turbo/CMakeLists.txt @@ -31,6 +31,11 @@ endif () function(LinkLibJpegTurbo TARGET) + if (IOS) + target_link_libraries(${TARGET} PRIVATE "/opt/libjpeg-turbo-ios/lib/libturbojpeg.a") + target_include_directories(${TARGET} PRIVATE "/opt/libjpeg-turbo-ios/include") + return() + endif () if (libjpeg-turbo_BUILT) FindCmakeConfigDirs("${CMAKE_BINARY_DIR}/deps_ljt/INSTALL/" CMAKE_PREFIX_PATH) endif()