Customizing CMake modules¶
update.py script assembles modules listed in
CMakeLists.txt. Those that are fetched from the web are placed inside
downloaded/. You have several options to customize downloaded CMake
Directly inside the generated directory¶
The CMake modules can be customized directly inside
downloaded/ but this is
the least elegant solution since the customizations may be overwritten by the
update.py script (use version control).
Adapt local copies of CMake modules¶
A slightly better solution is to download the CMake modules that you wish you customize
to a separate directory (e.g.
custom/) and source the customized CMake
autocmake.yml. Alternatively you can serve your custom modules
from your own http server.
Fork and branch the CMake modules¶
You can fork and branch the mainline Autocmake development and include the branched customized versions. This will make it easier for you to stay up-to-date with upstream development.
If you source a module which contains directives such as
fetch, and you wish to modify those,
then you can override these settings in
autocmake.yml take precedence over
settings imported by a sourced module.
As an example consider the Boost module which defines and uses
The recommended way to customize these is in
Create own CMake modules¶
Of course you can also create own modules and source them in
Contribute customizations to the “standard library”¶
If you think that your customization will be useful for other users as well, you may consider contributing the changes directly to https://github.com/dev-cafe/autocmake/. We very much encourage such contributions. But we also strive for generality and portability.