Skip to content

Ensure that find_package(TINYXML2) defines TINYXML2::TINYXML2 even on case insensitive filesystems - #22

Merged
ahcorde merged 3 commits into
ros2:rollingfrom
traversaro:patch-3
Jul 4, 2025
Merged

ahcorde merged 3 commits into
ros2:rollingfrom
traversaro:patch-3

Conversation

@traversaro

Copy link
Copy Markdown
Contributor

On case-insensitive filesystem, it is possible that FindTinyXML2.cmake is used if the caller invoked find_package(TINYXML2), that is the signature used by gz-cmake, see https://github.com/gazebosim/gz-cmake/blob/gz-cmake4_4.1.0/cmake/FindTINYXML2.cmake .

If that is the case (and we detect it by checking the value of CMAKE_FIND_PACKAGE_NAME) we also define a TINYXML2::TINYXML2 target for gz-cmake compatibility.

Without this fix, the configuration of gz_ros2_control on macOS when use a case insensitive filesystem fails with error:

2025-01-22T16:59:01.2739710Z  │ │ -- Configuring done (14.4s)
2025-01-22T16:59:01.3799310Z  │ │ CMake Error at $PREFIX/lib/cmake/gz-msgs10/gz-msgs10-targets.cmake:61 (set_target_properties):
2025-01-22T16:59:01.3800500Z  │ │   The link interface of target "gz-msgs10::gz-msgs10" contains:
2025-01-22T16:59:01.3801140Z  │ │     TINYXML2::TINYXML2
2025-01-22T16:59:01.3801480Z  │ │   but the target was not found.  Possible reasons include:
2025-01-22T16:59:01.3801840Z  │ │     * There is a typo in the target name.
2025-01-22T16:59:01.3802210Z  │ │     * A find_package call is missing for an IMPORTED target.
2025-01-22T16:59:01.3802560Z  │ │     * An ALIAS target is missing.
2025-01-22T16:59:01.3802930Z  │ │ Call Stack (most recent call first):
2025-01-22T16:59:01.3803250Z  │ │   $PREFIX/lib/cmake/gz-msgs10/gz-msgs10-config.cmake:126 (include)
2025-01-22T16:59:01.3803660Z  │ │   $PREFIX/lib/cmake/gz-transport13/gz-transport13-config.cmake:97 (find_package)
2025-01-22T16:59:01.3804050Z  │ │   $PREFIX/lib/cmake/gz-sim8/gz-sim8-config.cmake:94 (find_package)
2025-01-22T16:59:01.3804470Z  │ │   $PREFIX/opt/gz_sim_vendor/extra_cmake/lib/cmake/gz-sim/gz-sim-config.cmake:3 (find_package)
2025-01-22T16:59:01.3804820Z  │ │   CMakeLists.txt:28 (find_package)
2025-01-22T16:59:01.3805190Z  │ │ CMake Error at $PREFIX/lib/cmake/gz-gui8/gz-gui8-targets.cmake:61 (set_target_properties):
2025-01-22T16:59:01.3805630Z  │ │   The link interface of target "gz-gui8::gz-gui8" contains:
2025-01-22T16:59:01.3805940Z  │ │     TINYXML2::TINYXML2
2025-01-22T16:59:01.3806200Z  │ │   but the target was not found.  Possible reasons include:
2025-01-22T16:59:01.3806460Z  │ │     * There is a typo in the target name.
2025-01-22T16:59:01.3806720Z  │ │     * A find_package call is missing for an IMPORTED target.
2025-01-22T16:59:01.3806970Z  │ │     * An ALIAS target is missing.
2025-01-22T16:59:01.3807180Z  │ │ Call Stack (most recent call first):
2025-01-22T16:59:01.3807460Z  │ │   $PREFIX/lib/cmake/gz-gui8/gz-gui8-config.cmake:131 (include)
2025-01-22T16:59:01.3807800Z  │ │   $PREFIX/lib/cmake/gz-sim8/gz-sim8-config.cmake:98 (find_package)
2025-01-22T16:59:01.3808230Z  │ │   $PREFIX/opt/gz_sim_vendor/extra_cmake/lib/cmake/gz-sim/gz-sim-config.cmake:3 (find_package)
2025-01-22T16:59:01.3808570Z  │ │   CMakeLists.txt:28 (find_package)
2025-01-22T16:59:01.4087500Z  │ │ -- Generating done (0.1s)

@traversaro traversaro changed the title Ensure that find_package(TINYXML2) defines TINYXML2::TINYXML2 Ensure that find_package(TINYXML2) defines TINYXML2::TINYXML2 even on case insensitive filesystems Jan 23, 2025
Signed-off-by: Silvio Traversaro <[email protected]>
Signed-off-by: Silvio Traversaro <[email protected]>
@traversaro

Copy link
Copy Markdown
Contributor Author

@mjcarroll friendly ping (I just pinged you as you are assigned to the PR)

@ahcorde

ahcorde commented Jul 3, 2025 •

Copy link
Copy Markdown
Contributor

Pulls: #22
Gist: https://gist.githubusercontent.com/ahcorde/e3b71b45029aacd56462c455a91d56b9/raw/50c5300727ee3b4359bf71063e69524f4f11a3cf/ros2.repos
BUILD args: --packages-above-and-dependencies tinyxml2_vendor
TEST args: --packages-above tinyxml2_vendor
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/16396

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@traversaro

Copy link
Copy Markdown
Contributor Author

Thanks @ahcorde !

@ahcorde
ahcorde merged commit 931d7eb into ros2:rolling Jul 4, 2025
@ahcorde

ahcorde commented Jul 4, 2025

Copy link
Copy Markdown
Contributor

@traversaro do we need to backport this ?

@traversaro

traversaro commented Jul 13, 2025 •

Copy link
Copy Markdown
Contributor Author

@traversaro do we need to backport this ?

Sorry, I lost this comment. On the RoboStack side we have patches for this locally, but I just found on LinkedIn a comment that explained to users how to manually modify the config files of gazebo packages to deal with this issue on Humble, see https://github.com/idesign0/ros2_macOS/tree/3a08d35c8e54ccb1bc79aaffef9b627ee9a4f59b?tab=readme-ov-file#errors .

So I guess a backport to Humble/Jazzy would be useful for users, thanks a lot! fyi @idesign0 .

@idesign0

Copy link
Copy Markdown

@traversaro pleasure is all mine! :)

@traversaro

Copy link
Copy Markdown
Contributor Author

So I guess a backport to Humble/Jazzy would be useful for users, thanks a lot! fyi @idesign0 .

I recently encountered this again in humble, so a backport as you suggested would be indeed useful, thanks @ahcorde !

@traversaro

Copy link
Copy Markdown
Contributor Author

So I guess a backport to Humble/Jazzy would be useful for users, thanks a lot! fyi @idesign0 .

We recently encountered this again in Humble/Jazzy with @Tobias-Fischer, so a backport would be indeed useful @ahcorde . As some time passed, let us know if you prefer that we open the backport as a separate new PR to the humble and jazzy branches.

@traversaro
traversaro deleted the patch-3 branch July 19, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants