-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
97 lines (81 loc) · 2.69 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
cmake_minimum_required (VERSION 3.0.0)
project (cs225a)
SET(CMAKE_CXX_FLAGS "-std=c++17 -I/usr/include -I/usr/local/include -O3")
SET(CMAKE_BUILD_TYPE "Release")
# Mac OS X global build options
if(CMAKE_SYSTEM_NAME MATCHES Darwin)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/opt/homebrew/include")
endif()
# set common dependencies
# - eigen3
set(EIGEN3_INCLUDE_DIR $ENV{EIGEN3_INCLUDE_DIR})
if(NOT EIGEN3_INCLUDE_DIR)
find_package(Eigen3 QUIET)
# TODO: Find automatic way to find for Ubuntu 14.04
if(NOT EIGEN3_INCLUDE_DIR)
set(EIGEN3_INCLUDE_DIR /usr/include/eigen3)
endif()
endif()
include_directories(${EIGEN3_INCLUDE_DIR})
# # - CHAI3D
find_package(CHAI3D REQUIRED)
include_directories(${CHAI3D_INCLUDE_DIRS})
add_definitions(${CHAI3D_DEFINITIONS})
if (CMAKE_SYSTEM_NAME MATCHES Darwin)
add_definitions(-D_MACOSX -DMACOSX)
elseif (CMAKE_SYSTEM_NAME MATCHES Linux)
add_definitions(-D_LINUX -DLINUX)
endif () #NOTE: Windows is currently unsupported
link_directories(${CHAI3D_LIBRARY_DIRS})
# - SAI2-SIMULATION
find_package(SAI2-SIMULATION REQUIRED)
include_directories(${SAI2-SIMULATION_INCLUDE_DIRS})
add_definitions(${SAI2-SIMULATION_DEFINITIONS})
# - SAI2-MODEL
FIND_PACKAGE(SAI2-MODEL REQUIRED)
include_directories(${SAI2-MODEL_INCLUDE_DIRS})
add_definitions(${SAI2-MODEL_DEFINITIONS})
# - SAI2-GRAPHICS
FIND_PACKAGE(SAI2-GRAPHICS REQUIRED)
include_directories(${SAI2-GRAPHICS_INCLUDE_DIRS})
add_definitions(${SAI2-GRAPHICS_DEFINITIONS})
# - SAI2-COMMON
find_package(SAI2-COMMON REQUIRED)
include_directories(${SAI2-COMMON_INCLUDE_DIRS})
add_definitions(${SAI2-COMMON_DEFINITIONS})
# - SAI2-URDF
find_package(SAI2-URDF REQUIRED)
include_directories(${SAI2-URDF_INCLUDE_DIRS})
add_definitions(${SAI2-URDF_DEFINITIONS})
# - SAI2-PRIMITIVES
find_package(SAI2-PRIMITIVES REQUIRED)
include_directories(${SAI2-PRIMITIVES_INCLUDE_DIRS})
add_definitions(${SAI2-PRIMITIVES_DEFINITIONS})
# - SAI2-INTERFACES
find_package(SAI2-INTERFACES REQUIRED)
include_directories(${SAI2-INTERFACES_INCLUDE_DIRS})
# - glfw3
find_package(glfw3 QUIET)
find_library(GLFW_LIBRARY glfw)
# - hiredis
find_library(HIREDIS_LIBRARY hiredis)
# Set the common libraries
set(CS225A_COMMON_LIBRARIES
${CHAI3D_LIBARIES}
${SAI2-INTERFACES_LIBRARIES}
${HIREDIS_LIBRARY}
${GLFW_LIBRARY}
${SAI2-MODEL_LIBRARIES}
${SAI2-GRAPHICS_LIBRARIES}
${SAI2-SIMULATION_LIBRARIES}
${SAI2-COMMON_LIBRARIES}
${SAI2-URDF_LIBRARIES}
${CHAI3D_LIBRARIES}
${HIREDIS_LIBRARY}
${SAI2-PRIMITIVES_LIBRARIES}
)
# set the urdf model folder
set(URDF_MODELS_FOLDER ${PROJECT_SOURCE_DIR}/urdf_models)
add_definitions(-DCS225A_URDF_FOLDER="${URDF_MODELS_FOLDER}")
set(CS225A_BINARY_DIR ${PROJECT_SOURCE_DIR}/bin)
add_subdirectory(${PROJECT_SOURCE_DIR}/src)