-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tribits_add_option_and_define(): restore optional macro define var arg, refactor (#516) #521
tribits_add_option_and_define(): restore optional macro define var arg, refactor (#516) #521
Conversation
…g, refactor (TriBITSPub#516) In PR TriBITSPub#520, I accidentally put a requirement that the macro var name had to be set. Turns out, there is special logic for it to not be set. The documentation nor any TriBITS test hinted to this. But the file muelu/CMakeLists.txt actually calls tribits_add_option_and_define() with an empty macro var name. To catch this use case, I added unit tests (which will fail if you undo this patch). In order for the unit tests to cover what is needed, I had to factor out the function tribits_pkg_export_cache_var() into its own module TribitsPkgExportCacheVars.cmake so it could be included in the unit test driver. Then, I decided it would be a good idea to factor out a function tribits_pkg_append_set_commands_for_exported_vars() that is called in the module TribitsWriteClientExportFiles.cmake. Lastly, I moved the function tribits_assert_cache_and_local_vars_same_value() into this module as well. This encapsulates all of the logic to export of these package cache vars into a single module (with just a few dependencies).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to allow merge since this is breaking Charon + Trilinos integration (trilinos/Trilinos#10925).
Then can set up for post-merge review.
@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). |
FYI: Using the same approach as described in #520 (comment), I reverted the patch in this PR and was able to reproduce the Trilinos configure error:
But after applying this PR commit patch, the Trilinos configure completes showing:
So I am confident this is fixing the problem reported in trilinos/Trilinos#10925 |
This is a safer way to check for an empty var I have found in the past. Something strange happens with macro arguments (at least in older versions of CMake). This is in response to feedback from @KyleFromKitware while reviewing PR #521.
Follow-up from PR #520, addresses #516
See commit log msg for details.
NOTE: This should fix the error reported in trilinos/Trilinos#10925 (@glhenni).