-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
63 lines (53 loc) · 1.36 KB
/
Copy pathCMakeLists.txt
File metadata and controls
63 lines (53 loc) · 1.36 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
cmake_minimum_required(VERSION 3.14)
project(RobotLegProject CXX)
# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Find the Eigen library
find_package(Eigen3 3.3 REQUIRED NO_MODULE)
# Add moteus library from GitHub using FetchContent
include(FetchContent)
FetchContent_Declare(
moteus
GIT_REPOSITORY https://github.com/mjbots/moteus.git
GIT_TAG ee4f6ac9c6391523876836fcf6f276411b7f3670
)
FetchContent_MakeAvailable(moteus)
# Add project include directory
include_directories(include)
# --- Define application executables ---
# Test 1: Passive state reporting
add_executable(
passive_test_app
projects/01_passive_test/main.cpp
src/kinematics.cpp
src/virtual_leg_controller.cpp
)
# Test 2: Virtual leg controller test
add_executable(
virtual_leg_test_app
projects/02_virtual_leg_test/main.cpp
src/kinematics.cpp
src/virtual_leg_controller.cpp
)
# App 3: Hopping controller
add_executable(
hopping_app
projects/03_hopping/main.cpp
src/kinematics.cpp
src/virtual_leg_controller.cpp
)
# --- Link libraries to all targets ---
foreach(app
passive_test_app
virtual_leg_test_app
hopping_app
)
target_link_libraries(${app} PRIVATE
Eigen3::Eigen
moteus
)
target_include_directories(${app} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
)
endforeach()