2021-07-07 09:11:08 +03:00
|
|
|
file(GLOB SOURCES_MAYAQUA "*.c" "Crypto/*.c")
|
|
|
|
file(GLOB HEADERS_MAYAQUA "*.h" "Crypto/*.h")
|
2018-07-26 07:44:19 +03:00
|
|
|
|
2018-10-24 20:23:07 +03:00
|
|
|
if(WIN32)
|
|
|
|
add_library(mayaqua STATIC ${SOURCES_MAYAQUA} ${HEADERS_MAYAQUA})
|
|
|
|
else()
|
|
|
|
add_library(mayaqua SHARED ${SOURCES_MAYAQUA} ${HEADERS_MAYAQUA})
|
|
|
|
endif()
|
2018-07-26 07:44:19 +03:00
|
|
|
|
|
|
|
target_include_directories(mayaqua PUBLIC .)
|
|
|
|
|
|
|
|
set_target_properties(mayaqua
|
|
|
|
PROPERTIES
|
2018-10-20 14:12:49 +03:00
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
2018-07-26 07:44:19 +03:00
|
|
|
)
|
|
|
|
|
2020-07-27 22:32:50 +03:00
|
|
|
find_package(OpenSSL REQUIRED)
|
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
|
2021-04-05 05:48:25 +03:00
|
|
|
# Required because we include <openssl/opensslv.h> in Encrypt.h.
|
|
|
|
target_include_directories(mayaqua PUBLIC ${OPENSSL_INCLUDE_DIR})
|
|
|
|
|
2021-05-26 08:44:45 +03:00
|
|
|
target_link_libraries(mayaqua
|
|
|
|
PRIVATE
|
|
|
|
libhamcore
|
|
|
|
OpenSSL::SSL
|
|
|
|
OpenSSL::Crypto
|
|
|
|
ZLIB::ZLIB
|
|
|
|
)
|
2020-07-27 22:32:50 +03:00
|
|
|
|
2018-10-24 20:23:07 +03:00
|
|
|
if(WIN32)
|
2018-11-18 06:18:42 +03:00
|
|
|
set_target_properties(mayaqua
|
|
|
|
PROPERTIES
|
|
|
|
COMPILE_PDB_NAME "mayaqua"
|
|
|
|
COMPILE_PDB_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
|
|
|
)
|
2021-02-28 22:32:25 +03:00
|
|
|
|
2021-04-03 03:25:19 +03:00
|
|
|
target_link_libraries(mayaqua
|
|
|
|
PRIVATE
|
|
|
|
"DbgHelp.Lib"
|
|
|
|
"dwmapi.lib"
|
|
|
|
"iphlpapi.lib"
|
|
|
|
"newdev.lib"
|
|
|
|
"Psapi.Lib"
|
|
|
|
"Secur32.Lib"
|
|
|
|
"setupapi.lib"
|
|
|
|
"winmm.lib"
|
|
|
|
"WtsApi32.Lib"
|
|
|
|
)
|
2018-10-11 23:03:12 +03:00
|
|
|
endif()
|
|
|
|
|
2018-10-24 20:23:07 +03:00
|
|
|
if(UNIX)
|
|
|
|
find_package(Threads REQUIRED)
|
2018-07-26 07:44:19 +03:00
|
|
|
|
2018-10-24 20:23:07 +03:00
|
|
|
# In some cases libiconv is not included in libc
|
|
|
|
find_library(LIB_ICONV iconv)
|
2018-07-26 07:44:19 +03:00
|
|
|
|
2021-07-02 10:24:41 +03:00
|
|
|
find_library(LIB_M m)
|
2018-10-24 20:23:07 +03:00
|
|
|
find_library(LIB_RT rt)
|
2018-10-20 14:12:49 +03:00
|
|
|
|
2021-07-02 10:24:41 +03:00
|
|
|
target_link_libraries(mayaqua
|
|
|
|
PRIVATE
|
|
|
|
Threads::Threads
|
|
|
|
$<$<BOOL:${LIB_ICONV}>:${LIB_ICONV}>
|
|
|
|
$<$<BOOL:${LIB_M}>:${LIB_M}>
|
|
|
|
$<$<BOOL:${LIB_RT}>:${LIB_RT}>
|
|
|
|
)
|
2018-10-24 20:23:07 +03:00
|
|
|
|
2020-03-16 12:21:40 +03:00
|
|
|
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7l|aarch64|s390x)$" OR NOT HAVE_SYS_AUXV OR SKIP_CPU_FEATURES)
|
2019-02-03 16:05:34 +03:00
|
|
|
add_definitions(-DSKIP_CPU_FEATURES)
|
|
|
|
else()
|
2018-10-24 20:23:07 +03:00
|
|
|
add_subdirectory(3rdparty/cpu_features)
|
|
|
|
set_property(TARGET cpu_features PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
|
|
target_link_libraries(mayaqua PRIVATE cpu_features)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
|
|
|
|
target_link_libraries(mayaqua PRIVATE nsl socket)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
install(TARGETS mayaqua
|
|
|
|
COMPONENT "common"
|
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
|
|
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
|
|
|
)
|
|
|
|
endif()
|