-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
66 lines (52 loc) · 1.46 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
65
66
cmake_minimum_required(VERSION 3.4)
# This CMake file describes the private (compiled) implementation of PyPlayground.
# It outputs a '_pyplayground.xxx' lib that's imported via the Python implementation.
# See the 'src_py' tree for more info.
project(_pyplayground)
# C++ 17 standard.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Add our pybind11 lib.
add_subdirectory(lib/pybind11)
# Include SDL2.
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIR})
# Include cpp source files.
include_directories("${CMAKE_SOURCE_DIR}/src_cpp/")
set(SRC_CPP_WRAPPER src_cpp/wrapper.cpp)
set(SRC_CPP_CORE
src_cpp/core/playground_base.h
src_cpp/core/playground_base.cpp
src_cpp/core/playground_exception.h
src_cpp/core/playground_exception.cpp
src_cpp/core/color.h
src_cpp/core/color.cpp
)
set(SRC_CPP_DISPLAY
src_cpp/display/window.h
src_cpp/display/window.cpp
)
set(SRC_CPP_RENDER
src_cpp/render/renderer.h
src_cpp/render/renderer.cpp
src_cpp/render/container.h
src_cpp/render/container.cpp
)
set(SRC_CPP_TASK
src_cpp/task/task_manager.h
src_cpp/task/task_manager.cpp
src_cpp/task/task.h
src_cpp/task/task.cpp
)
# All cpp source files.
set(SOURCE_CPP
${SRC_CPP_WRAPPER}
${SRC_CPP_CORE}
${SRC_CPP_DISPLAY}
${SRC_CPP_RENDER}
${SRC_CPP_TASK}
)
# Generate Python bindings for our source files.
pybind11_add_module(_pyplayground ${SOURCE_CPP})
# Link libs.
target_link_libraries(_pyplayground PRIVATE ${SDL2_LIBRARIES})