-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
63 lines (48 loc) · 1.44 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
cmake_minimum_required(VERSION 3.0.2)
project(tailored_mpc)
#add_compile_options(-std=c++0x)
set(CMAKE_CXX_FLAGS "-fpermissive -fopenmp -std=c++11")
set(CMAKE_BUILD_TYPE "Release")
message(STATUS "TAILORED MPC says hi :)")
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
dynamic_reconfigure
visualization_msgs
as_msgs
)
find_package(Eigen3 REQUIRED)
find_package(OpenMP REQUIRED)
if(OPENMP_FOUND)
message(STATUS "OPENMP FOUND")
set(OpenMP_FLAGS ${OpenMP_CXX_FLAGS})
set(OpenMP_LIBS gomp)
else()
message(WARNING "OPENMP NOT FOUND, multithread isn't available")
endif()
find_library(FORCESPRO_LIBRARY libTailoredSolver.a PATHS ${PROJECT_SOURCE_DIR}/solver/codeGen/TailoredSolver/lib_target)
generate_dynamic_reconfigure_options(
cfg/dynamic.cfg
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
)
include_directories(
include
${catkin_INCLUDE_DIRS}
)
add_executable(${PROJECT_NAME}_exec src/main.cpp)
add_library(${PROJECT_NAME}
src/utils/params.cpp
src/utils/vis_tools.cpp
src/mpc.cpp
solver/codeGen/TailoredSolver_casadi.c
solver/codeGen/TailoredSolver_adtool2forces.c
)
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${FORCESPRO_LIBRARY})
target_link_libraries(${PROJECT_NAME}_exec ${catkin_LIBRARIES} ${PROJECT_NAME})
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_gencfg)
# Mandatory for parallelism (OpenMP)
target_compile_options(${PROJECT_NAME} PRIVATE ${OpenMP_FLAGS})