Skip to content

Conversation

@JosiahWI
Copy link
Contributor

@JosiahWI JosiahWI commented Aug 7, 2023

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.

@JosiahWI JosiahWI self-assigned this Aug 7, 2023
@JosiahWI JosiahWI added the CMake work related to CMakes scripts or issues label Aug 7, 2023
@JosiahWI JosiahWI added this to the 10.0.0 milestone Aug 7, 2023
@bryancall bryancall requested a review from cmcfarlen August 7, 2023 22:07
cmcfarlen
cmcfarlen previously approved these changes Aug 10, 2023
Copy link
Contributor

@cmcfarlen cmcfarlen left a 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 JosiahWI force-pushed the feat/cmake-auto-options branch 2 times, most recently from f6b6937 to df72265 Compare September 16, 2023 15:25
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.
@JosiahWI JosiahWI force-pushed the feat/cmake-auto-options branch 2 times, most recently from 2757ce5 to 654ef6c Compare September 16, 2023 15:31
@JosiahWI JosiahWI force-pushed the feat/cmake-auto-options branch from 654ef6c to 15222ae Compare September 16, 2023 15:34
@JosiahWI JosiahWI requested a review from cmcfarlen September 16, 2023 15:35
Copy link
Contributor

@cmcfarlen cmcfarlen left a 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!

@bneradt bneradt merged commit 9a54273 into apache:master Sep 17, 2023
@JosiahWI JosiahWI deleted the feat/cmake-auto-options branch October 11, 2023 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake work related to CMakes scripts or issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants