-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
109 lines (86 loc) · 3.91 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
PROJECT(reference_car)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
MESSAGE(STATUS "Compiling Reference Car Localization + Navigation")
MESSAGE(STATUS "Using compiler: ${CMAKE_CXX_COMPILER}")
MESSAGE(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
MESSAGE(STATUS "Arch: ${CMAKE_SYSTEM_PROCESSOR}")
set(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_FLAGS "-std=c++17 -Wall -Werror")
IF(${CMAKE_BUILD_TYPE} MATCHES "Release")
MESSAGE(STATUS "Additional Flags for Release mode")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -O2 -DNDEBUG")
ELSEIF(${CMAKE_BUILD_TYPE} MATCHES "Debug")
MESSAGE(STATUS "Additional Flags for Debug mode")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -g")
ENDIF()
INCLUDE($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
ROSBUILD_INIT()
SET(ROS_BUILD_STATIC_LIBS true)
SET(ROS_BUILD_SHARED_LIBS false)
MESSAGE(STATUS "ROS-Overrride Build Type: ${CMAKE_BUILD_TYPE}")
MESSAGE(STATUS "CXX Flags: ${CMAKE_CXX_FLAGS}")
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
ADD_LIBRARY(shared_library
src/visualization/visualization.cc
src/vector_map/vector_map.cc
src/navigation/global_planner.cc)
ADD_SUBDIRECTORY(src/shared)
INCLUDE_DIRECTORIES(src/shared)
INCLUDE_DIRECTORIES(src)
add_subdirectory(thirdparty/xtl)
add_subdirectory(thirdparty/xtensor)
add_subdirectory(thirdparty/xtensor-blas)
add_subdirectory(thirdparty/xsimd)
INCLUDE_DIRECTORIES(thirdparty/xtl/include)
INCLUDE_DIRECTORIES(thirdparty/xtensor/include/)
INCLUDE_DIRECTORIES(thirdparty/xtensor-blas/include)
INCLUDE_DIRECTORIES(thirdparty/xsimd)
find_package(OpenCV REQUIRED)
add_definitions(-DHAVE_CBLAS=1)
if (WIN32)
find_package(OpenBLAS REQUIRED)
set(BLAS_LIBRARIES ${CMAKE_INSTALL_PREFIX}${OpenBLAS_LIBRARIES})
else()
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
endif()
message(STATUS "BLAS VENDOR: " ${BLA_VENDOR})
message(STATUS "BLAS LIBRARIES: " ${BLAS_LIBRARIES})
SET(libs roslib roscpp rosbag glog gflags amrl-shared-lib boost_system lua5.1
pthread xtensor xtensor-blas xsimd ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${OpenCV_LIBS})
ROSBUILD_ADD_EXECUTABLE(slam
src/slam/rasterizer.cpp
src/slam/slam_main.cc
src/slam/slam.cc)
TARGET_LINK_LIBRARIES(slam shared_library ${libs})
ROSBUILD_ADD_EXECUTABLE(planning
src/adaptive_workspace_bias_planning/planning_main.cc
src/adaptive_workspace_bias_planning/planning.cc
)
TARGET_LINK_LIBRARIES(planning shared_library ${libs})
ROSBUILD_ADD_EXECUTABLE(particle_filter
src/particle_filter/particle_filter_main.cc
src/particle_filter/particle_filter.cc
src/particle_filter/observation_model.cpp
)
TARGET_LINK_LIBRARIES(particle_filter shared_library ${libs})
ROSBUILD_ADD_EXECUTABLE(navigation
src/navigation/navigation_main.cc
src/navigation/navigation.cc
src/navigation/plotpublisher.cpp
src/navigation/clock.cpp
src/navigation/pointcloud.cpp
src/navigation/collisionplanner.cpp
src/navigation/state_estimator.cc
src/navigation/global_planner.cc
)
TARGET_LINK_LIBRARIES(navigation shared_library ${libs} )
target_include_directories(navigation PUBLIC
${xtensor_INCLUDE_DIRS}/xtensor ${xsimd_INCLUDE_DIRS}/xsimd ${xtensor-blas_INCLUDE_DIRS}/xtensor-blas)
target_include_directories(particle_filter PUBLIC
${xtensor_INCLUDE_DIRS}/xtensor ${xsimd_INCLUDE_DIRS}/xsimd ${xtensor-blas_INCLUDE_DIRS}/xtensor-blas)
target_include_directories(slam PUBLIC
${xtensor_INCLUDE_DIRS}/xtensor ${xsimd_INCLUDE_DIRS}/xsimd ${xtensor-blas_INCLUDE_DIRS}/xtensor-blas ${OpenCV_INCLUDE_DIRS})
ADD_EXECUTABLE(eigen_tutorial
src/eigen_tutorial.cc)