[CMake] What is the proper way to 'distribute' .cmake-files?

J.S. van Bethlehem j.s.van.bethlehem at astro.rug.nl
Tue May 3 09:32:06 EDT 2011


Hello,
While trying to create a build-system using CMake for some of my 
libraries, I notice that I keep using some macros and functions over and 
over again. I thought it would be nice to put some .cmake-files in some 
central place on the system (Linux, CMake 2.8.4) The obvious place would 
be to put them into the cmake-installation tree, but I'd rather have it 
in a separate place, such that it is clear what is personal and what 
came with CMake.  So where can I put stuff, such that eg the 'include()' 
command would find it?

I can't really find anything about this in the documentation, so I'm 
sorry if the question is too obvious maybe.... Things I thought of:
 * some other places that 'include()' looks - can't find anything about 
that (besides the module path, but that is obviously not known by 
'outside' library-build-systems)
 * make the set of .cmake-files into a full package itself, with all the 
config-files that go with it (but then I'd probably have to do 
use_package() somehow instead of a simple 'include')

Hopefully someone has some pointers.

Yours sincerely,
Jakob van Bethlehem



More information about the CMake mailing list