robotology / ycm-cmake-modules

YCM (YCM CMake modules) is a collection of various useful CMake modules.
http://robotology.github.io/ycm-cmake-modules
Other
52 stars 23 forks source link

YCMEPHelper: Set ExternalProject's BUILD_ALWAYS to ON to restore behaviour of old vendored YCM's ExternalProject #462

Closed traversaro closed 2 months ago

traversaro commented 2 months ago

Fix https://github.com/robotology/robotology-superbuild/issues/1700 . To be honest, I have no idea how this ever worked, or how it was working for users that reported that it was working fine for them (@LoreMoretti). However, if we want that executing a target always re-compile the project, indeed the ExternalProject's BUILD_ALWAYS option is explicitly designed for that:

BUILD_ALWAYS

Enabling this option forces the build step to always be run. This can be the easiest way to robustly ensure that the external project's own build dependencies are evaluated rather than relying on the default success timestamp-based method. This option is not normally needed unless developers are expected to modify something the external project's build depends on in a way that is not detectable via the step target dependencies (e.g. SOURCE_DIR is used without a download method and developers might modify the sources in SOURCE_DIR).

Just to permit users that want to set BUILD_ALWAYS to OFF, the option is now also exposed by YCMEPHelper, but its default value there is ON, while the default value of BUILD_ALWAYS in ExternalProject is OFF.

traversaro commented 2 months ago

I tested locally and this is working fine, let's merge to fix https://github.com/robotology/robotology-superbuild/issues/1700 .