forked from MarcToussaint/rai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
131 lines (106 loc) · 3.19 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
cmake_minimum_required(VERSION 3.4)
project(RAI)
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ version selection")
option(USE_PYBIND "build python bindings" ON)
option(USE_BULLET "link to bullet" OFF)
option(USE_OPENCV "link to opencv" OFF)
add_compile_options(
-O3 -g -Wall -fPIC -std=c++14 -Wno-terminate -Wno-pragmas
)
################################################################################
add_definitions(
-DRAI_ROOT_PATH=\"${CMAKE_SOURCE_DIR}/rai\"
-DRAI_X11 -DRAI_LAPACK -DRAI_EIGEN -DRAI_PTHREAD
-DRAI_GL
-DRAI_GLFW -DRAI_ANN -DRAI_QHULL -DRAI_ASSIMP -DNO_CYCLE_DETECTION -DRAI_PNG -DRAI_PLY
-DRAI_SWIFT -DRAI_GJK -DRAI_FCL -DRAI_CCD
)
################################################################################
include_directories(
rai
/usr/include/eigen3
$ENV{HOME}/opt/include
)
# link_directories(
# $ENV{HOME}/opt/lib
# )
file(GLOB SRC_Core rai/Core/*.cpp)
file(GLOB SRC_Optim rai/Optim/*.cpp)
file(GLOB SRC_Geo rai/Geo/*.cpp)
file(GLOB SRC_GeoGJK rai/Geo/GJK/*.c)
file(GLOB SRC_GeoPly rai/Geo/ply/*.c)
file(GLOB SRC_Algo rai/Algo/*.cpp)
file(GLOB SRC_Plot rai/Plot/*.cpp)
file(GLOB SRC_Gui rai/Gui/*.cpp)
file(GLOB SRC_Kin rai/Kin/*.cpp)
file(GLOB SRC_KinSwift rai/Kin/SWIFT/*.cpp)
file(GLOB SRC_KOMO rai/KOMO/*.cpp)
file(GLOB SRC_Logic rai/Logic/*.cpp)
file(GLOB SRC_LGP rai/LGP/*.cpp)
file(GLOB SRC_RosCom rai/RosCom/*.cpp)
file(GLOB SRC_Perception rai/Perception/*.cpp)
file(GLOB SRC_Control rai/Control/*.cpp)
file(GLOB SRC_Operate rai/Operate/*.cpp)
file(GLOB SRC_ry rai/ry/*.cpp)
add_library(rai SHARED
${SRC_Core}
${SRC_Optim}
${SRC_Geo}
${SRC_GeoGJK}
${SRC_GeoPly}
${SRC_Algo}
${SRC_Plot}
${SRC_Gui}
${SRC_Kin}
${SRC_KinSwift}
${SRC_KOMO}
${SRC_Logic}
${SRC_LGP}
#${SRC_RosCom}
${SRC_Perception}
${SRC_Control}
#${SRC_Operate}
)
target_link_libraries(rai
jsoncpp lapack blas pthread rt X11
assimp /usr/lib/x86_64-linux-gnu/libfcl.so
ann glfw GLEW glut GLU GL png qhull
)
################################################################################
if(USE_BULLET)
find_package(PkgConfig)
pkg_check_modules(BULLET bullet REQUIRED)
add_definitions(-DRAI_BULLET)
include_directories(${BULLET_INCLUDE_DIRS})
target_link_libraries(rai ${BULLET_LIBRARIES})
endif()
if(USE_OPENCV)
find_package(OpenCV REQUIRED)
add_definitions(-DRAI_OPENCV)
target_link_libraries(rai ${OpenCV_LIBS})
endif()
if(USE_REALSENSE)
add_definitions(-DRAI_REALSENSE)
target_link_libraries(rai realsense2)
endif()
################################################################################
if(USE_PYBIND)
set(PYTHON_EXECUTABLE "python3")
execute_process(
COMMAND bash "-c" "python3 -m pybind11 --cmakedir"
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE pybind11_DIR
)
find_package(pybind11)
add_definitions(-DRAI_PYBIND)
pybind11_add_module(libry SHARED
${SRC_ry}
)
target_link_libraries(libry PRIVATE
rai
)
endif()
################################################################################
# add_executable(kinEdit rai/bin/src_kinEdit/main.cpp)
# target_link_libraries(kinEdit rai)
# add_executable(cppQuadcopterExample cpp/cppQuadcopterExample.cpp)
# target_link_libraries(cppQuadcopterExample rai)