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

Increasing minimum CMake version causes problems on install #162

Closed
lobis opened this issue Mar 24, 2022 · 1 comment · Fixed by #200
Closed

Increasing minimum CMake version causes problems on install #162

lobis opened this issue Mar 24, 2022 · 1 comment · Fixed by #200
Labels
help wanted Extra attention is needed

Comments

@lobis
Copy link
Member

lobis commented Mar 24, 2022

When working on #129 I noticed that the pipeline was not passing due to the installation directory missing some files (the binaries and libraries). After much trial and error, I found that the problem was that I had increased the minimum required version of CMake. After reverting this change, it was fixed 848f2da.

However since #129 is using some new features of CMake (and perhaps other code is already doing the same), having 3.5 as the minimum CMake version (which is from 6 years ago), will probably lead to problems on systems that use a cmake version closer to 3.5.

I vote to bump the minimum CMake version to 3.16, but in order to do that we need to fix this issue.

@juanangp
Copy link
Member

juanangp commented May 7, 2022

This issue seems related to a cmake bug, which was introduced in version 3.14 and seems resolved after version 3.21, this last point I didn't check properly. Seems related with cmake policy CMP0082 https://cmake.org/cmake/help/latest/policy/CMP0082.html and it is weird since it depends on the cmake_minimum_version required and not the cmake version which is used to compile the code.
For more details on this cmake bug check https://gitlab.kitware.com/cmake/cmake/-/issues/22234

There are two solutions to fix this issue:

  • Use older CMP0082 policy, that should be added at the beggining of the CMakeList.txt:
if(${CMAKE_VERSION} VERSION_LESS "3.21") 
    cmake_policy(SET CMP0082 OLD)
endif()
  • The other solution is to place add_subdirectory command after any install command in the CMakeList.txt

Let me know how do you want to proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants