Skip to content

can't find tinyxml2::tinyxml2 #927

@Karsten1987

Description

@Karsten1987

Bug report

Required Info:

Packages (indirectly) depending on tinyxml2 might fail, because the taget tinyxm2::tinyxml2 is not found.

02:59:47 CMake Error at CMakeLists.txt:35 (add_library):
02:59:47   Target "rosbag2_transport" links to target "tinyxml2::tinyxml2" but the
02:59:47   target was not found.  Perhaps a find_package() call is missing for an
02:59:47   IMPORTED target, or an ALIAS target is missing?

This happened at rviz_common as well as rosbag2_transport and is heavily depend on the include order of packages - the order in which find_package is called.

See the example of rviz common here: ros2/rviz@b327b43

  • Operating System:
    • Windows 10
  • Installation type:
    • Source, partially provoked by building with -DENABLE_TESTING=OFF

Steps to reproduce issue

Revert the commit in here: ros2/rviz@b327b43

or look at the current Windows packaging job: https://ci.ros2.org/view/packaging/job/packaging_windows/1752/console#console-section-20

Note that for the latter, the packaging job fails because ENABLE_TESTING=OFF, whereas the build succeeds if tests are built.

Expected behavior

The order in which find_package doesn't matter, meaning packages can be sorted alphabetically.

Actual behavior

The order does matter! In the example of tinyxml2, whenever being find_package'd first, the compilation goes through smoothly. Being find first, also implies being found via find_package(pluginlib) or any other package exporting the dependency of tinyxml2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions