[CMake] Adding a project to a solution.

KSpam keesling_spam at cox.net
Thu Oct 25 11:44:49 EDT 2007


Joe,

You will receive a solution file in any directory that contains a PROJECT 
command.  Additionally, the solution file will contain all of the subprojects 
in it.  In your example, I would add PROJECT(MyTestProject) to 
Test/CMakeLists.txt, and I would add PROJECT(Library) to 
Test/Library/CMakeLists.txt.  If you do this, you will end up with 
MyTestProject.sln, which will contain rules to build "Library" and "Project".  
Additionally, you will have Library.sln and Project.sln in their respective 
subdirectories in the build tree.

Hope this helps!

Justin

On Thursday 25 October 2007 08:19:36 Josef Karthauser wrote:
> Hi there again J,
>
>
>
> With respect to the Visual Studio generators, I'm wondering what logic
> cmake uses to determine which projects to add to the solution file.  I
> had assumed that anything which was linked as a library was
> automatically added, but it isn't.  Is there an easy way of adding
> dependences from sibling directories to a solution?
>
>
>
> Example,
>
>
>
>    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?
>
>
>
> Thanks J
>
> Joe


More information about the CMake mailing list