Open
Conversation
Specify five CMake variables users can optionally set to configure the build process. Each variable was used prior for configuration, but were not explicitly declared as options. Each option is appended with 'CWK_' to prevent potential naming conflicts when integrating with other build systems. However, the default value of each such option is the value of the previously named un-prefixed variable to ensure backwards compatibility. These changes mainly impact the top-level CMakeLists.txt, but related files - including build documentation and GitHub workflows - are also updated to reflect the new options. Also increases the minimum required CMake version to 3.12 since the project() command's HOMEPAGE_URL option was added in this version. And adds FATAL_ERROR to the cmake_minimum_required command to ensure CMake versions <= 2.4 fail with an error.
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
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.
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.