TriBITSPub / TriBITS

TriBITS: Tribal Build, Integrate, and Test System,
http://tribits.org
Other
36 stars 46 forks source link

tribits_add_option_and_define(): restore optional macro define var arg, refactor (#516) #521

Closed bartlettroscoe closed 2 years ago

bartlettroscoe commented 2 years ago

Follow-up from PR #520, addresses #516

See commit log msg for details.

NOTE: This should fix the error reported in https://github.com/trilinos/Trilinos/issues/10925 (@glhenni).

bartlettroscoe commented 2 years ago

@KyleFromKitware, can you please do a post-merge review of this PR? I had to rush to merge it because TriBITS 'master' was breaking customer code (see trilinos/Trilinos#10925).

bartlettroscoe commented 2 years ago

FYI: Using the same approach as described in https://github.com/TriBITSPub/TriBITS/pull/520#issuecomment-1224528085, I reverted the patch in this PR and was able to reproduce the Trilinos configure error:

CMake Error at TriBITS/tribits/core/package_arch/TribitsAddOptionAndDefine.cmake:88 (tribits_pkg_export_cache_var):
  tribits_pkg_export_cache_var Macro invoked with incorrect arguments for
  macro named: tribits_pkg_export_cache_var
Call Stack (most recent call first):
  packages/muelu/CMakeLists.txt:166 (TRIBITS_ADD_OPTION_AND_DEFINE)

But after applying this PR commit patch, the Trilinos configure completes showing:

...

Finished configuring Trilinos!

Total time to configure Trilinos: 0m39.553s
-- If publishing results using Trilinos, please cite us: https://trilinos.github.io/cite.html
-- Configuring done
-- Generating done
-- Build files have been written to: /ascldap/users/rabartl/Trilinos.base/BUILDS/PR/clang-10.0.0

So I am confident this is fixing the problem reported in trilinos/Trilinos#10925