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

Pull up common YARP-related lines to root CMakeLists.txt #54

Closed
PeterBowman opened this issue Mar 23, 2018 · 11 comments
Closed

Pull up common YARP-related lines to root CMakeLists.txt #54

PeterBowman opened this issue Mar 23, 2018 · 11 comments
Assignees

Comments

@PeterBowman
Copy link
Member

PeterBowman commented Mar 23, 2018

Rationale:

roboticslab-uc3m/developer-manual#18 (comment)

Another CMake guideline proposal: set find_package(<pkg> REQUIRED) in root CMakeLists.txt for hard dependencies. Only a few repos in our org will meet this criteria: YARP in yarp-devices, OpenRAVE+Boost in openrave-yarp-plugins. See roboticslab-uc3m/yarp-devices@2fdc802.

roboticslab-uc3m/developer-manual#18 (comment)

Only a few repos in our org will meet this criteria

In spite of that, we can assume that most repos just need YARP for whatever purpose they exist for. When working on #45, we observed that certain components inside share/ and libraries/YarpPlugins/ may require having set common installation variables (via yarp_configure_external_installation()). Thus, pulling YARP-related commands to root CMakeLists.txt will avoid code duplication and other potential issues.

This reasoning may be extended to cover other hard dependencies, e.g. OpenRAVE+Boost in openrave-yarp-plugins.

@PeterBowman
Copy link
Member Author

Example: roboticslab-uc3m/yarp-devices@2fdc802.

@PeterBowman
Copy link
Member Author

From roboticslab-uc3m/developer-manual#18 (comment):

Also, there are cases in which CMake variables defined by Config.cmake or Find.cmake must be accessible in distinct folders. In order to avoid redundant find_package() calls, those could be arranged in one place as well (@jgvictores proposes cmake/<pkg>Dependencies.cmake). This resembles #54, but covers soft dependencies, too.

Question: put all dependencies (soft & hard) together?

@jgvictores
Copy link
Member

Question: put all dependencies (soft & hard) together?

IMHO, yes. Simple # cmake comment lines would be enough to serve as delimiters.

@PeterBowman
Copy link
Member Author

PeterBowman commented Apr 8, 2018

Question: put all dependencies (soft & hard) together?

Use case: different versions requested for the same dependency. See:

@jgvictores
Copy link
Member

Unordered thoughts:

  • I guess we should strive to use the same versions everywhere.
  • Not sure if bumping up or down is better, probably depends on use case.
  • The problem in the described issue was ROS enfocing its older version even if having an installed newer version.

To sum up, IMHO:

  • Keep the reasonable shared low version dependency near root.
  • If a specific optional component needs a very updated version of something say, difficult to install, let it be, in its own directory.

I do understand these directives are very rule-of-thumb and we are going to have to end up checking case by case, but I really can't come up with a straightforward solution that requires no analysis of the specific use case.

@PeterBowman
Copy link
Member Author

Related: #7, #14. Regarding the latter, I'd state somewhere (README file at repo's root, or perhaps best practices if common to all repos?) what is the required minimum YARP (and other hard dependency) version. Specific components may expand on this matter in their own README file (see #29).

@PeterBowman
Copy link
Member Author

Problem: YARP 3.0 is not compatible with YARP 2, thus find_package(YARP 2.x.x) will fail. This is currently causing errors in CI builds, but we can hack them around by checking out previous YARP releases during git clone.

@PeterBowman
Copy link
Member Author

YARP 3.0 introduces components. However, only some of them might be required by specific downstream libs/apps. For example, if only libA needs YARP_math, raise a warning and disable it if not found (see #18). By contrast, the following would not be desired in root CMakeLists.txt:

find_package(YARP 3.0 REQUIRED COMPONENTS OS dev math)

I hope to have this solved upstream by introducing support for optional components, see robotology/yarp#1741.

@PeterBowman
Copy link
Member Author

Problem: YARP 3.0 is not compatible with YARP 2, thus find_package(YARP 2.x.x) will fail. This is currently causing errors in CI builds, but we can hack them around by checking out previous YARP releases during git clone.

See #65.

@PeterBowman
Copy link
Member Author

PeterBowman commented Jun 20, 2018

I'd state somewhere (README file at repo's root, or perhaps best practices if common to all repos?) what is the required minimum YARP (and other hard dependency) version.

Regarding CMake, YCM and YARP, see current supported releases at roboticslab-uc3m/yarp-devices#111 (comment). Also, I started reflecting these values at each repo's install guides (example).

PeterBowman added a commit to roboticslab-uc3m/kinematics-dynamics that referenced this issue Jun 22, 2018
@PeterBowman
Copy link
Member Author

Question: put all dependencies (soft & hard) together?

Example: roboticslab-uc3m/kinematics-dynamics@8a32864. As you can see, I'm moving even those find_package() calls hidden behind an if() guard, too (i.e. ROBOTICSLAB_YARP_DEVICES and GTestSources).

PeterBowman added a commit to roboticslab-uc3m/yarp-devices that referenced this issue Jun 22, 2018
PeterBowman added a commit to asrob-uc3m/robotDevastation that referenced this issue Sep 4, 2018
PeterBowman added a commit to asrob-uc3m/robotDevastation-robots that referenced this issue Nov 8, 2018
rsantos88 pushed a commit to roboticslab-uc3m/yarp-devices that referenced this issue Jan 29, 2019
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