-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
66 lines (53 loc) · 2.05 KB
/
CMakeLists.txt
File metadata and controls
66 lines (53 loc) · 2.05 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
cmake_minimum_required(VERSION 3.8)
project(humanoid_controller)
add_compile_options(-Wall -Wextra -Wpedantic)
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
find_package(Eigen3 REQUIRED)
find_package(nlohmann_json REQUIRED)
ament_auto_add_library(
${PROJECT_NAME}
SHARED
DIRECTORY src
)
# prevent pluginlib from using boost
target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
pluginlib_export_plugin_description_file(controller_interface humanoid_controller.xml)
target_include_directories(
${PROJECT_NAME} PUBLIC ${EIGEN3_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME}
Eigen3::Eigen
nlohmann_json::nlohmann_json
)
ament_auto_package(
INSTALL_TO_SHARE config launch
)
# Author Linter Custom Targets
find_program(PYTHON3_EXECUTABLE python3)
if(PYTHON3_EXECUTABLE)
set(AUTHOR_LINTER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/utils/marks/author_linter.py)
set(AUTHOR_LINTER_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/utils/marks/author_config.yaml)
set(AUTHOR_LINTER_AUTHOR "Fulong Yin" CACHE STRING "Author name for author linter")
set(AUTHOR_LINTER_ORG "IO-AI.tech" CACHE STRING "Organization name for author linter")
# Check if config file exists
if(EXISTS ${AUTHOR_LINTER_CONFIG})
set(AUTHOR_LINTER_ARGS --config ${AUTHOR_LINTER_CONFIG})
else()
set(AUTHOR_LINTER_ARGS --author "${AUTHOR_LINTER_AUTHOR}" --org "${AUTHOR_LINTER_ORG}")
endif()
# Check target
add_custom_target(check_authors
COMMAND ${PYTHON3_EXECUTABLE} ${AUTHOR_LINTER_SCRIPT} --check ${AUTHOR_LINTER_ARGS} src/ include/
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Checking author information in C++ files"
VERBATIM
)
# Fix target
add_custom_target(fix_authors
COMMAND ${PYTHON3_EXECUTABLE} ${AUTHOR_LINTER_SCRIPT} --fix ${AUTHOR_LINTER_ARGS} src/ include/
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Fixing author information in C++ files"
VERBATIM
)
message(STATUS "Author linter targets available: check_authors, fix_authors")
endif()