What is the purpose of a .cmake file? : <p>I might be googling wrongly, but I'm unable to find what's the purpose of .cmake files. </p>

<p>I've just stumbled across the cmake tool for a project I've to work with and I'm having a hard time to understand how it works. I do understand that running the cmake command in a directory containing a CMakeLists.txt executes the commands in that file (along with the commands in the CMakeLists.txt contained in the sub-directories) but the purpose of .cmake files is a lot more fuzzy.</p>

<p>It seems that they are used to define functions/set variables that are thereafter used in the CMakeLists but I'm not sure. How are they used by the CMake tool ? </p>
