robotology / yarp

YARP - Yet Another Robot Platform
http://www.yarp.it
Other
524 stars 195 forks source link

YARP_managerConfig.cmake requires FindTinyXML.cmake to be in CMAKE_MODULE_PATH, but YARP does not install it #1736

Closed traversaro closed 6 years ago

traversaro commented 6 years ago

Describe the bug If you have find_package(YARP COMPONENTS manager REQUIRED) using a YARP installed with YCM, you get the following error:

CMake Error at /usr/share/cmake-3.5/Modules/CMakeFindDependencyMacro.cmake:65 (find_package):
  By not providing "FindTinyXML.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "TinyXML", but
  CMake did not find one.

  Could not find a package configuration file provided by "TinyXML" with any
  of the following names:

    TinyXMLConfig.cmake
    tinyxml-config.cmake

  Add the installation prefix of "TinyXML" to CMAKE_PREFIX_PATH or set
  "TinyXML_DIR" to a directory containing one of the above files.  If
  "TinyXML" provides a separate development package or SDK, be sure it has
  been installed.

To Reproduce Configure a downstream project with find_package(YARP COMPONENTS manager REQUIRED) in its CMakeLists.txt , do not have find_package(YCM) in the same downstream project and make sure that YARP was configured/installed using an external YCM

Expected behavior find_package(YARP COMPONENTS manager REQUIRED) should work fine.

Configuration (please complete the following information):

Proposed solution If YARP is configured using an external YCM (and so it is not installing YCM CMake modules) a find_dependency(YCM) should be added in YARPConfig.cmake .

traversaro commented 6 years ago

@drdanz If you agree on the proposed solution, I can proceed in providing a PR.

traversaro commented 6 years ago

Apparently I was wrong, and the same problem occurs if YARP is generated without YCM: https://travis-ci.org/robotology/icub-tests/jobs/389236808#L5408 .

traversaro commented 6 years ago

Good old issue related to this: https://github.com/robotology/codyco-superbuild/issues/15 .

PeterBowman commented 6 years ago

I'm unable to reproduce this at e709b46 (and https://github.com/robotology/ycm/commit/9e2c204f3a2ac9dd3554f5503388e291e375d683). YCM is found on system by

https://github.com/robotology/yarp/blob/e709b46698ecb4eb335bd52b17e4163393836dca/CMakeLists.txt#L33

This call loads YCM module paths into CMAKE_MODULE_PATH via YCMConfig.cmake and then enables YARP_manager to locate the FindTinyXML.cmake file.

PeterBowman commented 6 years ago

I see this error when I uninstall YCM, though. Could you have installed YCM master by chance, and are you sure that YARP is in fact using an external YCM? YARP requires YCM 0.7.0 since quite recently (https://github.com/robotology/yarp/commit/84e1d355131568529b801d7b30bd5cccac6b3c96) and discards 0.6.0 in the call referenced in my previous comment.

PeterBowman commented 6 years ago

Please check #1739 against your sample project.

drdanz commented 6 years ago

@traversaro is this still an issue with latest master?

traversaro commented 6 years ago

Given that robot-testing and icub-tests seem to be working fine in devel (I think @diegoferigo checked this) I think this issue can be closed.

PeterBowman commented 10 months ago

I just ran into this on YARP 3.9, but the issue disappeared after cleaning the build folder and reconfiguring from scratch. I noticed the presence of a build/YARP_priv_tinyxml/ directory (it was not re-generated after the cleanup), and that the YARP_manager and YARP_robotinterface components had a find_dependency(YARP_priv_TinyXML) line in their xxxConfig.cmake file. Obviously, the names don't match, note the different letter casing: tinyxml vs TinyXML.