1 cmake_minimum_required(VERSION 3.20.2)
4 find_package(OpenSSL 3 REQUIRED)
8 set(LINK_VERSION_MINOR 0)
9 set(LINK_VERSION_PATCH 0)
10 set(LINK_VERSION_EXTRA "devel")
12 set(VERSION ${LINK_VERSION}.${LINK_VERSION_MINOR}.${LINK_VERSION_PATCH}-${LINK_VERSION_EXTRA})
15 file(GLOB_RECURSE SOURCES Source/*.cpp)
16 file(GLOB_RECURSE INCLUDES Include/*)
18 include_directories(Include)
20 add_library(link SHARED ${SOURCES})
21 set_target_properties(link PROPERTIES
22 PUBLIC_HEADER ${INCLUDES})
24 set_target_properties(link PROPERTIES
26 SOVERSION ${LINK_VERSION})
28 target_compile_features(link PUBLIC cxx_std_17)
29 set (CMAKE_CXX_FLAGS "-std=c++17")
31 target_include_directories(link PUBLIC Include)
32 target_link_libraries(link PUBLIC OpenSSL::SSL z)
36 LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
37 PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
40 file(GLOB_RECURSE TEST_SOURCES Test/*.cpp)
42 add_executable(linktest ${TEST_SOURCES})
43 target_link_libraries(linktest PRIVATE link)
47 add_test(NAME test COMMAND $<TARGET_FILE:linktest>)