[CMake] project() and SLN files

James Bigler jamesbigler at gmail.com
Fri Jul 3 15:54:23 EDT 2009


On Wed, Jul 1, 2009 at 4:34 PM, Robert Dailey <rcdailey at gmail.com> wrote:

> Hi,
> If I have the following CMakeLists.txt:
>
> cmake_minimum_required( VERSION 2.6.4 )
>
> project( project1 )
> add_executable( project1 source1.cpp )
>
> project( project2 )
> add_executable( project2 source2.cpp )
>
> project( project3 )
> add_executable( project3 source3.cpp )
>
> If I create visual studio 2008 files with this, I end up getting the
> following project files:
>
> project1.vcproj
> project2.vcproj
> project3.vcproj
> project3.sln
>
> The problem here is that I want the SLN file to be named project1.sln
> (after the first call to project() ). Is there a way I can tell CMake which
> call to project() in the same directory will generate the "master" project
> file? Note that if I add a dummy project to the end of the file:
>
> project( foo )
>
> I get:
> project1.vcproj
> project2.vcproj
> project3.vcproj
> foo.sln
>
> So it gives me some limited control over the naming, but it isn't ideal.
>
>
I typically only do one project in my setups, and I name the project what I
want to show up in VS.  I then have lots of add_executables and other
targets that show up as "projects" in the VS solution.  I'm not sure what
you are trying to gain by having lots of project() calls.

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090703/626a6005/attachment.htm>


More information about the CMake mailing list