From d71eed325c7317996686fd58c0ee9156d9391207 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 25 Jun 2023 12:42:34 +0200 Subject: [PATCH] appkit vs uikit detection --- client/CMakeLists.txt | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 156959ba5..8759c00f3 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -381,13 +381,21 @@ if (APPLE) message(STATUS "Apple device detected.") set(ADDITIONAL_SRC ${PM3_ROOT}/client/src/util_darwin.h ${PM3_ROOT}/client/src/util_darwin.m ${ADDITIONAL_SRC}) - if (EXISTS /private/var/mobile) - message(STATUS "iOS detected.") + find_library(UIKIT_LIBRARY UIKit) + if (NOT UIKIT_LIBRARY) + message(STATUS "UIKit.framework NOT found!") + else() + message(STATUS "UIKit.framework found! ${UIKIT_LIBRARY}") set(ADDITIONAL_LNK "-framework Foundation" "-framework UIKit") - else (EXISTS /private/var/mobile) - message(STATUS "macOS detected.") - set(ADDITIONAL_LNK "-framework Foundation" "-framework AppKit") - endif (EXISTS /private/var/mobile) + endif() + + find_library(APPKIT_LIBRARY AppKit) + if (NOT APPKIT_LIBRARY) + message(STATUS "AppKit.framework NOT found!") + else() + message(STATUS "AppKit.framework found! ${APPKIT_LIBRARY}") + set(ADDITIONAL_LNK "-framework Foundation" "-framework AppKit") + endif() endif (APPLE)