Skip to content

Commit 0999a27

Browse files
author
Antoine Bussy
committed
Fix hpp-fcl dependency
If template instantiation is not enabled, configuration fails because the target pinocchio_default becomes an interface library. Instead of basing the fix on the parameter ENABLE_TEMPLATE_INSTANTIATION, we detect directly if pinocchio_default is an interface library.
1 parent 2f33ea1 commit 0999a27

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4242
- Stop using context::Scalar for GeometryObject([#2441](https://github.com/stack-of-tasks/pinocchio/pull/2441))
4343

4444
### Fixed
45+
- Fix hpp-fcl dependency ([#2617](https://github.com/stack-of-tasks/pinocchio/pull/2617))
4546
- Add missing Python examples ([#2528](https://github.com/stack-of-tasks/pinocchio/pull/2528))
4647

4748
## [3.4.0] - 2025-02-12

src/CMakeLists.txt

+7-2
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,14 @@ pinocchio_specific_type(default DEFAULT_SCOPE)
191191
# some are template instantiated, or some user can link only on pinocchio_default, we muste define
192192
# PINOCCHIO_WITH_HPP_FCL in pinocchio_default.
193193
if(BUILD_WITH_HPP_FCL_SUPPORT)
194-
target_compile_definitions(pinocchio_default PUBLIC PINOCCHIO_WITH_HPP_FCL)
194+
set(LINK_TYPE "PUBLIC")
195+
get_target_property(IS_INTERFACE pinocchio_default TYPE)
196+
if(IS_INTERFACE STREQUAL "INTERFACE_LIBRARY")
197+
set(LINK_TYPE "INTERFACE")
198+
endif()
199+
target_compile_definitions(pinocchio_default ${LINK_TYPE} PINOCCHIO_WITH_HPP_FCL)
195200
target_include_directories(
196-
pinocchio_default PUBLIC $<TARGET_PROPERTY:hpp-fcl::hpp-fcl,INTERFACE_INCLUDE_DIRECTORIES>)
201+
pinocchio_default ${LINK_TYPE} $<TARGET_PROPERTY:hpp-fcl::hpp-fcl,INTERFACE_INCLUDE_DIRECTORIES>)
197202

198203
endif()
199204

0 commit comments

Comments
 (0)