aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/CMakeLists.txt19
-rw-r--r--src/test/CMakeLists.txt2
2 files changed, 19 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b0b704d1..db8ee2db 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -45,7 +45,24 @@ find_package(Config++ REQUIRED)
# Introduce OpenSSL
if (APPLE)
- set(OPENSSL_ROOT_DIR /usr/local/opt/openssl@3)
+ # Define possible OpenSSL directories
+ set(OPENSSL_DIR_CANDIDATES
+ /usr/local/opt/openssl@3
+ /opt/homebrew/opt/openssl@3
+ )
+
+ # Find the valid OpenSSL directory
+ foreach(DIR IN LISTS OPENSSL_DIR_CANDIDATES)
+ if(IS_DIRECTORY "${DIR}" OR EXISTS "${DIR}")
+ set(OPENSSL_ROOT_DIR "${DIR}")
+ break() # Stop loop once a valid directory is found
+ endif()
+ endforeach()
+
+ # If not found, throw an error or warning
+ if(NOT OPENSSL_ROOT_DIR)
+ message(FATAL_ERROR "OpenSSL not found in the standard directories. Please install it or set OPENSSL_ROOT_DIR manually.")
+ endif()
endif()
find_package(OpenSSL REQUIRED)
diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt
index 1eb710be..2c99c5d3 100644
--- a/src/test/CMakeLists.txt
+++ b/src/test/CMakeLists.txt
@@ -40,7 +40,7 @@ target_link_libraries(gpgfrontend_test PRIVATE gpgfrontend_core)
target_link_libraries(gpgfrontend_test PRIVATE spdlog)
if (APPLE)
- target_link_libraries(gpgfrontend_test intl)
+ target_link_libraries(gpgfrontend_test PRIVATE intl)
endif ()
add_test(AllTestsInGpgFrontend gpgfrontend_test)