Configuration options#
The configuration options that you will encounter would be one of the
CMake native options#
The full list of cmake variables can be overwhelming for newcomers, however this is a great resource to find all that CMake can do. Here I will give just list the very most basic options that you typically need to get started.
Option |
Effect |
Notes |
---|---|---|
Specify |
||
Append |
Try to avoid [1] |
|
Specify where to install the project |
||
Specify what build variant to configure |
Can be set to |
Here <LANG>
is typically one of C
, CXX
, Fortran
, and
many others.
Important
There are more options related to finding/importing dependencies explained in the import section. Please read that section carefully.
Project specific options#
Consult with the actual project’s documentation for the options available. Here is just the list of options that are encouraged to be implemented by this template.
Option |
Effect |
Notes |
---|---|---|
|
Build project’s test-suite |
Dynamic default [2] |
|
Build project’s libraries as shared library |
Dynamic default [2] |
|
Enable installing the project |
Dynamic default [2] |
Here <PROJECT>
is the project’s option namespace, which is typically the
uppercase name of the project.
Upstream project options#
CMake options are propagated to upstream dependencies that are imported if the
project is imported via FetchContent
(see import section for more details).
You can thus control the options of these dependencies as well, e.g. you could
set <PROJECT2>_TESTS=ON
to test the imported <PROJECT2>
as well.
This, however, does not work with installed projects.