[CMake] Making it easier for downstreams to use my library

Stephen Kelly steveire at gmail.com
Fri Apr 9 03:53:03 EDT 2010


Hi,

I've just tagged and tarballed a release candidate of Grantlee version 
0.1.0. Grantlee is a Free Software string template system written in Qt and 
using CMake for its build system.[1]

Most of my CMake knowledge is about writing simple CMakeLists.txt files to 
consume other libraries. Writing the necessary CMake files to so that 
downstreams can use my library is harder and I'm not sure I've done it 
right.

I'd appreciate some review of the CMake stuff if anyone has the time and 
inclination. 

In particular, I'm not sure I'm doing the GrantleeUse.cmake file stuff 
correctly. I'm include()ing the Use file in my CMakeLists.txt file so that I 
can use its macros. Is that the usual way to do these things?[3]

Also, the GrantleeConfig.cmake file looks wrong to me, but I don't know the 
right way to implement it. There's a lot of if(UNIX) etc for things which 
CMake must already know. I believe the solution I need there is importing 
and exporting the library, but I haven't figured out how to do it. [3]

I'd like to know if any of this stuff should be a release blocker for me or 
will cause problems down the line, and get some information of what I'm 
doing wrong or what I could be doing better. Otherwise I'll probably make 
the 0.1.0 release as-is and fix the ugly-but-works stuff later.

All the best,

Steve.


[1] http://www.grantlee.org
[2] 
http://gitorious.org/grantlee/grantlee/blobs/master/cmake/modules/GrantleeUse.cmake
[3] 
http://gitorious.org/grantlee/grantlee/blobs/master/cmake/modules/GrantleeConfig.cmake.in



More information about the CMake mailing list