[CMake] Help message for custom function/command

Eric Noulard eric.noulard at gmail.com
Tue Jul 2 05:42:27 EDT 2013


2013/7/2 Gennadiy Rozental <rogeeff at gmail.com>:
> Hi,
>
> Is there anyway to make cmake to print a help message for my custom
> functions I wrote and placed into some common modules? I want to be able to
> help other people who is going to develop within my framework.

If you put your stuff into a cmake module named "MyModule.cmake" then
cmake --help-module MyModule
will print the documentation header. This works if the module is in
the CMAKE_MODULE_PATH.

try e.g.:
cmake --help-module BundleUtilities

If your module is in the current directory then:
cmake -DCMAKE_MODULE_PATH=. --help-module MyModule
should work.

If you use CPack-introduced documentation markup you may get
individual macro/function/variable
documentation if you teach cmake to parse those file.
More info see:
http://public.kitware.com/Bug/view.php?id=10067
http://public.kitware.com/pipermail/cmake-developers/2012-February/003099.html
and probably more in the mailing list archive.

--
Erk
L'élection n'est pas la démocratie -- http://www.le-message.org


More information about the CMake mailing list