[CMake] Fwd: Targets organisation of complex project

Mateusz Loskot mateusz at loskot.net
Mon Oct 12 17:31:53 EDT 2009


Chris Foster wrote:
> Mateusz: You may find the example layout I've attached useful if you're not
> needing to do code generation (just delete all the stuff to do with
> hello2.cpp).

Yes, it's very helpful ineed.
However, I'm generating some config headers (porting
autotools' approach: project.h.in -> project.h) but as I've learned
CMake can do the job well.

> You might also consider pulling definitions from the
> subdirectories into the base CMakeLists.txt using something like
> 
>   get_directory_property(libA_srcs DIRECTORY libA DEFINITION srcs)
> 
> rather than pushing them from the subdirectories into the base scope with
> set(... PARENT_SCOPE)

Interesting trick. Thanks!

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org


More information about the CMake mailing list