mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-06 07:44:57 +03:00
Merge PR #581: src: split CMakeLists.txt for each subdirectory
This commit is contained in:
42
src/Mayaqua/CMakeLists.txt
Normal file
42
src/Mayaqua/CMakeLists.txt
Normal file
@ -0,0 +1,42 @@
|
||||
file(GLOB SOURCES_MAYAQUA "*.c")
|
||||
file(GLOB HEADERS_MAYAQUA "*.h")
|
||||
|
||||
add_library(mayaqua STATIC ${SOURCES_MAYAQUA} ${HEADERS_MAYAQUA})
|
||||
|
||||
target_include_directories(mayaqua PUBLIC .)
|
||||
|
||||
set_target_properties(mayaqua
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Mayaqua"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/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)
|
||||
|
||||
# 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})
|
||||
|
||||
if(LIB_ICONV)
|
||||
target_link_libraries(mayaqua ${LIB_ICONV})
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
|
||||
target_link_libraries(mayaqua nsl socket)
|
||||
endif()
|
Reference in New Issue
Block a user