-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
61 lines (51 loc) · 1.56 KB
/
Copy pathCMakeLists.txt
File metadata and controls
61 lines (51 loc) · 1.56 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
cmake_minimum_required(VERSION 3.16)
project(engine LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
include(FetchContent)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11.git
GIT_TAG v2.11.1
)
FetchContent_Declare(
asio
GIT_REPOSITORY https://github.com/chriskohlhoff/asio.git
GIT_TAG asio-1-36-0
SOURCE_SUBDIR asio/include
)
FetchContent_Declare(
msgpack-c
GIT_REPOSITORY https://github.com/msgpack/msgpack-c.git
GIT_TAG a0b2ec09da4bd823e40fa591221713951d4ec995
SOURCE_SUBDIR include
)
FetchContent_MakeAvailable(pybind11)
FetchContent_MakeAvailable(asio)
FetchContent_MakeAvailable(msgpack-c)
set(ASIO_INCLUDE_DIR ${asio_SOURCE_DIR}/asio/include)
set(MSGPACK_INCLUDE_DIR ${msgpack-c_SOURCE_DIR}/include)
# Add your source files
add_executable(${PROJECT_NAME}
engine/main.cpp
engine/server.cpp
engine/handler.cpp
)
target_compile_definitions(${PROJECT_NAME} PRIVATE
ASIO_STANDALONE # Use standalone ASIO (no BOOST)
ASIO_NO_DEPRECATED # Disable deprecated features
MSGPACK_NO_BOOST
)
# Set the include directories
target_include_directories(${PROJECT_NAME} PRIVATE
${ASIO_INCLUDE_DIR}
${MSGPACK_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/engine/include
)
# Link the libraries
target_link_libraries(${PROJECT_NAME} PRIVATE
pybind11::embed
Python3::Python
)