[CMake] Feature Request: Additional directory for customized/private CMake modules

Andreas Pakulat apaku at gmx.de
Fri Apr 3 12:14:45 EDT 2009


On 03.04.09 18:05:37, Dominique Belhachemi wrote:
> I am looking for a more generally solution. I don't want to touch files  
> like CMakeLists.cmake .
>
> Let's compare CMake with pkgconfig. A package containing a library is  
> responsible to put a .pc file into /usr/lib/pkgconfig/
>
> "File"                                   "Packages"
> /usr/lib/pkgconfig/cspi-1.0.pc           libatspi-dev
> /usr/lib/pkgconfig/gtk+.pc               libgtk1.2-dev
> /usr/lib/pkgconfig/json-glib-1.0.pc      libjson-glib-dev
> /usr/lib/pkgconfig/libepc-1.0.pc         libepc-dev
> /usr/lib/pkgconfig/vala-1.0.pc           libvala-dev
>
> For cmake this could look like this:
> "File"                                     "Packages"
> /usr/lib/cmake/Findcspi.cmake              libatspi-dev
> /usr/lib/cmake/Findgtk+.cmake              libgtk1.2-dev
> /usr/lib/cmake/Findjson-glib.cmake         libjson-glib-dev
> /usr/lib/cmake/Findlibepc.cmake            libepc-dev
> /usr/lib/cmake/Findvala.cmake              libvala-dev
>
> It would be nice to let CMake search for Modules in this directory per 
> default additionally to CMake's standard module
> directory.

Thats already supported in CMake 2.6 (IIRC you'd want 2.6.2 to have the
important related bugs fixed), see find_package()'s Config mode in the
cmake manpage. The packages in question provide a
<libdir>/cmake/<packagename>/<packagename>Config.cmake file which sets up
all the needed things. 

Andreas

-- 
Stay away from hurricanes for a while.


More information about the CMake mailing list