-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
179 lines (152 loc) · 5.25 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
cmake_minimum_required(VERSION 2.8.3)
project(game)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
option(BUILD_TESTING "Enable tests" OFF)
option(BUILD_EXAMPLES "Build examples" ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -ftemplate-depth-1200 -Wno-switch -Wno-deprecated-declarations -Wno-int-to-pointer-cast")
# find_package(PythonLibs 2.7.6 REQUIRED)
find_package(PythonLibs 3.5.2 REQUIRED)
find_package(Ceres REQUIRED)
find_package(benchmark REQUIRED)
find_package(OpenMP QUIET)
if(OPENMP_FOUND)
MESSAGE("-- Building with OpenMP.")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
include_directories(
include
third_party/Adept/include
third_party/pybind11/include/
third_party/vahlen/include/
third_party/hep-ga/include/
${PYTHON_INCLUDE_DIRS}
${EIGEN_INCLUDE_DIRS}
${CERES_INCLUDE_DIRS}
${BENCHMARK_INCLUDE_DIR}
)
if (BUILD_EXAMPLES)
message("-- Build the examples.")
add_subdirectory(examples)
else (BUILD_EXAMPLES)
message("-- Do not build any example.")
endif (BUILD_EXAMPLES)
add_library(adept SHARED
third_party/Adept/adept/adept.cpp
third_party/Adept/adept/adept_openmp.cpp
)
# add_executable(benchmark
# src/benchmark.cpp
# )
# target_link_libraries(benchmark
# adept
# pthread
# ${CERES_LIBRARIES}
# ${BENCHMARK_LIBRARY}
# )
add_library(cylinder_estimation SHARED
src/cylinder_estimation.cpp
)
target_link_libraries(cylinder_estimation
${PYTHON_LIBRARIES}
${CERES_LIBRARIES})
set_target_properties(cylinder_estimation PROPERTIES PREFIX "")
set_target_properties(cylinder_estimation PROPERTIES SUFFIX ".so")
add_library(motor_estimation SHARED
src/motor_estimation.cpp
)
target_link_libraries(motor_estimation
adept
${PYTHON_LIBRARIES}
${CERES_LIBRARIES}
)
set_target_properties(motor_estimation PROPERTIES PREFIX "")
set_target_properties(motor_estimation PROPERTIES SUFFIX ".so")
add_library(motor_jacobian SHARED
src/motor_local_parameterization_jacobian_py.cpp
)
target_link_libraries(motor_jacobian
${PYTHON_LIBRARIES}
${CERES_LIBRARIES}
)
set_target_properties(motor_jacobian PROPERTIES PREFIX "")
set_target_properties(motor_jacobian PROPERTIES SUFFIX ".so")
add_library(motor_estimation_valkenburg_dorst SHARED
src/motor_estimation_valkenburg_dorst.cpp
src/vsr/cga_op.cpp
src/vsr/cga_round.cpp
)
target_link_libraries(motor_estimation_valkenburg_dorst
${PYTHON_LIBRARIES}
${CERES_LIBRARIES}
)
set_target_properties(motor_estimation_valkenburg_dorst PROPERTIES PREFIX "")
set_target_properties(motor_estimation_valkenburg_dorst PROPERTIES SUFFIX ".so")
add_library(autodiff_multivector SHARED
src/autodiff_multivector.cpp)
target_link_libraries(autodiff_multivector
adept
${PYTHON_LIBRARIES}
${CERES_LIBRARIES}
)
set_target_properties(autodiff_multivector PROPERTIES PREFIX "")
set_target_properties(autodiff_multivector PROPERTIES SUFFIX ".so")
add_library(hyperdual SHARED
src/test_hyperdual_hessian.cpp)
target_link_libraries(hyperdual
${PYTHON_LIBRARIES}
)
set_target_properties(hyperdual PROPERTIES PREFIX "")
set_target_properties(hyperdual PROPERTIES SUFFIX ".so")
add_library(hyperdual_lines SHARED
src/hyperdual_lines.cpp)
target_link_libraries(hyperdual_lines
${PYTHON_LIBRARIES}
)
set_target_properties(hyperdual_lines PROPERTIES PREFIX "")
set_target_properties(hyperdual_lines PROPERTIES SUFFIX ".so")
add_library(versor_pybind11 SHARED
src/vsr/versor_pybind11.cpp
src/vsr/versor_vector_pybind11.cpp
src/vsr/versor_bivector_pybind11.cpp
src/vsr/versor_rotor_pybind11.cpp
src/vsr/versor_point_pybind11.cpp
src/vsr/versor_dual_line_pybind11.cpp
src/vsr/versor_line_pybind11.cpp
src/vsr/versor_translator_pybind11.cpp
src/vsr/versor_motor_pybind11.cpp
src/vsr/versor_origin_pybind11.cpp
src/vsr/versor_infinity_pybind11.cpp
src/vsr/versor_direction_vector_pybind11.cpp
src/vsr/versor_direction_bivector_pybind11.cpp
src/vsr/versor_dual_plane_pybind11.cpp
src/vsr/versor_plane_pybind11.cpp
src/vsr/versor_general_rotor_pybind11.cpp
src/vsr/versor_tangent_vector_pybind11.cpp
src/vsr/versor_circle_pybind11.cpp
src/vsr/versor_sphere_pybind11.cpp
src/vsr/versor_point_pair_pybind11.cpp
src/vsr/versor_trivector_pybind11.cpp
src/vsr/versor_diff_pybind11.cpp
src/vsr/versor_reciprocal_motor_pybind11.cpp
src/vsr/versor_euclidean_geometric_algebra_pybind11.cpp
src/vsr/versor_conformal_geometric_algebra_pybind11.cpp
src/vsr/versor_e4_pybind11.cpp
src/vsr/cga_op.cpp
src/vsr/cga_round.cpp
)
target_link_libraries(versor_pybind11 ${PYTHON_LIBRARIES})
set_target_properties(versor_pybind11 PROPERTIES PREFIX "")
set_target_properties(versor_pybind11 PROPERTIES SUFFIX ".so")
add_library(linear_solver SHARED src/linear_solver.cpp)
target_link_libraries(linear_solver ${PYTHON_LIBRARIES})
set_target_properties(linear_solver PROPERTIES PREFIX "")
set_target_properties(linear_solver PROPERTIES SUFFIX ".so")
if (BUILD_TESTING)
message("-- Build the tests.")
add_subdirectory(test)
else (BUILD_TESTING)
message("-- Do not build any test.")
endif (BUILD_TESTING)