This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
90 lines (76 loc) · 3.37 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
89
90
#=============================================================================#
# Project setup.
#=============================================================================#
project(athena)
cmake_minimum_required(VERSION 3.5)
cmake_policy(SET CMP0054 NEW)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# We do not support Apple, so disable it from the get-go.
if (APPLE)
message(FATAL_ERROR "Athena only supports Windows and Linux.")
endif()
# Any compile-time options go here.
option(ATHENA_BUILD_DOCS "Build marching rings documentation" ON)
option(ATHENA_PARALLEL "Enable parallelization using TBB" ON)
option(ATHENA_GUI "Enable GUI for polygonizer" ON)
# Set the version data.
set(ATHENA_VERSION_MAJOR "0")
set(ATHENA_VERSION_MINOR "0")
set(ATHENA_VERSION_PATCH "0")
set(ATHENA_VERSION_EXTRA "")
set(ATHENA_VERSION "${ATHENA_VERSION_MAJOR}.${ATHENA_VERSION_MINOR}")
set(ATHENA_VERSION_FULL
"${ATHENA_VERSION}.${ATHENA_VERSION_PATCH}${ATHENA_VERSION_EXTRA}")
#=============================================================================#
# Directory Variables.
#=============================================================================#
set(ATHENA_SOURCE_DIR "${PROJECT_SOURCE_DIR}")
set(ATHENA_INCLUDE_ROOT "${ATHENA_SOURCE_DIR}/include")
set(ATHENA_SOURCE_ROOT "${ATHENA_SOURCE_DIR}/source")
set(ATHENA_SHADER_ROOT "${ATHENA_SOURCE_DIR}/shader")
set(ATHENA_DOCS_ROOT "${ATHENA_SOURCE_DIR}/docs")
set(ATHENA_CONFIG_ROOT "${ATHENA_SOURCE_DIR}/config")
set(ATHENA_ATLAS_ROOT "${ATHENA_SOURCE_DIR}/lib/atlas")
#=============================================================================#
# Compilation settings.
#=============================================================================#
include("${ATHENA_CONFIG_ROOT}/Compiler.cmake")
include("${ATHENA_CONFIG_ROOT}/Externals.cmake")
#=============================================================================#
# Generate files.
#=============================================================================#
if (ATHENA_BUILD_DOCS)
configure_file("${ATHENA_DOCS_ROOT}/Doxyfile.in"
"${ATHENA_BINARY_DIR}/docs/Doxyfile" @ONLY)
endif()
#=============================================================================#
# Subdirectories.
#=============================================================================#
add_subdirectory("${ATHENA_ATLAS_ROOT}")
add_subdirectory("${ATHENA_INCLUDE_ROOT}/athena")
add_subdirectory("${ATHENA_SOURCE_ROOT}")
add_subdirectory("${ATHENA_SHADER_ROOT}")
if (DOXYGEN_FOUND AND ATHENA_BUILD_DOCS)
add_subdirectory("${ATHENA_DOCS_ROOT}")
endif()
#=============================================================================#
# Include directories.
#=============================================================================#
include_directories(
${ATLAS_INCLUDE_DIRS}
${ATHENA_INCLUDE_ROOT}
${ATHENA_SHADER_ROOT}
)
#=============================================================================#
# Executable.
#=============================================================================#
include("${ATHENA_CONFIG_ROOT}/SourceGroups.cmake")
add_executable(athena ${ATHENA_SOURCE_LIST} ${ATHENA_INCLUDE_LIST}
${ATHENA_SHADER_LIST})
# Only link with TBB if we are using a parallel build.
if (ATHENA_PARALLEL)
target_link_libraries(athena tbb ${ATLAS_LIBRARIES})
else()
target_link_libraries(athena ${ATLAS_LIBRARIES})
endif()
set_target_properties(athena PROPERTIES FOLDER "athena")