1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-06 07:44:57 +03:00

cmake: lib cleanup and use cmake package_find

* use OPENSSL_ROOT_DIR
* add special .configure handling for osx
* move readline, curses to cedar

Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
This commit is contained in:
Andy Walsh
2018-07-31 11:49:55 +02:00
parent ce5ee2b070
commit 0bbf08fea7
6 changed files with 19 additions and 19 deletions

View File

@ -12,26 +12,14 @@ set_target_properties(mayaqua
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Mayaqua"
)
find_package(Threads)
find_library(LIB_READLINE readline)
find_library(LIB_NCURSES ncurses)
find_library(LIB_Z z)
find_package(OpenSSL REQUIRED)
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
# In some cases libiconv is not included in libc
find_library(LIB_ICONV iconv)
# This is required in order to link to the correct OpenSSL library
find_library(LIB_SSL
NAMES ssl
HINTS "/usr/local/opt/openssl/lib"
)
find_library(LIB_CRYPTO
NAMES crypto
HINTS "/usr/local/opt/openssl/lib"
)
target_link_libraries(mayaqua ${CMAKE_THREAD_LIBS_INIT} ${LIB_SSL} ${LIB_CRYPTO} ${LIB_READLINE} ${LIB_NCURSES} ${LIB_Z})
target_link_libraries(mayaqua OpenSSL::SSL OpenSSL::Crypto Threads::Threads ZLIB::ZLIB)
if(LIB_ICONV)
target_link_libraries(mayaqua ${LIB_ICONV})