Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindUUID module causes linking errors #48

Open
mjbogusz opened this issue Sep 28, 2018 · 2 comments
Open

FindUUID module causes linking errors #48

mjbogusz opened this issue Sep 28, 2018 · 2 comments

Comments

@mjbogusz
Copy link

In ROS Melodic the FindUUID module causes addition of an obviously invalid -lUUID::UUID flag to linker options when cmake_modules is added as a <build_depend> (even if libuuid itself is not used at all in the code).

Compilation/linking error looks like this:

/usr/bin/ld: cannot find -lUUID::UUID

In our case simple removal of the file (/opt/ros/melodic/share/cmake_modules/cmake/Modules/FindUUID.cmake) solved the problem, but I'm not sure if it's a solution or a workaround.

@wjwwood
Copy link
Member

wjwwood commented Sep 29, 2018

Can you provide a minimal reproducible case for this? There are definitely packages in Melodic that use cmake_modules and do not have this issue that build on the buildfarm. I think it's likely to do with something on your particular system.

It looks like it's trying to use the cmake style exported targets and not handling it correctly, based on the UUID::UUID.

@mjbogusz
Copy link
Author

I stopped poking around the code that suffered from this issue, but I've recently found this, seemingly related, issue: https://bitbucket.org/ignitionrobotics/ign-cmake/issues/40/cmake-cannot-parse-ignition-math4-ignition

Looks like a classic case of global namespace pollution.
Perhaps it's possible to find a "better" ordering of:

find_package(catkin)
find_package(gazebo)
catkin_package()
target_link_libraries()

in CMakeLists.txt, one that would prevent the variable overloading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants