Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Amesos: Remove tribtits_add_option_and_define() calls for vars TriBIT…
…S automatically sets (trilinos#10355, trilinos#11583) The updated funtion tribits_add_option_and_define(<optionName> <defineName> ...) will error out if a local non-cache var of the same name <defineName> already exists. As explained in the TriBITS Users Guide, for all dependencies listed in the package's Dependencies.cmake file, TriBITS automatically defines and sets the vars: * <Package>_ENABLE_<UpstreamDepPkg>: Cache var and/or non-cache local project-level var * HAVE_<PACKAGE>_<UPSTREAMDEPPKG>: Non-cache local project-level var The function tribits_add_option_and_define(<optionName> <defineName> ...) creates an INTERNAL cache var with the name <defineName>. (This was done because some Trilinos packages communicated info through these <defineName> vars for some reason.) With new behavior in CMake 3.21+ with policy CMP0126, setting the INTERNAL cache var <defineName> no longer resets the local var of the same name. Therefore, the function tribits_add_option_and_define(<optionName> <defineName> ...) has no impact and does not change anything that impacts behavior. Also, since TriBITS automatically defines documented cache vars with the name <Package>_ENABLE_<UpstreamDepPkg>, the statement set(<optionName> <value> CACHE BOOL ...) does not have any effect because the cache var is already set. Therefore, these calls to: tribits_add_option_and_define(<Package>_ENABLE_<UpstreamDepPkg> HAVE_<PACKAGE>_<UPSTREAMDEPPKG> ...) have no impact and just confused behavior. (But were actually masking a nasty defect described in trilinos#11583 after updating the CMake minimum version to 3.23.)
- Loading branch information