USE_SYSTEM_* and CMake caching creates trouble
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 toOFFat 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 toONanyway. (If the correspondingfind_packagefails, then no variables are cached, and hence changing it toOFFwill 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)
The second option seems better to me.
Is this for 3.2?
No, we really need to get 3.2 out asap