Minor build system improvements #56
Open
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.
G'day! I recently came across this repo and think I'll find it very useful. This PR just contains a few improvements to the build system. I've been careful to ensure that no existing functionality is altered or removed.
The main changes are adding explicit CMake configuration options. I noticed the CMake files check for certain variables (such as
ENABLE_SANITIZERandENABLE_TESTS) that aren't declared elsewhere, implying they are intended as command-line options. For each such variable, anoption()orset(CACHE)command is used to set an option of the same name prefixed withCWK_. The prefix helps prevent naming conflicts when this project is used as a dependency for, or otherwise included in, any other project. Though to maintain backwards compatibility, the default value of each such option is the value of the previous variable it corresponds to. So for example,CWK_ENABLE_TESTSdefaults to the value ofENABLE_TESTS.Two minor changes to the
cmake_minimum_required()command are also included. While the minimum version was stated as 3.9.2, theproject()command uses theHOMEPAGE_URLoption, which requires at least version 3.12. The minimum version is thus bumped up to 3.12 to account for this. TheFATAL_ERRORoption is also appended to this command. This just ensures CMake versions of 2.4 and less fail to build with an explicit error.