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

Respect YCM_USE_CMAKE_NEXT also when bootstrapping with FetchContent and fix compatibility of YCM_USE_CMAKE_NEXT=OFF with CMP0114 set to NEW #452

Merged
merged 2 commits into from
Jul 13, 2024

Conversation

traversaro
Copy link
Member

@traversaro traversaro commented Jul 13, 2024

The YCM_USE_CMAKE_NEXT variable (that by default is considered ON) can be used to avoid using the vendored external project by setting it to OFF . However, the variable was not properly observed when YCM was used via FetchContent. This PR fixes this.

This is useful for dealing with #50, as with this change it is possible to avoid using the vendored ExternalProject by just setting YCM_USE_CMAKE_NEXT to OFF (as we do in robotology/robotology-superbuild#1672).

@traversaro
Copy link
Member Author

traversaro commented Jul 13, 2024

Apparently being this untested, the YCM code is not working with upstream ExternalProject anymore:

CMake Warning (dev) at /usr/local/share/cmake-3.30/Modules/FetchContent.cmake:1953 (message):
  Calling FetchContent_Populate(YCM) is deprecated, call
  FetchContent_MakeAvailable(YCM) instead.  Policy CMP0169 can be set to OLD
  to allow FetchContent_Populate(YCM) to be called directly for now, but the
  ability to call it with declared details will be removed completely in a
  future version.
Call Stack (most recent call first):
  cmake/YCMBootstrapFetch.cmake:103 (FetchContent_Populate)
  CMakeLists.txt:60 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /usr/local/share/cmake-3.[30](https://github.com/robotology/robotology-superbuild/actions/runs/9919319898/job/27404998904#step:13:31)/Modules/ExternalProject.cmake:1991 (message):
  The 'NO_DEPENDS' option is no longer allowed.  It has been superseded by
  the per-step 'INDEPENDENT' option.  See policy CMP0114.
Call Stack (most recent call first):
  build/_deps/ycm-src/modules/YCMEPHelper.cmake:380 (ExternalProject_Add_StepTargets)
  build/_deps/ycm-src/modules/YCMEPHelper.cmake:1078 (_ycm_ep_add_update_step)
  cmake/BuildYCM.cmake:8 (ycm_ep_helper)
  build/_deps/ycm-src/modules/FindOrBuildPackage.cmake:205 (include)
  cmake/BuildYARP.cmake:8 (find_or_build_package)
  build/_deps/ycm-src/modules/FindOrBuildPackage.cmake:205 (include)
  cmake/RobotologySuperbuildLogic.cmake:68 (find_or_build_package)
  CMakeLists.txt:67 (include)

see https://github.com/robotology/robotology-superbuild/actions/runs/9919319898/job/27404998904 .

GitHub
CMake/YCM-based superbuild to simplify the build process of robotology projects. - Pass YCM_USE_CMAKE_NEXT set to OFF in normal-build (i.e. apt with gha image and vcpkg on windows) workflow · robo...

@CLAassistant
Copy link

CLAassistant commented Jul 13, 2024

CLA assistant check
All committers have signed the CLA.

@traversaro traversaro changed the title Respect YCM_USE_CMAKE_NEXT also when bootstrapping with FetchContent Respect YCM_USE_CMAKE_NEXT also when bootstrapping with FetchContent and fix compatibility of YCM_USE_CMAKE_NEXT=OFF with CMP0114 set to NEW Jul 13, 2024
@traversaro
Copy link
Member Author

traversaro commented Jul 13, 2024

Apparently being this untested, the YCM code is not working with upstream ExternalProject anymore:

CMake Warning (dev) at /usr/local/share/cmake-3.30/Modules/FetchContent.cmake:1953 (message):
  Calling FetchContent_Populate(YCM) is deprecated, call
  FetchContent_MakeAvailable(YCM) instead.  Policy CMP0169 can be set to OLD
  to allow FetchContent_Populate(YCM) to be called directly for now, but the
  ability to call it with declared details will be removed completely in a
  future version.
Call Stack (most recent call first):
  cmake/YCMBootstrapFetch.cmake:103 (FetchContent_Populate)
  CMakeLists.txt:60 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /usr/local/share/cmake-3.[30](https://github.com/robotology/robotology-superbuild/actions/runs/9919319898/job/27404998904#step:13:31)/Modules/ExternalProject.cmake:1991 (message):
  The 'NO_DEPENDS' option is no longer allowed.  It has been superseded by
  the per-step 'INDEPENDENT' option.  See policy CMP0114.
Call Stack (most recent call first):
  build/_deps/ycm-src/modules/YCMEPHelper.cmake:380 (ExternalProject_Add_StepTargets)
  build/_deps/ycm-src/modules/YCMEPHelper.cmake:1078 (_ycm_ep_add_update_step)
  cmake/BuildYCM.cmake:8 (ycm_ep_helper)
  build/_deps/ycm-src/modules/FindOrBuildPackage.cmake:205 (include)
  cmake/BuildYARP.cmake:8 (find_or_build_package)
  build/_deps/ycm-src/modules/FindOrBuildPackage.cmake:205 (include)
  cmake/RobotologySuperbuildLogic.cmake:68 (find_or_build_package)
  CMakeLists.txt:67 (include)

see https://github.com/robotology/robotology-superbuild/actions/runs/9919319898/job/27404998904 .

GitHub**Pass YCM_USE_CMAKE_NEXT set to OFF in normal-build (i.e. apt with gha image and vcpkg on windows) workflow · robotology/robotology-superbuild@22149fb**CMake/YCM-based superbuild to simplify the build process of robotology projects. - Pass YCM_USE_CMAKE_NEXT set to OFF in normal-build (i.e. apt with gha image and vcpkg on windows) workflow · robo...

This was fixed in a7e40ec .

GitHub
CMake/YCM-based superbuild to simplify the build process of robotology projects. - Pass YCM_USE_CMAKE_NEXT set to OFF in normal-build (i.e. apt with gha image and vcpkg on windows) workflow · robo...

@traversaro
Copy link
Member Author

traversaro commented Jul 13, 2024

As this is working fine (see https://github.com/robotology/robotology-superbuild/actions/runs/9919382871/job/27405509850), let's merge and do a release.

GitHub
CMake/YCM-based superbuild to simplify the build process of robotology projects. - Pass YCM_USE_CMAKE_NEXT set to OFF in normal-build (i.e. apt with gha image and vcpkg on windows) workflow · robo...

@traversaro traversaro merged commit 2f11aba into master Jul 13, 2024
18 checks passed
@traversaro traversaro deleted the fix50 branch July 13, 2024 12:06
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.

2 participants