[CMake] File organization and the essence of modules

Cedric Doucet cedric.doucet at inria.fr
Wed May 20 05:42:08 EDT 2015


Hello, 

I wonder how I should organize cmake files in my project. 
For the moment, I have organized my project like this: 
========================== 
project/ 
CMakeLists.txt 
cmake/ 
modules/ 
FindLibrary.cmake 
MyFunction.cmake 
src/ 
CMakeLists.txt 
========================== 
If I keep on organizing files like this, the "cmake" directory will only contain a subdirectory named "modules" and dedicated to auxiliary files like custom functions and scripts for the find_package function. 
Actually, it seems to be the case in the installation directory of cmake itself, where a subdirectory named "Modules" contains both functions and scripts for the find_package function. 

Does it make sense to separate functions from scripts for the find_package function? 
Is each script a module in CMake, whatever it contains? 
What are the different kinds of scripts/modules: functions, scripts for the find_package function, configuration files, what else? 

Thank you for your help! 

Cédric 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150520/ab80cf48/attachment.html>


More information about the CMake mailing list