summaryrefslogtreecommitdiffstats
path: root/fluent-bit/cmake/macos-setup.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:19:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:20:02 +0000
commit58daab21cd043e1dc37024a7f99b396788372918 (patch)
tree96771e43bb69f7c1c2b0b4f7374cb74d7866d0cb /fluent-bit/cmake/macos-setup.cmake
parentReleasing debian version 1.43.2-1. (diff)
downloadnetdata-58daab21cd043e1dc37024a7f99b396788372918.tar.xz
netdata-58daab21cd043e1dc37024a7f99b396788372918.zip
Merging upstream version 1.44.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fluent-bit/cmake/macos-setup.cmake')
-rw-r--r--fluent-bit/cmake/macos-setup.cmake31
1 files changed, 31 insertions, 0 deletions
diff --git a/fluent-bit/cmake/macos-setup.cmake b/fluent-bit/cmake/macos-setup.cmake
new file mode 100644
index 000000000..58681f572
--- /dev/null
+++ b/fluent-bit/cmake/macos-setup.cmake
@@ -0,0 +1,31 @@
+execute_process(
+ COMMAND brew --prefix
+ RESULT_VARIABLE HOMEBREW
+ OUTPUT_VARIABLE HOMEBREW_PREFIX
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wundef-prefix=TARGET_OS_ ")
+
+if (HOMEBREW EQUAL 0 AND EXISTS "${HOMEBREW_PREFIX}")
+ message(STATUS "Found Homebrew at ${HOMEBREW_PREFIX}")
+ include(cmake/homebrew.cmake)
+endif()
+
+# Create rootcert on macOS
+set(MACOS_ROOT_CERT ${CMAKE_CURRENT_BINARY_DIR}/certs/rootcert.pem)
+execute_process(
+ COMMAND security find-certificate -a -p /Library/Keychains/System.keychain
+ RESULT_VARIABLE SECURITY_SYSTEM_RESULT
+ OUTPUT_VARIABLE SECURITY_SYSTEM_CERTS
+ ) # Don't strip trailing a white space and newline in the end of exported certificate.
+file(WRITE ${MACOS_ROOT_CERT} ${SECURITY_SYSTEM_CERTS})
+
+execute_process(
+ COMMAND security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain
+ RESULT_VARIABLE SECURITY_ROOT_RESULT
+ OUTPUT_VARIABLE SECURITY_ROOT_CERTS
+ ) # Don't strip trailing a white space and newline in the end of exported certificate.
+file(APPEND ${MACOS_ROOT_CERT} ${SECURITY_ROOT_CERTS})
+
+install(FILES ${MACOS_ROOT_CERT} COMPONENT binary DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/certs)