-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
72 lines (58 loc) · 2.09 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
cmake_minimum_required(VERSION 3.3.2)
project(nonlinear_controls)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "-O3")
#set(CMAKE_CXX_FLAGS "-Wall -Os")
SET(CMAKE_BUILD_TYPE Release)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
add_definitions(-DMATPLOTLIBCPP_PYTHON_HEADER=Python.h)
find_package(OsqpEigen)
find_package(Eigen3)
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})
include_directories(
include
third_party/cvxgen
third_party/qpOASES
third_party/qpOASES/include
)
set(INCLUDE_DIRS
include
third_party/cvxgen
third_party/qpOASES
third_party/qpOASES/include
third_party/matplotlib-cpp # TODO learn why this is working and not include_directories
)
set(QUADPROG_SRCS
src/quadprog/quadprog.cpp
src/quadprog/qpswift_eigen.cpp
)
set(CONTROL_SRCS
src/SO3_control.cpp
src/SE3_control.cpp
src/qp_interface.cpp
src/SO3_clf.cpp
src/tracking_mpc.cpp
include/common/constants.h
include/common/log.hpp
examples/mpc_point_mass.cpp
include/controls/mpc_epigraph.hpp
include/controls/linear_mpc.hpp)
add_subdirectory(third_party)
set(CMAKE_BUILD_TYPE Debug)
add_library(nonlinear_controls ${CONTROL_SRCS} ${QUADPROG_SRCS})
target_link_libraries(nonlinear_controls qpOASES_cpp epigraph OsqpEigen::OsqpEigen ${PYTHON_LIBRARIES})
target_include_directories(nonlinear_controls PUBLIC . ${INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include)
# tests
add_executable(test_main tests/test_nlc.cpp)
target_link_libraries(test_main nonlinear_controls)
add_executable(test_qp tests/test_qp.cpp)
target_link_libraries(test_qp nonlinear_controls)
#add_executable(test_mpc tests/test_mpc.cpp)
#target_link_libraries(test_mpc nonlinear_controls)
add_executable(osqpMPCExample tests/test_osqp_mpc.cpp)
target_link_libraries(osqpMPCExample nonlinear_controls)
# examples
add_executable(example_point_mass examples/mpc_point_mass.cpp)
target_link_libraries(example_point_mass nonlinear_controls)