-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
68 lines (50 loc) · 1.55 KB
/
CMakeLists.txt
File metadata and controls
68 lines (50 loc) · 1.55 KB
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
65
66
67
cmake_minimum_required(VERSION 3.26.3)
if (WIN32)
cmake_policy(SET CMP0167 NEW)
endif()
project(advanced_server_beast)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED On)
# Find Boost libraries
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
# if(GCC)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -std=c++14")
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
# endif()
# file (GLOB APP_FILES
# main2.cpp
# beast.hpp
# http_session.cpp
# http_session.hpp
# listener.cpp
# listener.hpp
# net.hpp
# shared_state.cpp
# shared_state.hpp
# websocket_session.cpp
# websocket_session.hpp
# )
# Add executable
add_executable(simpleHttpServer-boost-beast main.cpp)
add_executable(advance_server_example_beast advance_server_beast_example.cpp)
# Link libraries
if(WIN32)
add_definitions(-D_WIN32_WINNT=0x0A00)
target_link_libraries(simpleHttpServer-boost-beast ws2_32 mswsock ${Boost_LIBRARIES} )
else()
target_link_libraries(simpleHttpServer-boost-beast ${Boost_LIBRARIES})
endif()
set(SOURCE_EXTERNAL_FILES
index.html
)
set(DEST_DIR ${CMAKE_BINARY_DIR})
# foreach(FILE ${SOURCE_EXTERNAL_FILES})
# endforeach()
add_custom_command(
TARGET simpleHttpServer-boost-beast POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/index.html
${CMAKE_BINARY_DIR}/index.html
COMMENT "Copying index.html to build dir"
)