-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prefix all CMake options with CORRADE_*.
A long-time PITA, especially when dealing with many CMake subprojects, getting finally fixed. Because keeping backwards compatibility is crucial, the old options are still recognized under these terms: - If CORRADE_BUILD_DEPRECATED is enabled (which is by default) and if no prefixed option is already set during the initial CMake run (which would suggest the user is already aware of the prefixed options), the unprefixed options are still recognized, printing a warning that this is deprecated. The warning will be printed for as long as the value of prefixed options is different from the unprefixed, so to get rid of it, it's enough to either sync their value or delete the unprefixed variable from cache, no need to recreate the whole build directory. - If BUILD_DEPRECATED is disabled but CORRADE_BUILD_DEPRECATED is not, the unprefixed options are still recognized. A lot of existing builds does this to strip away deprecated *C++* APIs, but not expecting that it would suddenly configure CMake completely differently. - If CORRADE_BUILD_DEPRECATED is disabled, no backwards compatibility for unprefixed options is done. This is the "don't want any cruft at all" feature. However if it gets enabled back, the backwards compatibility will get restored (unless it wasn't there in the initial run already). - If any prefixed option is already set during the initial CMake build (even to its default value, such as -DCORRADE_WITH_UTILITY=ON), it's assumed that the user is already aware of the prefixed options, no backwards compatibility for unprefixed options is done. This is useful to make the unprefixed variables free for use by other code, without affecting Corrade in any way. This change also allows me to get rid of silly code like this, which was needed to propagate the unprefixed CMake options to prefixed C preprocessor. if(THING_FOO) set(CORRADE_THING_FOO 1) endif() To verify I'm not breaking everything with this, the package and CI scripts in package/ are not adapted to this change in this commit. Except for the non-deprecated build, everything should build the same as before, with a warning. The non-deprecated build will build but without the tests enabled, and a warning from CMake that the BUILD_TESTS variable was not used (which is great!).
- Loading branch information
Showing
25 changed files
with
331 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.