-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
48 lines (36 loc) · 1.24 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
cmake_minimum_required(VERSION 3.18)
project(BillyEngine LANGUAGES CXX C VERSION 0.0.1)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
option(COMPILE_DEMO "Compile the demo program" ON)
option(BUILD_SHARED_LIBS "Build a shaded library" ON)
option(BUNDLE_DEPENDENCIES "Bundle all the dependencies in the same dll" ON)
option(SYSTEM_DEPENDENCIES "Use system dependencies instead of downloading and building them" OFF)
option(GENERATE_BINDINGS "Generate bindings using swig" ON)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(CompilerFlags)
include(GeneratorSetup)
file(GLOB_RECURSE SRC src/*.cpp src/*.hpp include/*.h include/*.hpp)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_library(
${PROJECT_NAME}_objs
OBJECT
${SRC} ${BE_GENERATED_FILES}
)
set_compiler_flags(${PROJECT_NAME}_objs)
add_library(${PROJECT_NAME} $<TARGET_OBJECTS:${PROJECT_NAME}_objs>)
set_compiler_flags(${PROJECT_NAME})
target_include_directories(
${PROJECT_NAME}_objs
PRIVATE include include/BillyEngine ${PROJECT_BINARY_DIR}
)
target_include_directories(
${PROJECT_NAME}
PUBLIC include
)
include(SWIG)
include(Dependencies)
if(COMPILE_DEMO)
add_subdirectory(Demo)
endif()