[cmake-developers] Adding MacroWriteBasicCMakeVersionFile.cmake file to cmake ?
Alexander Neundorf
neundorf at kde.org
Wed Jul 6 16:00:25 EDT 2011
Hi,
in KDE we have a simple macro which helps with creating a
FooConfigVersion.cmake for installation along the FooConfig.cmake file.
Since that Version.cmake file in most cases looks basically the same, I
thought it is a good idea to provide such a basic file, and the only thing
which has to be changed there are the actual version numbers.
This is this file:
https://projects.kde.org/projects/kde/kdelibs/repository/revisions/master/entry/cmake/modules/BasicFindPackageVersion.cmake.in
Additionally there is a small helper macro which takes the three version
number components and does the configure_file():
https://projects.kde.org/projects/kde/kdelibs/repository/revisions/master/entry/cmake/modules/MacroWriteBasicCMakeVersionFile.cmake
so the user can then add the install(FILES ... ) command after that.
IMO this is generic enough to be added to cmake.
How ?
As a combination of macro and cmake.in file as it is ?
Or just the cmake.in file and let the users find out how to use that file
themselves ? The problem with this is that the man page will not contain
documentation about the cmake.in file, while it will contain documentation
about the macro (if it is added as macro).
Or only add the macro, and do file(WRITE ...) instead of configure_file() in
it ?
About the name: when added to cmake, I would probably simply strip the "Macro"
prefix from it.
Comments ?
Alex
More information about the cmake-developers
mailing list