-
Notifications
You must be signed in to change notification settings - Fork 25
/
CMakeLists.txt
136 lines (110 loc) · 3.17 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
####################################
cmake_minimum_required(VERSION 2.6)
project(curvislice)
add_subdirectory(libs/SolverWrapper)
add_subdirectory(libs/LibSL-small)
INCLUDE_DIRECTORIES(
${PROJECT_SOURCE_DIR}/libs/tclap/include/
${PROJECT_SOURCE_DIR}/libs/SolverWrapper/include/
${PROJECT_SOURCE_DIR}/libs/SolverWrapper/src/
${PROJECT_SOURCE_DIR}/libs/LibSL-small/src/
${PROJECT_SOURCE_DIR}/libs/LibSL-small/src/LibSL/
)
SET(LibSL_small
libs/LibSL-small/src/LibSL/System/System.cpp
libs/LibSL-small/src/LibSL/CppHelpers/CppHelpers.cpp
libs/LibSL-small/src/LibSL/StlHelpers/StlHelpers.cpp
libs/LibSL-small/src/LibSL/Image/Image.cpp
libs/LibSL-small/src/LibSL/Math/Vertex.cpp
libs/LibSL-small/src/LibSL/Math/Math.cpp
libs/LibSL-small/src/LibSL/Mesh/Mesh.cpp
libs/LibSL-small/src/LibSL/Mesh/MeshFormat_stl.cpp
libs/LibSL-small/src/LibSL/Mesh/VertexFormat_dynamic.cpp
)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
####################################
ADD_EXECUTABLE(curvislice_osqp
src/main.cpp
src/gcode.h
src/gcode.cpp
src/helpers.h
src/TetMesh.h
src/TetMesh.cpp
src/thicknesses.h
src/MeshFormat_msh.h
src/MeshFormat_msh.cpp
${LibSL_small}
)
INSTALL(
TARGETS curvislice_osqp
RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/bin
)
INSTALL(FILES ${CMAKE_BINARY_DIR}/libs/SolverWrapper/lib/osqp/out/libosqp.dll DESTINATION ${CMAKE_SOURCE_DIR}/bin)
set_target_properties(curvislice_osqp
PROPERTIES
CXX_STANDARD 17
CXX_EXTENSIONS OFF
)
target_link_libraries(curvislice_osqp SolverWrapper)
target_compile_options(curvislice_osqp PRIVATE -DOSQP)
####################################
if (BUILD_WITH_GRB)
ADD_EXECUTABLE(curvislice_grb
src/main.cpp
src/gcode.h
src/gcode.cpp
src/helpers.h
src/TetMesh.h
src/TetMesh.cpp
src/thicknesses.h
src/MeshFormat_msh.h
src/MeshFormat_msh.cpp
)
INSTALL(
TARGETS curvislice_grb
RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/bin
)
set_target_properties(curvislice_grb
PROPERTIES
CXX_STANDARD 17
CXX_EXTENSIONS OFF
)
target_link_libraries(curvislice_grb SolverWrapper)
target_compile_options(curvislice_grb PRIVATE -DGRB)
target_compile_definitions(curvislice_grb PUBLIC "-DHAS_GUROBI")
endif(BUILD_WITH_GRB)
####################################
ADD_EXECUTABLE(uncurve
src/uncurve.cpp
src/gcode.h
src/gcode.cpp
src/TetMesh.h
src/TetMesh.cpp
src/thicknesses.h
src/MeshFormat_msh.h
src/MeshFormat_msh.cpp
${LibSL_small}
)
INSTALL(
TARGETS uncurve
RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/bin
)
set_target_properties(uncurve
PROPERTIES
CXX_STANDARD 17
CXX_EXTENSIONS OFF
)
target_link_libraries(uncurve SolverWrapper)
if(BUILD_WITH_GRB)
target_compile_options(uncurve PRIVATE -DGRB)
else(BUILD_WITH_GRB)
target_compile_options(uncurve PRIVATE -DOSQP)
endif(BUILD_WITH_GRB)
####################################
if(WIN32)
if (BUILD_WITH_GRB)
target_link_libraries(curvislice_grb shlwapi)
endif(BUILD_WITH_GRB)
target_link_libraries(curvislice_osqp shlwapi)
target_link_libraries(uncurve shlwapi)
endif(WIN32)