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

USE_SYSTEM_* and CMake caching creates trouble #671

Open
KrisThielemans opened this issue Mar 16, 2022 · 3 comments
Open

USE_SYSTEM_* and CMake caching creates trouble #671

KrisThielemans opened this issue Mar 16, 2022 · 3 comments

Comments

@KrisThielemans
Copy link
Member

It is generally dangerous to change USE_SYSTEM_* settings after a first configure, and certainly so after a first build. This is because find_package will remember various settings anyway, so deciding to use a system library after the first configure is probably not going to work.

Currently therefore, we need to recommend users to set these variables from the command line (setting it from the GUI is too late, as the first configure will cache the variables already). This needs to be added to our README.md (we have https://github.com/SyneRBI/SIRF/wiki/Rebuilding-after-upgrades by the way, but this is a bit different)

On the superbuild side, there are few things we can do about this in the future:

  • detect of someone changes the USE_SYSTEM_ variable, and then try to handle it (or at least warn)
  • Possibly we should switch the default of these variables to ON. @bathomas set them to OFF at the time to make sure we know which version we are using, but it's contrary to usual CMake philosophy, and most people want to set them to ON anyway. (If the corresponding find_package fails, then no variables are cached, and hence changing it to OFF will not cause problems).
  • try and be very clever and find which cached variables exist and somehow get rid of them. However, this needs to be done both in the SIRF-SuperBuild cache and in the projects that depend on the respective library (not sure if this can be done and it seems quite fragile anyway)
@paskino
Copy link
Contributor

paskino commented Mar 17, 2022

The second option seems better to me.

@paskino
Copy link
Contributor

paskino commented Mar 17, 2022

Is this for 3.2?

@KrisThielemans
Copy link
Member Author

No, we really need to get 3.2 out asap

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

No branches or pull requests

2 participants