Target UUID::UUID does not exist

Create issue
Issue #40 new
Former user created an issue

I have been trying to update an older ROS-Gazebo project, to gazebo 9 that is using ignition math:

https://github.com/ethz-asl/rotors_simulator

Currently I am running Ubuntu 18.04, and Gazebo 9.1 and cmake 3.10.2.

When I compile the code get an error from CMAKE, that looks like this:

CMake Error at /home/martin/ros_sim_drone/src/rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt:26 (target_link_libraries):
  Error evaluating generator expression:

    $<TARGET_PROPERTY:UUID::UUID,INTERFACE_INCLUDE_DIRECTORIES>

  Target "UUID::UUID" not found.

The whole response looks like this:

Errors     << rotors_gazebo_plugins:check /home/martin/ros_sim_drone/logs/rotors_gazebo_plugins/build.check.002.log                                                                                        
CMake Warning (dev) at /usr/share/cmake-3.10/Modules/FindBoost.cmake:911 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "chrono" will no longer be dereferenced when the
  policy is set to NEW.  Since the policy is not set the OLD behavior will be
  used.
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindBoost.cmake:1558 (_Boost_MISSING_DEPENDENCIES)
  /usr/share/OGRE/cmake/modules/FindOGRE.cmake:318 (find_package)
  /usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake:175 (find_package)
  CMakeLists.txt:20 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:28 (add_library):
  Policy CMP0028 is not set: Double colon in target name means ALIAS or
  IMPORTED target.  Run "cmake --help-policy CMP0028" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  Target "rotors_gazebo_bag_plugin" links to target "UUID::UUID" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:28 (add_library):
  Policy CMP0028 is not set: Double colon in target name means ALIAS or
  IMPORTED target.  Run "cmake --help-policy CMP0028" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  Target "rotors_gazebo_bag_plugin" links to target "UUID::UUID" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /home/martin/ros_sim_drone/src/rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt:29 (target_link_libraries):
  Error evaluating generator expression:

    $<TARGET_PROPERTY:UUID::UUID,INTERFACE_INCLUDE_DIRECTORIES>

  Target "UUID::UUID" not found.


CMake Error:
  Error evaluating generator expression:

    $<TARGET_PROPERTY:UUID::UUID,INTERFACE_INCLUDE_DIRECTORIES>

  Target "UUID::UUID" not found.


CMake Error:
  Error evaluating generator expression:

    $<TARGET_PROPERTY:UUID::UUID,INTERFACE_INCLUDE_DIRECTORIES>

  Target "UUID::UUID" not found.


CMake Error at /home/martin/ros_sim_drone/src/rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt:29 (target_link_libraries):
  Error evaluating generator expression:

    $<TARGET_PROPERTY:UUID::UUID,INTERFACE_INCLUDE_DIRECTORIES>

  Target "UUID::UUID" not found.


make: *** [cmake_check_build_system] Error 1

My cmake file currently look like this:

cmake_minimum_required(VERSION 2.8.3)
project(rotors_gazebo_plugins)


find_package(catkin REQUIRED COMPONENTS
    cmake_modules
    geometry_msgs
    mav_msgs
    rosbag
    roscpp
    gazebo_ros
    rotors_comm
    rotors_control
    std_srvs
    tf
  )

find_package(Boost REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(gazebo REQUIRED)
find_package(Protobuf REQUIRED)

link_directories(${GAZEBO_LIBRARY_DIRS})
include_directories(include ${Boost_INCLUDE_DIR} ${catkin_INCLUDE_DIRS} ${Eigen3_INCLUDE_DIRS} ${GAZEBO_INCLUDE_DIRS})

#message(AUTHOR_WARNING "${GAZEBO_INCLUDE_DIRS}")

add_library(rotors_gazebo_bag_plugin SHARED src/gazebo_bag_plugin.cpp)
target_link_libraries(rotors_gazebo_bag_plugin ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES})

#message(AUTHOR_WARNING "${GAZEBO_LIBRARIES}")

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES ${PROJECT_NAME} rotors_gazebo_motor_model rotors_gazebo_controller_interface
  CATKIN_DEPENDS geometry_msgs mav_msgs rosbag roscpp rotors_comm rotors_control std_srvs tf
  DEPENDS EIGEN3 GAZEBO
)

Printing out my ${GAZEBO_LIBRARIES} I got this result:

BulletSoftBody;BulletDynamics;BulletCollision;LinearMath;/usr/lib/x86_64-linux-gnu/libSimTKsimbody.so;/usr/lib/x86_64-linux-gnu/libSimTKmath.so;/usr/lib/x86_64-linux-gnu/libSimTKcommon.so;/usr/lib/x86_64-linux-gnu/libblas.so;/usr/lib/x86_64-linux-gnu/liblapack.so;/usr/lib/x86_64-linux-gnu/libblas.so;pthread;rt;dl;m;/usr/lib/x86_64-linux-gnu/libgazebo.so;/usr/lib/x86_64-linux-gnu/libgazebo_client.so;/usr/lib/x86_64-linux-gnu/libgazebo_gui.so;/usr/lib/x86_64-linux-gnu/libgazebo_sensors.so;/usr/lib/x86_64-linux-gnu/libgazebo_rendering.so;/usr/lib/x86_64-linux-gnu/libgazebo_physics.so;/usr/lib/x86_64-linux-gnu/libgazebo_ode.so;/usr/lib/x86_64-linux-gnu/libgazebo_transport.so;/usr/lib/x86_64-linux-gnu/libgazebo_msgs.so;/usr/lib/x86_64-linux-gnu/libgazebo_util.so;/usr/lib/x86_64-linux-gnu/libgazebo_common.so;/usr/lib/x86_64-linux-gnu/libgazebo_gimpact.so;/usr/lib/x86_64-linux-gnu/libgazebo_opcode.so;/usr/lib/x86_64-linux-gnu/libgazebo_opende_ou.so;/usr/lib/x86_64-linux-gnu/libgazebo_ccd.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;/usr/lib/x86_64-linux-gnu/libboost_signals.so;/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_program_options.so;/usr/lib/x86_64-linux-gnu/libboost_regex.so;/usr/lib/x86_64-linux-gnu/libboost_iostreams.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_chrono.so;/usr/lib/x86_64-linux-gnu/libboost_atomic.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libprotobuf.so;-lpthread;/usr/lib/x86_64-linux-gnu/libsdformat.so;ignition-math4::ignition-math4;optimized;/usr/lib/x86_64-linux-gnu/libOgreMain.so;debug;/usr/lib/x86_64-linux-gnu/libOgreMain.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_atomic.so;/usr/lib/x86_64-linux-gnu/libboost_chrono.so;/usr/lib/x86_64-linux-gnu/libboost_chrono.so;/usr/lib/x86_64-linux-gnu/libpthread.so;optimized;/usr/lib/x86_64-linux-gnu/libOgreTerrain.so;debug;/usr/lib/x86_64-linux-gnu/libOgreTerrain.so;optimized;/usr/lib/x86_64-linux-gnu/libOgrePaging.so;debug;/usr/lib/x86_64-linux-gnu/libOgrePaging.so;ignition-math4::ignition-math4;ignition-transport4::ignition-transport4;ignition-msgs1::ignition-msgs1;ignition-common1::ignition-common1;ignition-fuel_tools1::ignition-fuel_tools1

Diging a bit futher I found the following lines in gazebo-config.cmake

# Find Ignition Math
find_package(ignition-math4 REQUIRED)
list(APPEND GAZEBO_INCLUDE_DIRS ${IGNITION-MATH_INCLUDE_DIRS})
list(APPEND GAZEBO_LIBRARY_DIRS ${IGNITION-MATH_LIBRARY_DIRS})
list(APPEND GAZEBO_LIBRARIES ${IGNITION-MATH_LIBRARIES})

This lead me to "ignition-math4/ignition-math4-config.cmake" where I found this line:

set(ignition-math4_LIBRARIES ignition-math4::ignition-math4)

These libray difinitions for ignition seems to be my current problem with my projects cmake script. I am unsure how this fix it, to get the correct library links for my project.

Comments (22)

  1. Michael Grey

    The pertinent part of the cmake output is:

      Target "rotors_gazebo_bag_plugin" links to target "UUID::UUID" but the
      target was not found.  Perhaps a find_package() call is missing for an
      IMPORTED target, or an ALIAS target is missing?
    

    Essentially what this error is saying is "Your target (rotors_gazebo_bag_plugin or one of its dependencies) depends on the target UUID::UUID, but we can't find a target with the name UUID::UUID".

    This particular error isn't supposed to be possible. The target UUID::UUID is a dependency of the target ignition-transport4::ignition-transport4, and it will be created when find_package(ignition-transport4) gets called. When you call find_package(gazebo REQUIRED) that should call find_package(ignition-transport4 REQUIRED). If your find_package(gazebo REQUIRED) line succeeded, then the UUID::UUID target should've been created.

    One thing that sticks out to me is that you have cmake_minimum_required(VERSION 2.8.3). I'm not sure exactly when imported targets were introduced to cmake, but I think it's a somewhat modern feature. Maybe try changing your cmake_minimum_required(VERSION ...) to 3.5.2 (or higher, since you have 3.10.2 available) and see if that helps.

  2. Martin Christiansen

    I just updated my CMake script cmake_minimum_required(VERSION 3.5.2) and ran a clean build.

    The problem still seems to be the same, so I am also really puzzled what is wrong.

    As far as I know UUID::UUID is uuid that is part of boost ?

    I am getting a warning from the find_package(gazebo REQUIRED) that could be the cause of the problem:

    CMake Warning (dev) at /usr/share/cmake-3.10/Modules/FindBoost.cmake:911 (if):
      Policy CMP0054 is not set: Only interpret if() arguments as variables or
      keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
      details.  Use the cmake_policy command to set the policy and suppress this
      warning.
    
      Quoted variables like "chrono" will no longer be dereferenced when the
      policy is set to NEW.  Since the policy is not set the OLD behavior will be
      used.
    Call Stack (most recent call first):
      /usr/share/cmake-3.10/Modules/FindBoost.cmake:1558 (_Boost_MISSING_DEPENDENCIES)
      /usr/share/OGRE/cmake/modules/FindOGRE.cmake:318 (find_package)
      /usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake:175 (find_package)
      CMakeLists.txt:19 (find_package)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    

    But this is a standard warning I get for even the example plugin project for Gazebo 9.

  3. Martin Christiansen

    If I remove the ${GAZEBO_LIBRARIES} from my cmake file I am able to compile the code. I know this is not a valid option for getting the code up an running, but It indicates the error is where I expected.

    I even tried to comment out all the ignition set commands such as 'set(ignition-math4_LIBRARIES ignition-math4::ignition-math4)` in gazebo-config.cmake and the code still compiles.

  4. Martin Christiansen

    The following three lines in gazebo-config.cmake all create the error:

    list(APPEND GAZEBO_LIBRARIES ${IGNITION-TRANSPORT_LIBRARIES})
    
    list(APPEND GAZEBO_LIBRARIES ${ignition-common1_LIBRARIES})
    
    list(APPEND GAZEBO_LIBRARIES ${IGNITION-FUEL_TOOLS_LIBRARIES})
    

    I will look into their cmake files, but I am not too hopefull discovering the error

  5. Michael Grey

    When you comment out set(ignition-math4_LIBRARIES ignition-math4::ignition-math4), are you still removing ${GAZEBO_LIBRARIES} from your cmake file? I would be very surprised if ignition-math4 has anything to do with this error, since ign-math doesn't have any dependency on uuid.

    Do you happen to know how this behaves on Ubuntu 16.04? Does the issue get introduced in Bionic specifically?

    I just tested a minimal version of your cmake script against gazebo-9 on Ubuntu 16.04, and it worked fine. However, "minimal" means I removed all the catkin related functions. At this point, I have to assume that the issue is coming from either Bionic or some strange interplay with catkin.

    Can you tell me which ROS distribution you're using, and how you've gone about installing gazebo-9 side-by-side with your ROS distro? Are you building gazebo-9 from source and installing it to a custom location?

  6. Martin Christiansen

    I have never tried to compile it one Ubuntu 16.04.

    I am using ROS Melodic and the Gazebo 9 is the osrfoundation install package for Ubuntu bionic using apt install:

    deb http://packages.osrfoundation.org/gazebo/ubuntu-stable bionic main

    I also tried with the Gazebo 9 version that comes with ROS, but the problem is still the same.

    The gnition-math4 does not create the problem as I indicated above, but I just commented all options out to localize the problem. I have stopped removing ${GAZEBO_LIBRARIES} for the cmake file and are currently only commenting out:

    list(APPEND GAZEBO_LIBRARIES ${IGNITION-TRANSPORT_LIBRARIES})
    
    list(APPEND GAZEBO_LIBRARIES ${ignition-common1_LIBRARIES})
    
    list(APPEND GAZEBO_LIBRARIES ${IGNITION-FUEL_TOOLS_LIBRARIES})
    

    from gazebo-config.cmake Hopefully, I can locate the specific lines where this fails with UUID.

  7. Martin Christiansen

    Would there be any additional helpfull information I could print from one of the CMAKE scripts?

  8. Michael Grey

    If you're willing to make modifications to installed files, you could open up the file

    /usr/lib/x86_64-linux-gnu/cmake/ignition-cmake0/cmake0/FindUUID.cmake

    and then add some unique printout immediately after the line ign_pkg_check_modules(UUID uuid)

    If you see that printout after running cmake on your plugin, then that means the target UUID::UUID was created the way it was supposed to be created, but for some reason the target isn't visible at your project's directory level. If you don't see that printout, then that would indicate that a find_package(~) call somewhere is picking up the wrong package for some reason.

  9. Martin Christiansen

    I change the FindUUID.cmake to the following:

    message(WARNING "FindUUID")
    if (UNIX)
      include(IgnPkgConfig)
      ign_pkg_check_modules(UUID uuid)
      message(FATAL_ERROR "CALLING THE FindUUID cmake file!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
    endif()
    

    But they do not appear when when I build the code!

    I have been unable to find a find_package call in /usr/lib/x86_64-linux-gnu/cmake/ignition-transport4/ignition-transport4-config.cmake.

    I only found find_package(~) mentioned in the comments for the file. It contains a line called:

    find_dependency(UUID)

    I also checked the ignition-transport4-config.cmake is executed. My best option right now is to search the computer for any other FindUUID.cmake files.

  10. Martin Christiansen

    I found 3 versions of FIndUUID.cmake on my system:

    /opt/ros/melodic/share/cmake_modules/cmake/Modules/FindUUID.cmake
    /usr/lib/x86_64-linux-gnu/cmake/ignition-cmake0/cmake0/FindUUID.cmake
    /usr/share/cmake_modules/cmake/Modules/FindUUID.cmake
    

    After adding printout messages to them all, I still did not receive any messages when i build the project.

    It seems like I am missing a find_package call somewhere or are my assumptions wrong ?

  11. Michael Grey

    FYI, find_dependency() is secretly a call to find_package(), so your ignition-transport4-config.cmake file is fine.

    I now feel confident that the issue is the presence of other FindUUID.cmake files. I'll have to look into where those files are coming from and whether they're new to Bionic.

  12. Michael Grey

    Based on those FindUUID.cmake files, it looks like a quick and easy workaround for @martin-pc would be to add the following line immediately after find_package(gazebo REQUIRED):

    ign_import_target(UUID)
    

    I think that should create a suitable imported target for libuuid, even when it's being found by the ROS cmake module.

    On the ignition side, we should rename our vendored cmake module from FindUUID.cmake to FindIgnUUID.cmake to avoid this collision.

  13. Martin Christiansen

    I have just tested the suggested change to the main cmake script and it works! Apparently, I had forgotten to remove one of the messages in the ign FindUUID, that was printed out.

    What puzzles me right now is that I do not get a printout messages from any of the other FindUUID.cmake files in the build process.

  14. Michael Grey

    It's certainly suspicious that none of the other modules seem to be getting called. I would suggest printing out the values of UUID_LIBRARIES and UUID_INCLUDE_DIRS to make sure that those variables are actually getting set. If they're not being set, then the call to ign_import_target(UUID) will only hide the problem instead of fixing it.

    In the meantime, we should keep this issue open until we have a fix on our end.

  15. Steve Peters

    I think we should keep this open until we fix it, but we could also rename it to mention UUID instead of math4.

  16. Evan Flynn

    @Martin, just wondering if you are releasing the migrated code you've been working on for running this package with gazebo 9 and ROS Melodic. I've been working on trying to migrate it over as well and have run into similar issues with the UUID library.

    I've followed the advice above and it solved the same issue you had at first....but now it has uncovered a different one.

    Getting this error for every plugin package:

    make[2]: *** No rule to make target 'uuid', needed by '/home/flynneva/code/ros/melodic/devel/lib/librotors_gazebo_bag_plugin.so'.  Stop.
    

    I am keeping my migrated code on my github repository https://github.com/flynneva/rotors_simulator if you want to check it out.

    Any help or advice you might have would be greatly appreciated!

  17. Jonathan Bohren

    Also observed when building Gazebo 9 with rtt_gazebo. Putting ign_import_target after find_package appears to have resolved the build issues on Ubuntu 16.04 / CMake 3.5.1.

    find_package(gazebo REQUIRED)
    ign_import_target(UUID)
    
  18. MarcZofka

    Hi guys,

    we are observing the same issue with Ubuntu 16.04, cmake 3.5.1 and Gazebo 9.4.1. While compiling, we obtain the following error:

     CMake Error at /home/my_account/catkin_ws/src/my_sim_env/gazebo_plugins/CMakeLists.txt:26 (target_link_libraries):
       Error evaluating generator expression:
       $<TARGET_PROPERTY:UUID::UUID,INTERFACE_INCLUDE_DIRECTORIES>
     Target "UUID::UUID" not found. 
    

    We tried to fix this in our CMakeLists.txt the following way,

    cmake_minimum_required(VERSION 2.8.3)
    [...]
    find_package(gazebo REQUIRED)
    if(gazebo_VERSION_MAJOR GREATER 8)
      ign_import_target(UUID)
      message(STATUS "Applying patch to ${PROJECT_NAME} to avoid error with GZ9: Target UUID::UUID not found.")
    endif()
    

    but then we are facing the following error:

    make[2]: *** No rule to make target 'uuid', needed by 'devel [...]
    

    I am wondering, if there is no adequate solution or quick bugfix, since i would expect a lot of people having this problem, compiling plugins for Gazebo 9.

    Regards!

  19. Yosuke Matsusaka

    Observed same issue (Target "UUID::UUID" not found & No rule to make target 'uuid') on Ubuntu 16.04, cmake 3.5.1 and Gazebo 9.4.1.

    After some struggle, found removing cmake_module package from find_package(catkin REQUIRED COMPONENTS ...) will fix the problem. ign_import_target(UUID) is not needed.

  20. MarcZofka

    Hi,

    @yosuke thanks for the hint, but since i need some of the FindXXX.cmake scripts, this doesn't help. Are there any other suggestions, which might help?

    Regards!

  21. Log in to comment