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.cfg. 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.
Some modules use interpolations to set defaults, see for instance
These can be modified within
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/coderefinery/autocmake/. We very much encourage such contributions. But we also strive for generality and portability.