Style
In this section we describe the CMake style conventions and guidelines for SUNDIALS.
Naming
SUNDIALS CMake cache variables (configuration options) must adhere to the following naming conventions:
To avoid naming collisions with other projects that include SUNDIALS as part of their CMake build system, SUNDIALS CMake cache variables are prefixed with
SUNDIALS_.Boolean options are prefixed with
SUNDIALS_ENABLE_.Cache variables use screaming snake case,
SUNDIALS_OPTION_NAME.Options to enable third party libraries are named
SUNDIALS_ENABLE_LIBRARY_NAME.The
SUNDIALS_prefix may be followed by a category name for grouping related options,SUNDIALS_CATEGORY_OPTION_NAME. For example,SUNDIALS_TEST_for SUNDIALS testing optionsSUNDIALS_EXAMPLES_for options related to the SUNDIALS examplesSUNDIALS_BENCHMARKS_for options related to SUNDIALS benchmarksSUNDIALS_DEV_for development optionsSUNDIALS_DEBUG_for debugging options
Formatting
CMake files should be formatted with cmake-format. cmake-format can be installed with
pip:
pip install cmake-format
Individual files can be formatted with the command:
cmake-format -i <cmake file>
The .cmake-format.py file in the root of the project defines our
configuration for cmake-format.