Skip to content

Commit 987d06b

Browse files
authored
Merge pull request #23 from Simple-Robotics/topic/gersemi-add-defs
Gersemi (CMake formatting) add function definitions
2 parents aa4d863 + 6fb997a commit 987d06b

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

.gersemirc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
definitions: [./CMakeLists.txt, ./benchmark, ./bindings, ./cmake, ./tests]
12
line_length: 80
23
indent: 2
34
warn_about_unknown_commands: false

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ci:
22
autoupdate_branch: main
33
autofix_prs: false
4+
submodules: true
45
repos:
56
- repo: https://github.com/pre-commit/mirrors-clang-format
67
rev: v19.1.4

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ include("${JRL_CMAKE_MODULES}/base.cmake")
7777
include("${JRL_CMAKE_MODULES}/boost.cmake")
7878

7979
# Project definition
80-
compute_project_args(PROJECT_ARGS LANGUAGES CXX)
80+
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
8181
project(${PROJECT_NAME} ${PROJECT_ARGS})
8282

8383
add_compile_options(-Wno-error)
@@ -93,11 +93,11 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
9393
endif()
9494

9595
find_package(example-robot-data 4.0.9 REQUIRED)
96-
add_project_dependency(OpenMP REQUIRED)
97-
add_project_dependency(proxsuite REQUIRED)
98-
add_project_dependency(pinocchio REQUIRED)
99-
add_project_dependency(aligator REQUIRED)
100-
add_project_dependency(ndcurves REQUIRED)
96+
ADD_PROJECT_DEPENDENCY(OpenMP REQUIRED)
97+
ADD_PROJECT_DEPENDENCY(proxsuite REQUIRED)
98+
ADD_PROJECT_DEPENDENCY(pinocchio REQUIRED)
99+
ADD_PROJECT_DEPENDENCY(aligator REQUIRED)
100+
ADD_PROJECT_DEPENDENCY(ndcurves REQUIRED)
101101

102102
# Main Library
103103
file(GLOB mpc_SOURCE CONFIGURE_DEPENDS src/*.cpp)

bindings/CMakeLists.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include("${JRL_CMAKE_MODULES}/python.cmake")
22
include("${JRL_CMAKE_MODULES}/stubs.cmake")
33

4-
add_project_dependency(eigenpy 3.9.1 REQUIRED)
4+
ADD_PROJECT_DEPENDENCY(eigenpy 3.9.1 REQUIRED)
55

66
set(
77
${PY_NAME}_SOURCES
@@ -28,12 +28,15 @@ install(TARGETS ${PY_NAME}_pywrap DESTINATION ${${PY_NAME}_INSTALL_DIR})
2828
set(${PY_NAME}_PYTHON __init__.py)
2929

3030
foreach(python ${${PY_NAME}_PYTHON})
31-
python_install_on_site(${PY_NAME} ${python})
31+
PYTHON_INSTALL_ON_SITE(${PY_NAME} ${python})
3232
endforeach()
3333

3434
if(GENERATE_PYTHON_STUBS)
35-
load_stubgen()
36-
generate_stubs(${CMAKE_CURRENT_BINARY_DIR} simple_mpc ${PYTHON_SITELIB}
37-
${PY_NAME}_pywrap
35+
LOAD_STUBGEN()
36+
GENERATE_STUBS(
37+
${CMAKE_CURRENT_BINARY_DIR}
38+
simple_mpc
39+
${PYTHON_SITELIB}
40+
${PY_NAME}_pywrap
3841
)
3942
endif()

tests/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ function(_add_test_prototype name prefix dependencies)
3030
set(test_file ${name}.cpp)
3131
message(STATUS "Adding C++ test: ${test_file} (${test_name})")
3232

33-
add_unit_test(${test_name} ${test_file} ${TEST_HEADERS})
33+
ADD_UNIT_TEST(${test_name} ${test_file} ${TEST_HEADERS})
3434
set_target_properties(${test_name} PROPERTIES LINKER_LANGUAGE CXX)
3535
# set_standard_output_directory(${test_name})
3636
target_include_directories(${test_name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
3737

3838
set(MODULE_NAME "${name}Test")
3939
string(REGEX REPLACE "-" "_" MODULE_NAME ${MODULE_NAME})
4040

41-
add_test_cflags(${test_name} "-DBOOST_TEST_DYN_LINK")
42-
add_test_cflags(${test_name} "-DBOOST_TEST_MODULE=${MODULE_NAME}")
41+
ADD_TEST_CFLAGS(${test_name} "-DBOOST_TEST_DYN_LINK")
42+
ADD_TEST_CFLAGS(${test_name} "-DBOOST_TEST_MODULE=${MODULE_NAME}")
4343

4444
target_link_libraries(${test_name} PUBLIC ${dependencies})
4545
target_link_libraries(${test_name} PRIVATE Boost::unit_test_framework)

0 commit comments

Comments
 (0)