Move apple framework linking into a reusable function
This commit is contained in:
29
cmake/AppleHelper.cmake
Normal file
29
cmake/AppleHelper.cmake
Normal file
@@ -0,0 +1,29 @@
|
||||
function(LinkAppleFrameworks TARGET)
|
||||
target_link_libraries(${TARGET}
|
||||
PUBLIC "-framework CoreFoundation"
|
||||
PUBLIC "-framework Foundation"
|
||||
PUBLIC "-framework CoreImage"
|
||||
PUBLIC "-framework CoreVideo"
|
||||
PUBLIC "-framework Metal"
|
||||
PUBLIC "-framework MetalPerformanceShaders"
|
||||
PUBLIC "-framework ARKit"
|
||||
PUBLIC "-lstdc++"
|
||||
PUBLIC c++
|
||||
PUBLIC c
|
||||
)
|
||||
|
||||
|
||||
# Locate system libraries on iOS
|
||||
find_library(UIKIT UIKit)
|
||||
find_library(FOUNDATION Foundation)
|
||||
find_library(MOBILECORESERVICES MobileCoreServices)
|
||||
find_library(CFNETWORK CFNetwork)
|
||||
find_library(SYSTEMCONFIGURATION SystemConfiguration)
|
||||
|
||||
# link the frameworks located above
|
||||
target_link_libraries(${TARGET} PUBLIC ${UIKIT})
|
||||
target_link_libraries(${TARGET} PUBLIC ${FOUNDATION})
|
||||
target_link_libraries(${TARGET} PUBLIC ${MOBILECORESERVICES})
|
||||
target_link_libraries(${TARGET} PUBLIC ${CFNETWORK})
|
||||
target_link_libraries(${TARGET} PUBLIC ${SYSTEMCONFIGURATION})
|
||||
endfunction()
|
||||
Reference in New Issue
Block a user