[CMake] Adding a project to a solution.

Sylvain Benner benner at virtools.com
Thu Oct 25 11:22:14 EDT 2007


>
> Test/
>
> Library/
>
> Project/
>
> Project uses Library, like so:
>
> Project/CMakeLists.txt:
>
> PROJECT(Project)
>
> TARGET_LINK_LIBRARIES(Project Library)
>
> However Library.vcproj doesn’t show up in Project’s solution file. Can 
> I specify that it should, or do I need to hack code?
>

I think this is not the only solution to achieve your goal but this is 
how we do this here:

PROJECT(top_cmakelists)
ADD_SUBDIRECTORY(Project/CMakeLists.txt)
ADD_SUBDIRECTORY(Library/CMakeLists.txt)

top_cmakelists is the master file passed to cmake for generation, it 
produces no targets, only a solution with all the projects added with 
ADD_SUBDIRECTORY.

--Sylvain


More information about the CMake mailing list