Skip to content

Commit

Permalink
Merge pull request #2333 from jorisv/topic/workspace
Browse files Browse the repository at this point in the history
Enable jrl-cmakemodules workspace compatiblity
  • Loading branch information
jorisv authored Jul 24, 2024
2 parents 205a7bc + ff0b08f commit 5fd5eba
Show file tree
Hide file tree
Showing 17 changed files with 91 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Verify Pull Request Labels
uses: actions/github-script@v7
with:
Expand Down
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@ repos:
rev: 0.2.3
hooks:
- id: yamlfmt
args: [--mapping=2, --offset=2, --sequence=4, --implicit_start]
exclude: ^.github/workflows/linux.yml$
args: [--mapping=2, --offset=2, --sequence=4, --implicit_start, --preserve-quotes]
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
- Add getMotionAxis method to helical, prismatic, revolute and ubounded revolute joint ([#2315](https://github.com/stack-of-tasks/pinocchio/pull/2315))
- Add initial compatiblity with coal (coal needs `-DCOAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL=ON`) ([#2323](https://github.com/stack-of-tasks/pinocchio/pull/2323))
- Add compatibility with jrl-cmakemodules workspace ([#2333](https://github.com/stack-of-tasks/pinocchio/pull/2333))

### Changed
- Use eigenpy to expose `GeometryObject::meshMaterial` variant ([#2315](https://github.com/stack-of-tasks/pinocchio/pull/2315))
Expand Down
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ set(PROJECT_USE_CMAKE_EXPORT TRUE)
set(PROJECT_USE_KEYWORD_LINK_LIBRARIES TRUE)
set(PROJECT_COMPATIBILITY_VERSION AnyNewerVersion)
set(PINOCCHIO_PROJECT_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})
# To enable jrl-cmakemodules compatibility with workspace we must define the two following lines
set(PROJECT_AUTO_RUN_FINALIZE FALSE)
set(PROJECT_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})

# Disable -Werror on Unix for now.
set(CXX_DISABLE_WERROR True)
Expand Down Expand Up @@ -68,16 +71,17 @@ include("${JRL_CMAKE_MODULES}/base.cmake")
compute_project_args(PROJECT_ARGS LANGUAGES CXX)
project(${PROJECT_NAME} ${PROJECT_ARGS})

include("${JRL_CMAKE_MODULES}/python.cmake")
include("${JRL_CMAKE_MODULES}/boost.cmake")
include("${JRL_CMAKE_MODULES}/ide.cmake")
include("${JRL_CMAKE_MODULES}/apple.cmake")
if(APPLE) # Use the handmade approach
if(${CMAKE_VERSION} VERSION_LESS "3.18.0") # Need to find the right version
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake/find-external/OpenMP ${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH ${JRL_CMAKE_MODULES}/find-external/OpenMP ${CMAKE_MODULE_PATH})
endif()
elseif(UNIX)
if(${CMAKE_VERSION} VERSION_EQUAL "3.20.0")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake/find-external/OpenMP ${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH ${JRL_CMAKE_MODULES}/find-external/OpenMP ${CMAKE_MODULE_PATH})
endif()
endif()
include(CMakeDependentOption)
Expand Down Expand Up @@ -186,7 +190,7 @@ set(PINOCCHIO_MODEL_DIR "${PROJECT_SOURCE_DIR}/models")
# ----------------------------------------------------
# --- DEPENDENCIES -----------------------------------
# ----------------------------------------------------
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/find-external/CppAD/" ${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH "${JRL_CMAKE_MODULES}/find-external/CppAD/" ${CMAKE_MODULE_PATH})
add_project_dependency(Eigen3 REQUIRED PKG_CONFIG_REQUIRES "eigen3 >= 3.0.5")

if(BUILD_WITH_URDF_SUPPORT)
Expand Down Expand Up @@ -277,6 +281,7 @@ if(BUILD_PYTHON_INTERFACE)
)

set(PYTHON_COMPONENTS Interpreter Development NumPy)
findpython(REQUIRED)
add_project_dependency(eigenpy 2.7.10 REQUIRED)

if(BUILD_WITH_URDF_SUPPORT)
Expand Down Expand Up @@ -492,6 +497,7 @@ if(BUILD_WITH_EXTRA_SUPPORT)
export_variable(PINOCCHIO_USE_EXTRA ON)
set(PACKAGE_EXTRA_MACROS "${PACKAGE_EXTRA_MACROS}\nset(PINOCCHIO_USE_EXTRA \"\")")
endif()
export_variable(pinocchio_VERSION ${pinocchio_VERSION})

# Setup pkg-configs flags and libs
pkg_config_append_libs("${LIBRARIES_DEPENDENCIES}")
Expand All @@ -515,3 +521,5 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/share/${PROJECT_NAME}/hook/python_path.ds
"prepend-non-duplicate;PYTHONPATH;${PYTHON_SITELIB}")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/share/${PROJECT_NAME}/hook/python_path.dsv
DESTINATION share/${PROJECT_NAME}/hook)

setup_project_finalize()
17 changes: 8 additions & 9 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@

include(${JRL_CMAKE_MODULES}/python-helpers.cmake)
include(${JRL_CMAKE_MODULES}/stubs.cmake)
set(CMAKE_MODULE_PATH
"${PINOCCHIO_PROJECT_SOURCE_DIR}/cmake/find-external/GMP"
"${PINOCCHIO_PROJECT_SOURCE_DIR}/cmake/find-external/MPFR" ${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH "${JRL_CMAKE_MODULES}/find-external/GMP"
"${JRL_CMAKE_MODULES}/find-external/MPFR" ${CMAKE_MODULE_PATH})

# --- PYTHON TARGET --- #
set(PYWRAP ${PROJECT_NAME}_pywrap)
Expand Down Expand Up @@ -43,7 +42,7 @@ function(PINOCCHIO_PYTHON_BINDINGS_SPECIFIC_TYPE scalar_name)
# OpenMP is linked with pinocchio_parallel target
target_compile_definitions(${PYTHON_LIB_NAME} PRIVATE -DPINOCCHIO_PYTHON_INTERFACE_WITH_OPENMP)
endif()
add_dependencies(python ${PYTHON_LIB_NAME})
add_dependencies(${PROJECT_NAME}_python ${PYTHON_LIB_NAME})

# Remove lib prefix for the target and use the right define for DLLAPI definition
set_target_properties(${PYTHON_LIB_NAME} PROPERTIES PREFIX "" DEFINE_SYMBOL "${PYWRAP}_EXPORTS")
Expand Down Expand Up @@ -103,9 +102,9 @@ function(PINOCCHIO_PYTHON_BINDINGS_SPECIFIC_TYPE scalar_name)
PROPERTIES PREFIX ""
SUFFIX ${PYTHON_EXT_SUFFIX}
OUTPUT_NAME "${PYTHON_LIB_NAME}"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bindings/python/${PROJECT_NAME}"
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bindings/python/${PROJECT_NAME}"
# On Windows, shared library are treat as binary
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bindings/python/${PROJECT_NAME}")
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bindings/python/${PROJECT_NAME}")

if(UNIX AND NOT APPLE)
get_relative_rpath(${${PYWRAP}_INSTALL_DIR} ${PYWRAP}_INSTALL_RPATH)
Expand Down Expand Up @@ -138,11 +137,11 @@ function(INSTALL_PYTHON_FILES)
endfunction()

if(BUILD_PYTHON_INTERFACE)
add_custom_target(python)
set_target_properties(python PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True)
add_custom_target(${PROJECT_NAME}_python)
set_target_properties(${PROJECT_NAME}_python PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True)

python_build_get_target(python_build_target)
add_dependencies(python ${python_build_target})
add_dependencies(${PROJECT_NAME}_python ${python_build_target})

set(PKG_CONFIG_PYWRAP_REQUIRES "eigenpy >= 2.6.5")
if(IS_ABSOLUTE ${PYTHON_SITELIB})
Expand Down
2 changes: 1 addition & 1 deletion cmake
12 changes: 6 additions & 6 deletions doc/Doxyfile.extra.in
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ WARN_FORMAT = "$file:$line: $text"
# and error messages should be written. If left blank the output is written
# to stderr.

WARN_LOGFILE = @CMAKE_BINARY_DIR@/doc/doxygen.log
WARN_LOGFILE = @PROJECT_BINARY_DIR@/doc/doxygen.log

#---------------------------------------------------------------------------
# configuration options related to the input files
Expand All @@ -291,8 +291,8 @@ WARN_LOGFILE = @CMAKE_BINARY_DIR@/doc/doxygen.log
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.

INPUT = @CMAKE_SOURCE_DIR@/doc \
@CMAKE_SOURCE_DIR@/include
INPUT = @PROJECT_SOURCE_DIR@/doc \
@PROJECT_SOURCE_DIR@/include

# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
Expand All @@ -315,10 +315,10 @@ FILE_PATTERNS = *.cc *.cpp *.h *.hpp *.hh *.dox *.md *.py
# Note that relative paths are relative to the directory from which doxygen is
# run.

#EXCLUDE = @CMAKE_SOURCE_DIR@/doc/d-practical-exercises/src
#EXCLUDE = @PROJECT_SOURCE_DIR@/doc/d-practical-exercises/src

# Put them back for inclusion as whole files
HTML_EXTRA_FILES += @CMAKE_SOURCE_DIR@/doc/d-practical-exercises/src
HTML_EXTRA_FILES += @PROJECT_SOURCE_DIR@/doc/d-practical-exercises/src

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
Expand Down Expand Up @@ -362,7 +362,7 @@ EXCLUDE_SYMBOLS = internal::* \
# directories that contain image that are included in the documentation (see
# the \image command).

IMAGE_PATH = @CMAKE_SOURCE_DIR@/doc/pictures
IMAGE_PATH = @PROJECT_SOURCE_DIR@/doc/pictures


#---------------------------------------------------------------------------
Expand Down
7 changes: 4 additions & 3 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function(ADD_PINOCCHIO_CPP_EXAMPLE EXAMPLE)
cmake_parse_arguments(example "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

get_filename_component(EXAMPLE_NAME ${EXAMPLE} NAME)
set(EXAMPLE_NAME "example-cpp-${EXAMPLE_NAME}")
set(EXAMPLE_NAME "${PROJECT_NAME}-example-cpp-${EXAMPLE_NAME}")
add_unit_test(${EXAMPLE_NAME} "${EXAMPLE}.cpp")
target_link_libraries(${EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})

Expand All @@ -39,7 +39,8 @@ function(ADD_PINOCCHIO_CPP_EXAMPLE EXAMPLE)
if(WIN32)
string(REPLACE ";" "\\\;" _PATH "$ENV{PATH}")
set(ENV_VARIABLES
"PATH=${_PATH}\\\;${CMAKE_BINARY_DIR}/src\\\;${CMAKE_BINARY_DIR}/bindings/python/pinocchio")
"PATH=${_PATH}\\\;${PROJECT_BINARY_DIR}/src\\\;${PROJECT_BINARY_DIR}/bindings/python/pinocchio"
)
set_tests_properties(${EXAMPLE_NAME} PROPERTIES ENVIRONMENT "${ENV_VARIABLES}")
endif()
endfunction()
Expand Down Expand Up @@ -111,7 +112,7 @@ if(BUILD_PYTHON_INTERFACE)
endif()

foreach(EXAMPLE ${${PROJECT_NAME}_PYTHON_EXAMPLES})
set(EXAMPLE_NAME "example-py-${EXAMPLE}")
set(EXAMPLE_NAME "${PROJECT_NAME}-example-py-${EXAMPLE}")
add_python_unit_test("${EXAMPLE_NAME}" "examples/${EXAMPLE}.py" "bindings/python")
add_windows_dll_path_to_test(${EXAMPLE_NAME})
endforeach()
Expand Down
11 changes: 6 additions & 5 deletions examples/autodiff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ if(BUILD_WITH_AUTODIFF_SUPPORT)
function(ADD_PINOCCHIO_CPP_AUTODIFF_EXAMPLE EXAMPLE)
include_directories(SYSTEM ${cppadcg_INCLUDE_DIR})
add_pinocchio_cpp_example(${EXAMPLE})
target_link_libraries(example-cpp-${EXAMPLE} PUBLIC ${CMAKE_DL_LIBS} ${cppad_LIBRARY})
target_link_libraries(${PROJECT_NAME}-example-cpp-${EXAMPLE} PUBLIC ${CMAKE_DL_LIBS}
${cppad_LIBRARY})
endfunction()

add_pinocchio_cpp_autodiff_example(autodiff-rnea)
Expand All @@ -15,10 +16,10 @@ if(BUILD_WITH_AUTODIFF_SUPPORT)
set(${PROJECT_NAME}_AUTODIFF_PYTHON_EXAMPLES autodiff-rnea)

foreach(EXAMPLE ${${PROJECT_NAME}_AUTODIFF_PYTHON_EXAMPLES})
set(EXAMPLE_NAME "example-py-${EXAMPLE}")
set(EXAMPLE_NAME "${PROJECT_NAME}-example-py-${EXAMPLE}")
add_python_unit_test(${EXAMPLE_NAME} "examples/autodiff/${EXAMPLE}.py" "bindings/python")
add_windows_dll_path_to_test(${EXAMPLE_NAME})
endforeach(EXAMPLE ${${PROJECT_NAME}_AUTODIFF_PYTHON_EXAMPLES})
endif(BUILD_PYTHON_INTERFACE)
endforeach()
endif()

endif(BUILD_WITH_AUTODIFF_SUPPORT)
endif()
15 changes: 6 additions & 9 deletions examples/codegen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ if(cppadcg_FOUND
${EXAMPLE}
CPPADCG
PARSERS)
target_link_libraries(example-cpp-${EXAMPLE} PUBLIC ${CMAKE_DL_LIBS})
target_compile_definitions(example-cpp-${EXAMPLE}
target_link_libraries(${PROJECT_NAME}-example-cpp-${EXAMPLE} PUBLIC ${CMAKE_DL_LIBS})
target_compile_definitions(${PROJECT_NAME}-example-cpp-${EXAMPLE}
PUBLIC PINOCCHIO_CXX_COMPILER=\"${CMAKE_CXX_COMPILER}\")
endfunction()

Expand All @@ -22,13 +22,10 @@ if(cppadcg_FOUND
set(${PROJECT_NAME}_CODEGEN_PYTHON_EXAMPLES codegen-rnea)

foreach(EXAMPLE ${${PROJECT_NAME}_CODEGEN_PYTHON_EXAMPLES})
set(EXAMPLE_NAME "example-py-${EXAMPLE}")
set(EXAMPLE_NAME "${PROJECT_NAME}-example-py-${EXAMPLE}")
add_python_unit_test(${EXAMPLE_NAME} "examples/codegen/${EXAMPLE}.py" "bindings/python")
add_windows_dll_path_to_test(${EXAMPLE_NAME})
endforeach(EXAMPLE ${${PROJECT_NAME}_CODEGEN_PYTHON_EXAMPLES})
endif(BUILD_PYTHON_INTERFACE)
endforeach()
endif()

endif(
cppadcg_FOUND
AND BUILD_WITH_CODEGEN_SUPPORT
AND BUILD_WITH_URDF_SUPPORT)
endif()
11 changes: 8 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ modernize_target_link_libraries(
INCLUDE_DIRS ${Boost_INCLUDE_DIRS})

target_include_directories(
${PROJECT_NAME}_headers INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
${PROJECT_NAME}_headers
INTERFACE $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)

cxx_flags_by_compiler_frontend(
MSVC "/bigobj"
Expand Down Expand Up @@ -107,7 +108,10 @@ function(PINOCCHIO_TARGET target_name)
PRIVATE PINOCCHIO_CONTEXT_FILE="${PINOCCHIO_CONTEXT_FILE_VALUE}")
endif()

target_include_directories(${LIB_NAME} ${LIBRARY_PUBLIC_SCOPE} $<INSTALL_INTERFACE:include>)
target_include_directories(
${LIB_NAME} ${LIBRARY_PUBLIC_SCOPE} $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)

if(BUILD_WITH_COMMIT_VERSION)
tag_library_version(${LIB_NAME})
Expand Down Expand Up @@ -321,6 +325,7 @@ endif()

# Define main target (default, parsers, extra).
add_library(${PROJECT_NAME} INTERFACE)
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
if(ENABLE_TEMPLATE_INSTANTIATION)
target_link_libraries(${PROJECT_NAME} INTERFACE ${PROJECT_NAME}_default)
endif()
Expand Down
44 changes: 17 additions & 27 deletions unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function(GET_CPP_TEST_NAME name src_dir full_test_name)
string(REGEX REPLACE "[/]" "-" prefix_name "${prefix_name}-")

set(${full_test_name}
"test-cpp${prefix_name}${name}"
"${PROJECT_NAME}-test-cpp${prefix_name}${name}"
PARENT_SCOPE)
endfunction()

Expand Down Expand Up @@ -62,7 +62,8 @@ function(ADD_PINOCCHIO_UNIT_TEST name)
if(WIN32)
string(REPLACE ";" "\\\;" _PATH "$ENV{PATH}")
set(ENV_VARIABLES
"PATH=${_PATH}\\\;${CMAKE_BINARY_DIR}/src\\\;${CMAKE_BINARY_DIR}/bindings/python/pinocchio")
"PATH=${_PATH}\\\;${PROJECT_BINARY_DIR}/src\\\;${PROJECT_BINARY_DIR}/bindings/python/pinocchio"
)
set_tests_properties(${TEST_NAME} PROPERTIES ENVIRONMENT "${ENV_VARIABLES}")
endif()

Expand Down Expand Up @@ -103,11 +104,6 @@ function(ADD_PINOCCHIO_UNIT_TEST name)
endif()
endfunction()

macro(ADD_OPTIONAL_COMPILE_DEPENDENCY PKG_CONFIG_STRING)
_get_pkg_config_debug_string("${PKG_CONFIG_STRING}" ${ARGN})
add_dependency(0 1 ${PKG_CONFIG_STRING} "${PKG_CONFIG_DEBUG_STRING}")
endmacro()

macro(ADD_PINOCCHIO_PARALLEL_UNIT_TEST NAME)
if(BUILD_WITH_OPENMP_SUPPORT)
add_pinocchio_unit_test(${ARGV} PARALLEL)
Expand Down Expand Up @@ -228,25 +224,22 @@ endif()

if(BUILD_WITH_LIBPYTHON)
add_pinocchio_unit_test(python_parser PACKAGES Python3::Python)
target_include_directories(test-cpp-python_parser SYSTEM PUBLIC ${PYTHON_INCLUDE_DIRS})

target_link_libraries(test-cpp-python_parser PUBLIC ${PYWRAP}_default)
target_link_libraries(test-cpp-python_parser PUBLIC ${PYTHON_LIBRARIES})
get_test_property(test-cpp-python_parser ENVIRONMENT ENV_VARIABLES)
get_cpp_test_name(python_parser ${CMAKE_CURRENT_SOURCE_DIR} python_parser_target)
target_include_directories(${python_parser_target} SYSTEM PUBLIC ${PYTHON_INCLUDE_DIRS})

target_link_libraries(${python_parser_target} PUBLIC ${PYWRAP}_default)
target_link_libraries(${python_parser_target} PUBLIC ${PYTHON_LIBRARIES})
get_test_property(${python_parser_target} ENVIRONMENT ENV_VARIABLES)
compute_pythonpath(PYTHON_ENV_VARIABLES "bindings/python")
list(APPEND ENV_VARIABLES ${PYTHON_ENV_VARIABLES})
if(WIN32)
get_filename_component(PYTHONHOME ${PYTHON_EXECUTABLE} PATH)
list(APPEND ENV_VARIABLES "PYTHONHOME=${PYTHONHOME}")
unset(PYTHONHOME)
string(REPLACE ";" "\\\;" _PYTHONPATH "$ENV{PYTHONPATH}")
list(APPEND ENV_VARIABLES "PYTHONPATH=${_PYTHONPATH}\\\;${CMAKE_BINARY_DIR}/bindings/python")
else()
list(APPEND ENV_VARIABLES "PYTHONPATH=$ENV{PYTHONPATH}:${CMAKE_BINARY_DIR}/bindings/python")
# This line is mandatory because of Github action. The test run well on Windowns + Conda. This
# hide something wrong. Maybe the test is linking against the wrong Python library or call the
# wrong interpreter.
get_filename_component(_PYTHONHOME ${PYTHON_EXECUTABLE} PATH)
list(APPEND ENV_VARIABLES "PYTHONHOME=${_PYTHONHOME}")
endif()
if(APPLE)
list(APPEND ENV_VARIABLES "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}")
list(APPEND ENV_VARIABLES "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}")
endif()
set_tests_properties(test-cpp-python_parser PROPERTIES ENVIRONMENT "${ENV_VARIABLES}")
set_tests_properties(${python_parser_target} PROPERTIES ENVIRONMENT "${ENV_VARIABLES}")
add_subdirectory(python)
endif()

Expand Down Expand Up @@ -311,9 +304,6 @@ add_subdirectory(algorithm)
if(BUILD_ADVANCED_TESTING)
add_pinocchio_unit_test(multiprecision)

add_optional_compile_dependency(gmp)
add_optional_compile_dependency(mpfr)

if(MPFR_FOUND)
add_pinocchio_unit_test(multiprecision-mpfr PACKAGES mpfr gmp)
endif()
Expand Down
11 changes: 6 additions & 5 deletions unittest/casadi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

macro(ADD_CASADI_UNIT_TEST name)
add_pinocchio_unit_test(${name} PACKAGES casadi)
set_tests_properties(test-cpp-casadi-${name} PROPERTIES TIMEOUT 3000)
add_dependencies(test-casadi test-cpp-casadi-${name})
get_cpp_test_name(${name} ${CMAKE_CURRENT_SOURCE_DIR} TEST_NAME)
set_tests_properties(${TEST_NAME} PROPERTIES TIMEOUT 3000)
add_dependencies(${PROJECT_NAME}-test-casadi ${TEST_NAME})
endmacro()

if(BUILD_WITH_CASADI_SUPPORT)
add_custom_target(test-casadi)
set_target_properties(test-casadi PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True)
add_custom_target(${PROJECT_NAME}-test-casadi)
set_target_properties(${PROJECT_NAME}-test-casadi PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True)

add_casadi_unit_test(basic)
add_casadi_unit_test(spatial)
Expand All @@ -25,4 +26,4 @@ if(BUILD_WITH_CASADI_SUPPORT)
endif()
add_casadi_unit_test(integrate-derivatives)
add_casadi_unit_test(rnea-derivatives)
endif(BUILD_WITH_CASADI_SUPPORT)
endif()
Loading

0 comments on commit 5fd5eba

Please sign in to comment.