-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
43 lines (31 loc) · 1.2 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
cmake_minimum_required(VERSION 3.25)
project(LuaWebSocket
VERSION 1.0
DESCRIPTION "Lua requirable DLL, which wraps websocketpp in a simple to use websocket class."
LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_SHARED_LIBRARY_PREFIX "")
add_subdirectory(modules)
# LuaWebSocket library
add_library(${PROJECT_NAME} SHARED
src/LuaWebSocket/LuaWebSocket.cpp
src/LuaWebSocket/WebSocket.cpp
src/LuaWebSocket/WebSocket.h
src/LuaWebSocket/LUAWS.h
)
target_include_directories(${PROJECT_NAME} PUBLIC src/LuaWebSocket)
target_link_libraries(${PROJECT_NAME} PUBLIC lua::lua websocketpp::websocketpp)
target_compile_definitions(${PROJECT_NAME} PRIVATE LUAWS_EXPORTS)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/install
RUNTIME DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/install/bin)
# LuaWebSocket tests
if(${BUILD_TESTING})
include(CTest)
find_package(OpenSSL REQUIRED)
add_executable(LuaWebSocketTests
tests/LuaWebSocketTests/test.cpp
)
target_link_libraries(LuaWebSocketTests PRIVATE OpenSSL::SSL LuaWebSocket Catch2::Catch2WithMain)
catch_discover_tests(LuaWebSocketTests)
endif()