-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
73 lines (52 loc) · 1.91 KB
/
CMakeLists.txt
File metadata and controls
73 lines (52 loc) · 1.91 KB
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
cmake_minimum_required (VERSION 3.10) # Need at least 3.10 for gtest_discover_tests()
project (tmpc)
# Enable modern C++
set(CMAKE_CXX_STANDARD 20)
# Don't use compiler's C++ extensions
set(CMAKE_CXX_EXTENSIONS False)
# Enable position-independent code on all targets by default.
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Include CMakeToolsHelpers for easier debugging from VS Code
include(CMakeToolsHelpers OPTIONAL)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
set(PROJECT_INCLUDE_DIR ${PROJECT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_DEBUG_POSTFIX d)
# List of QP solvers
set(qp_solvers "qpOASES" "HPMPC" "HPIPM" "treeQP")
# List of selectable extern libs
set(extern_libs ${qp_solvers})
# Create TMPC_WITH_${lib} cached variables and find selected packages
foreach (lib ${extern_libs})
set(TMPC_WITH_${lib} OFF CACHE BOOL "Link to ${lib}")
if (TMPC_WITH_${lib})
find_package(${lib} REQUIRED)
endif ()
message(STATUS "TMPC_WITH_${lib}=${TMPC_WITH_${lib}}")
endforeach ()
# TODO: Eigen3 is required now, because some older tests depend on it.
# This dependency must be removed in future.
find_package(Eigen3 3.2.10 REQUIRED)
find_package(blaze 3.6 REQUIRED)
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
# Find boost.
find_package(Boost REQUIRED COMPONENTS exception)
# TMPC_WITH_CASADI
set(TMPC_WITH_CASADI ON CACHE BOOL "Build tmpc with CasADi generated function support classes")
# TMPC_WITH_JSON
set(TMPC_WITH_JSON ON CACHE BOOL "Build tmpc with JSON support")
add_subdirectory(blazefeo)
add_subdirectory(src)
add_subdirectory(examples)
# TMPC_WITH_TEST
set(TMPC_WITH_TEST ON CACHE BOOL "Build tmpc tests")
if (TMPC_WITH_TEST)
enable_testing()
add_subdirectory(test)
endif()
# TMPC_WITH_BENCHMARK
set(TMPC_WITH_BENCHMARK ON CACHE BOOL "Build tmpc benchmarks")
if (TMPC_WITH_BENCHMARK)
add_subdirectory(bench)
endif()