Open bartlettroscoe opened 1 year ago
A common idiom used with TriBITS is to define a cache var with the framework that allows the project to define an override as a non-cache var. The idiom looks like this:
if (NOT "${<varName>_DEFAULT}" STREQUAL "") set(<varName>_DEFAULT <defaultVal>) endif() advanced_set(<varName> "${<varName>_DEFAULT}" CACHE <type> "<docString>")
The set of TriBITS framework-level vars that have project-level default overrides are listed here.
The function that would be added for this is:
tribits_advanced_set_with_default_override(<varName> <defaultVal> CACHE <type> "<docString>")
(where advanced_set() is deprecated and used properly namespaced tribits_advanced_set()).
advanced_set()
tribits_advanced_set()
And there could also be a function of a non-advanced cache var with:
tribits_set_with_default_override(<varName> <defaultVal> CACHE <type> "<docString>")
This would cut down on a lot of boilerplate code and provide some more uniformity.
NOTE: This was suggested by @KyleFromKitware in https://github.com/TriBITSPub/TriBITS/pull/560#discussion_r1124670680.
This has been started in PR #591.
Description
A common idiom used with TriBITS is to define a cache var with the framework that allows the project to define an override as a non-cache var. The idiom looks like this:
The set of TriBITS framework-level vars that have project-level default overrides are listed here.
The function that would be added for this is:
(where
advanced_set()
is deprecated and used properly namespacedtribits_advanced_set()
).And there could also be a function of a non-advanced cache var with:
This would cut down on a lot of boilerplate code and provide some more uniformity.
NOTE: This was suggested by @KyleFromKitware in https://github.com/TriBITSPub/TriBITS/pull/560#discussion_r1124670680.