title: For the cmake "include" command, what is the difference between a file and a module?
body: <p>I use some libraries that I don't want built as part of every project that uses them. A very understandable example is LLVM, which has 78 static libraries. Even having the cmake code to find and import these in every cmakefile is excessive.</p>
  
  <p>The obvious solution seems to be to use the "include" command, and to factor out relevant chunks of cmake script into *.cmake files, and set up a CMAKE_MODULE_PATH environment variable.</p>
  
  <p>Except it just plain doesn't work. Cmake doesn't find the file I specify in the include command.</p>
  
  <p>On the off-chance, I even tried specifying the path in the environment variable several ways - once with backslashes, once with forward slashes... - and I restarted the command prompt each time and checked that the environment variable was present and correct.</p>
  
  <p>In the cmake manual, it kind of implies that a "file" is different from a "module" - only a module gets the automatic add-the-extension-and-search-the-path treatment. But there is no explanation of what the difference is. I guessed that the missing extension might be enough (as with standard modules) but clearly it isn't.</p>
  
  <p>Searching the manual for "module" isn't much help as the word seems to be overloaded. For example, a module is also a dynamic library loaded using LoadLibrary/dl_open.</p>
  
  <p>Can anyone explain what the difference is between a file and a module in this context, and how I create my own module so that the cmake include command can find and use it?</p>
  
  <p>I'm using cmake 2.8.1 on Windows.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I'm pretty confident that the problem here is not understanding how cmake is supposed to work. I think what I <em>should</em> be doing is writing something that <code>find_package</code> can work with.</p>
  
  <p>As things stand though, I'm still some way from being able to answer my own question.</p>