Skip to content

Catkin finds system packages instead of Catkin packages of exported dependencies #760

Closed
@calderpg

Description

If a CMake-findable package exists on the system (for example, there is a FindPACKAGENAME.cmake in /usr/share/cmake-2.8/Modules), and a Catkin package with the same name exists, find_package(catkin REQUIRED COMPONENTS PACKAGENAME) will find the system package, not the Catkin package.

An example of when the problem occurs:

  1. You have a package installed to the system that provides a CMake find package file (for example, Findosg.cmake for OpenSceneGraph)
  2. You have a Catkin package named osg
  3. You have a Catkin package that depends on osg via find_package(catkin REQUIRED COMPONENTS osg)

In this case, the system package OpenSceneGraph will be found, rather than your Catkin package osg.

In contrast, the problem does not appear to occur in the comparable case of local Catkin package that shadows a system Catkin package. In this case, Catkin reorders the packages to ensure that the shadow package is processed before the dependant package. This would be much more reasonable behavior in the case of this bug.

In most cases, having a Catkin package with the same name as a system package should be avoided, but given the long list of system CMake files, some of which (like Findosg.cmake, which is deprecated in favor of FindOpenSceneGraph.cmake, but is still shipped for compatibility) have different names than their respective packages, it is fairly easy to accidentally shadow a system package.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions