-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
64 lines (49 loc) · 1.49 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(wsudo)
set(wsudo_VERSION_MAJOR 0)
set(wsudo_VERSION_MINOR 1)
set(wsudo_VERSION_PATCH 0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(WSUDO_BUILD_TESTS "Build tests" ON)
if(MSVC)
add_compile_options(-diagnostics:caret)
endif()
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/$<CONFIG>")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
find_package(spdlog CONFIG REQUIRED)
find_package(fmt CONFIG REQUIRED)
set(COMMON_SRC
common.cpp
events.cpp
overlapped.cpp
winsupport.cpp
)
list(TRANSFORM COMMON_SRC PREPEND "lib/common/")
set(CLIENT_SRC
main.cpp
)
list(TRANSFORM CLIENT_SRC PREPEND "lib/client/")
set(SERVER_SRC
clientconnection.cpp
main.cpp
namedpipehandlefactory.cpp
server.cpp
session.cpp
)
list(TRANSFORM SERVER_SRC PREPEND "lib/server/")
include_directories(${PROJECT_SOURCE_DIR}/include)
link_libraries(spdlog::spdlog fmt::fmt-header-only)
add_library(wsudo_common STATIC ${COMMON_SRC})
add_library(wsudo_client STATIC ${CLIENT_SRC})
add_library(wsudo_server STATIC ${SERVER_SRC})
add_executable(wsudo lib/client/main.cpp)
add_executable(TokenServer lib/server/main.cpp)
target_link_libraries(wsudo wsudo_client wsudo_common)
target_link_libraries(TokenServer wsudo_server wsudo_common)
if(WSUDO_BUILD_TESTS)
add_subdirectory(test)
endif()