-
Notifications
You must be signed in to change notification settings - Fork 852
Add AutoOptionHelpers.cmake #10158
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
Merged
Merged
Add AutoOptionHelpers.cmake #10158
Conversation
This file contains hidden or 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
cmcfarlen
previously approved these changes
Aug 10, 2023
Contributor
cmcfarlen
left a comment
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.
Very cool! Thanks!
JosiahWI
commented
Aug 11, 2023
f6b6937 to
df72265
Compare
This module assists with making the usage of optional libraries consistent and in agreement with automake. It provides functions to register new options, and to print out the state of all associated features. Each option based on a package will follow the format ENABLE_XXX, and will have an associated feature variable (e.g. TS_HAS_JEMALLOC). Its value can be ON, 1, TRUE, OFF, 0, FALSE, or AUTO. When the states of the features are printed out, features that are ON or OFF will generally be color coded green or red respectively to help configuration mistakes stand out. Options that were explicitly turned off are given special treatment: if the feature is off, it will not be color coded, because this is expected; if the feature is found to be enabled despite the user's request, it will be colored red and a CMake warning will be issued. All of this should help keep things consistent and avoid any potentially annoying bugs caused by misconfiguration.
This refactors auto_options to take arguments using cmake_parse_arguments, thereby making available a more familiar and flexible interface.
2757ce5 to
654ef6c
Compare
654ef6c to
15222ae
Compare
cmcfarlen
approved these changes
Sep 16, 2023
Contributor
cmcfarlen
left a comment
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.
Looks good! This will be real nice!
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This module assists with making the usage of optional libraries consistent and in agreement with automake. It provides functions to register new options, and to print out the state of all associated features.
Each option based on a package will follow the format ENABLE_XXX, and will have an associated feature variable (e.g. TS_HAS_JEMALLOC). Its value can be ON, 1, TRUE, OFF, 0, FALSE, or AUTO.
When the states of the features are printed out, features that are ON or OFF will generally be color coded green or red respectively to help configuration mistakes stand out. Options that were explicitly turned off are given special treatment: if the feature is off, it will not be color coded, because this is expected; if the feature is found to be enabled despite the user's request, it will be colored red and a CMake warning will be issued. All of this should help keep things consistent and avoid any potentially annoying bugs caused by misconfiguration.