-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
88 lines (73 loc) · 1.82 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
cmake_minimum_required(VERSION 3.25)
project(Acacia)
# Enable cmake_print_variables() and cmake_print_properties() for debugging
include(CMakePrintHelpers)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_OBJCXX_STANDARD 17)
if(WIN32)
set(PROJECT_LANGUAGES CXX C)
else()
set(PROJECT_LANGUAGES CXX)
endif()
project(
acacia
VERSION 1.0
LANGUAGES ${PROJECT_LANGUAGES}
)
# Use absolute paths for #includes
set(BASEPATH "${CMAKE_SOURCE_DIR}")
include_directories(
"${BASEPATH}"
"${BASEPATH}/include"
)
# Feature flags
## Feature flag for cross-platform library, OFF by default
option(
ACACIA_CAT
"Build cross-platform library (experimental)"
OFF
)
## Feature flag for Python bindings, OFF by default
option(
ACACIA_PYTHON
"Build Python bindings (requires swig and python3)"
OFF
)
## Feature flag for NodeJS bindings, OFF by default
option(
ACACIA_NODEJS
"Build NodeJS bindings (requires swig and node-gyp)"
OFF
)
option(
ACACIA_DOCS
"Build documentation"
OFF
)
## Enable/disable tests, ON by default
option(
ACACIA_TESTS
"Enable tests"
ON
)
if (ACACIA_DOCS)
add_subdirectory(docs)
endif (ACACIA_DOCS)
# On windows, put all of the resulting libraries and executables in
# `build/bin/<CONFIG>` where CONFIG is Debug, Release, etc, because
# windows .dll must be in the same directory as the executables unless
# they are on the path.
# We may decide to solve this problem differently in the future, or use
# the bin for all executables across all platforms.
if(WIN32)
set(WIN_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${WIN_OUTPUT_DIRECTORY}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${WIN_OUTPUT_DIRECTORY}")
endif(WIN32)
add_subdirectory(lib)
add_subdirectory(examples)
add_subdirectory(third_party)
if (ACACIA_TESTS)
include(CTest)
add_subdirectory(tests)
endif (ACACIA_TESTS)