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

Add BUILD_WITHOUT_DEPENDENCIES CMake option and nodeps CMake preset #697

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

traversaro
Copy link
Member

This PR adds the BUILD_WITHOUT_DEPENDENCIES CMake option (that by default is OFF) and the nodeps CMake preset to easily enable BUILD_WITHOUT_DEPENDENCIES and INSTALL_ALL_ROBOTS CMake option.

The BUILD_WITHOUT_DEPENDENCIES CMake options drops any dependency on YCM, YARP and ICUBcontrib with the following limitations:

  • The files are only installed, they are not copied in the build folder (as yarp_install does instead)
  • There is no uninstall target (but unix users can easily uninstall anyhow with xargs rm < install_manifest.txt)
  • There is no automatic setting of CMAKE_INSTALL_PREFIX to the ICUBcontrib install prefix

Furthermore, a nodeps CMake preset is added, to permit to easily build and install the CMake project with the options BUILD_WITHOUT_DEPENDENCIES and INSTALL_ALL_ROBOTS option enabled.

In particular, this functionality can be used to easily create an install of robots-configuration with the commands and make it available to YARP with:

git clone https://github.com/robotology/robots-configuration
cd robots-configuration
cmake --preset nodeps
cmake --install ./build
export YARP_DATA_DIRS=$YARP_DATA_DIRS:$(pwd)/build/install/share/ICUBcontrib

As this workflow is quite advanced and is meant just to be used in specific IIT-internal setups, I would avoid to document it in the README, and just document it where it is going to be used.

@traversaro
Copy link
Member Author

This functionality is meant to be used with the option added to robotology-superbuild in robotology/robotology-superbuild#1775 .

CMakeLists.txt Outdated Show resolved Hide resolved
@S-Dafarra
Copy link
Contributor

git clone https://github.com/robotology/robots-configuration
cd robots-configuration
cmake --preset nodeps
cmake --install ./build
export YARP_DATA_DIRS=$YARP_DATA_DIRS:$(pwd)/build/install/share/ICUBcontrib

Just to understand, how is the install prefix set?

@traversaro
Copy link
Member Author

Just to understand, how is the install prefix set?

That is part of the CMake preset, i.e. in https://github.com/robotology/robots-configuration/pull/697/files#diff-1712b235e02bd4a3ad866fe26447a6dc5c1b449faeea513f449d244d46d03cf5R21 . Note that that is only a default, so you can still change it by calling cmake --preset nodeps -DCMAKE_INSTALL_PREFIX=/another/install/prefix.

@S-Dafarra
Copy link
Contributor

git clone robotology/robots-configuration
cd robots-configuration
cmake --preset nodeps
cmake --install ./build
export YARP_DATA_DIRS=$YARP_DATA_DIRS:$(pwd)/build/install/share/ICUBcontrib

Just to understand, how is the install prefix set?

Saw it now: https://github.com/traversaro/robots-configuration/blob/5b267a80e38733695a8398c3db342a17b01dce66/CMakePresets.json#L21

I thought it was set somewhere in the CMakeLists.txt

Co-authored-by: Stefano Dafarra <[email protected]>
@traversaro
Copy link
Member Author

git clone robotology/robots-configuration
cd robots-configuration
cmake --preset nodeps
cmake --install ./build
export YARP_DATA_DIRS=$YARP_DATA_DIRS:$(pwd)/build/install/share/ICUBcontrib

Just to understand, how is the install prefix set?

Saw it now: https://github.com/traversaro/robots-configuration/blob/5b267a80e38733695a8398c3db342a17b01dce66/CMakePresets.json#L21

I thought it was set somewhere in the CMakeLists.txt

Yes, it may break the POLA if you are not used to CMakePresets.json, but now that we can start to drop Ubuntu 20.04 support, I think we can start using them as they are quite a powerful tool that can help declutter the CMakeLists.txt.

Copy link
Member

@pattacini pattacini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @traversaro for your contribution!

@pattacini pattacini merged commit 8f3974f into robotology:master Dec 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants