From b020179bb599fc5f269b7ad7856ce6e755d212f9 Mon Sep 17 00:00:00 2001 From: ideal Date: Mon, 4 Mar 2019 20:34:06 +0800 Subject: [PATCH] fix cmake build error on macOS: find libsodium header files --- src/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 987ddee0..c0436ad4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -86,6 +86,17 @@ set(SS_REDIR_SOURCE ${SS_PLUGIN_SOURCE} ) +if (CMAKE_SYSTEM_NAME STREQUAL Darwin) +find_path(LIBSODIUM_INCLUDE_DIR sodium.h + PATHS + $ENV{LIBSODIUM_INCLUDE_DIR} + $ENV{LIBSODIUM_DIR}/include + /usr/local/libsodium/include + /opt/libsodium/include + /usr/local/include +) +include_directories(${LIBSODIUM_INCLUDE_DIR}) +endif () if (WITH_STATIC) find_library(LIBSODIUM libsodium.a)