-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
executable file
·121 lines (110 loc) · 2.96 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
cmake_minimum_required(VERSION 2.8)
project(pl)
message(STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
message(STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}")
message(STATUS "CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}")
# CMAKE extensions
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${pl_SOURCE_DIR}/cmake")
# Required packages
find_package(OpenGL REQUIRED)
find_package(Epoxy REQUIRED)
find_package(SDL2 REQUIRED)
# Warning pedantic flags for all
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Werror -Wpedantic -Wfatal-errors -O3 ${CMAKE_CXX_FLAGS}")
# Dependencies and include locations
include_directories("include")
include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${EPOXY_INCLUDE_DIRS})
include_directories(${SDL2_INCLUDE_DIR})
## Build Executable
# Add source files
set(sources
"src/plAutomaticPlanner"
"src/plBoundary"
"src/plBoundaryEditor"
"src/plBufferObject"
"src/plCamera"
"src/plColorMap"
"src/plCSV"
"src/plDefectSite"
"src/plDonorSite"
"src/plEABO"
"src/plEditable"
"src/plEditor"
"src/plFBO"
"src/plGraft"
"src/plGraftCap"
"src/plGraftEditor"
"src/plLog"
"src/plMath"
"src/plMatrix44"
"src/plMatrixStack"
"src/plMesh"
"src/plMeshCutter"
"src/plMeshSpecific"
"src/plMinimalTechnique"
"src/plModel"
"src/plModelEditor"
"src/plOctree"
"src/plOctreeMesh"
"src/plOpenGLInfo"
"src/plOutlineTechnique"
"src/plPicking"
"src/plPlan"
"src/plPlannerShader"
"src/plPlannerStage0"
"src/plPlannerStage1"
"src/plPlannerStage2"
"src/plPlannerStage3"
"src/plPlanningBufferData"
"src/plPlanningSite"
"src/plPlanTechnique"
"src/plPlug"
"src/plPolygon"
"src/plProgress"
"src/plProjection"
"src/plRenderComponent"
"src/plRenderResources"
"src/plRenderShapes"
"src/plRenderTechnique"
"src/plRenderable"
"src/plRenderer"
"src/plRenderingPipeline"
"src/plScreenQuadTechnique"
"src/plShader"
"src/plSpline"
"src/plSSBO"
"src/plSTL"
"src/plString"
"src/plTexture2D"
"src/plTimer"
"src/plTransform"
"src/plTransparencyTechnique"
"src/plTransparentRenderable"
"src/plTriangle"
"src/plUniform"
"src/plVAO"
"src/plVBO"
"src/plVector3"
"src/plVector4"
"src/plVertexFragmentShader"
"src/plVertexSpecBuffer"
"src/plWindow"
"src/main")
# Construct the executable
add_executable(planner ${sources})
# Link the executable to libraries
target_link_libraries(planner
${OPENGL_LIBRARIES}
${EPOXY_LIBRARIES}
${SDL2_LIBRARY})
# Additional target to perform clang-format, requires clang-format
file(GLOB_RECURSE all_sources include/*.h src/*.cpp)
add_custom_target(fmt
COMMAND clang-format -style=WebKit -i ${all_sources})
# Copy resource dir to build
file(COPY
${CMAKE_CURRENT_SOURCE_DIR}/resources/
DESTINATION
${CMAKE_CURRENT_BINARY_DIR}/resources/)