[CMake] Tips on cmake with git submodules?

Andreas Pakulat apaku at gmx.de
Fri Jan 14 18:40:34 EST 2011


On 14.01.11 14:56:22, James C. Sutherland wrote:
> The recent thread on ctest and git submodules made me start considering
> using submodules in a few projects.  My question is how to integrate the two
> build systems (both cmake based).
> 
> Right now I do a find_package() to resolve the dependent library.  If I move
> to a submodule, and both the superproject and subproject are cmake-based, is
> there any recipe for how to make them play nice?

add_subdirectory() and build the submodule as part of the superproject.
Make sure that the submodule also builds standalone and is not
influenced by stuff set in the super-project (move the add_subdirectory
to the top of the cmakelists.txt). Thats all I can think of right now.

Andreas

-- 
Don't tell any big lies today.  Small ones can be just as effective.


More information about the CMake mailing list