summaryrefslogtreecommitdiffstats
path: root/cmake/FindCoreFoundation.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:47:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:47:08 +0000
commit29b5ab554790bb57337a3b6ab9dcd963cf69d22e (patch)
treebe1456d2bc6c1fb078695fad7bc8f6b212062d3c /cmake/FindCoreFoundation.cmake
parentInitial commit. (diff)
downloadlibgit2-29b5ab554790bb57337a3b6ab9dcd963cf69d22e.tar.xz
libgit2-29b5ab554790bb57337a3b6ab9dcd963cf69d22e.zip
Adding upstream version 1.7.2+ds.upstream/1.7.2+ds
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/FindCoreFoundation.cmake')
-rw-r--r--cmake/FindCoreFoundation.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/cmake/FindCoreFoundation.cmake b/cmake/FindCoreFoundation.cmake
new file mode 100644
index 0000000..b419ec9
--- /dev/null
+++ b/cmake/FindCoreFoundation.cmake
@@ -0,0 +1,26 @@
+# Find CoreFoundation.framework
+# This will define :
+#
+# COREFOUNDATION_FOUND
+# COREFOUNDATION_LIBRARIES
+# COREFOUNDATION_LDFLAGS
+#
+
+find_path(COREFOUNDATION_INCLUDE_DIR NAMES CoreFoundation.h)
+find_library(COREFOUNDATION_LIBRARIES NAMES CoreFoundation)
+if(COREFOUNDATION_INCLUDE_DIR AND COREFOUNDATION_LIBRARIES)
+ if(NOT CoreFoundation_FIND_QUIETLY)
+ message(STATUS "Found CoreFoundation ${COREFOUNDATION_LIBRARIES}")
+ endif()
+ set(COREFOUNDATION_FOUND TRUE)
+ set(COREFOUNDATION_LDFLAGS "-framework CoreFoundation")
+endif()
+
+if(CoreFoundation_FIND_REQUIRED AND NOT COREFOUNDATION_FOUND)
+ message(FATAL_ERROR "CoreFoundation not found")
+endif()
+
+mark_as_advanced(
+ COREFOUNDATION_INCLUDE_DIR
+ COREFOUNDATION_LIBRARIES
+)