-
Notifications
You must be signed in to change notification settings - Fork 15
/
CMakeLists.txt
55 lines (41 loc) · 1.4 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
cmake_minimum_required(VERSION 3.12)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
message(FATAL_ERROR "X86 architecture is not supported!")
endif()
project(HavokLib VERSION 1)
find_package(Python3 COMPONENTS Development Interpreter)
# ~~~
# Valid targets:
# - havok-static: static library target (HK_STATIC_LIB == ON, force enables havok-objects target)
# - havok-objects: static objects target (enabled by default, set NO_OBJECTS to disable all)
# - havok: shared library target (BUILD_SHARED_LIBS == ON)
# ~~~
option(PYTHON_MODULE "Build a module for Python 3 (enables OBJECTS_PID)." ON)
option(TOOLSET "Build toolset." ON)
option(ODR_TEST "Enable ODR testing." OFF)
if(NOT Python3_FOUND AND PYTHON_MODULE)
message(FATAL_ERROR "Python3 not found.")
endif()
option(OBJECTS_PID "Imply PID for all objects." ${PYTHON_MODULE})
option(HK_STATIC_LIB "Builds havok-static target." OFF)
set(BUILD_SHARED_LIBS ${TOOLSET})
option(NO_OBJECTS "" OFF)
option(CLI "" ${TOOLSET})
option(GLTF "" ${TOOLSET})
set(CMAKE_CXX_STANDARD 20)
add_compile_options(-Wall -Wextra)
set(TPD_PATH ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party)
add_subdirectory(${TPD_PATH}/spike)
include(targetex)
add_subdirectory(classgen)
add_subdirectory(source)
if(TOOLSET)
add_subdirectory(toolset)
endif()
if(PYTHON_MODULE)
add_subdirectory(python)
endif()
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
enable_testing()
add_subdirectory(test)
endif()