<div class="gmail_quote">On Fri, Jul 3, 2009 at 2:54 PM, James Bigler <span dir="ltr"><<a href="mailto:jamesbigler@gmail.com">jamesbigler@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Wed, Jul 1, 2009 at 4:34 PM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a>></span> wrote:<br></div></div><div class="gmail_quote">
<div><div></div><div class="h5"><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
Hi,<div><br></div><div>If I have the following CMakeLists.txt:</div><div><br></div><div><div><font face="'courier new', monospace">cmake_minimum_required( VERSION 2.6.4 )</font></div><div><font face="'courier new', monospace"><br>
</font></div><div><font face="'courier new', monospace">project( project1 )</font></div><div><font face="'courier new', monospace">add_executable( project1 source1.cpp )</font></div>
<div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">project( project2 )</font></div><div><font face="'courier new', monospace">add_executable( project2 source2.cpp )</font></div>
<div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">project( project3 )</font></div><div><font face="'courier new', monospace">add_executable( project3 source3.cpp )</font></div>
<div><br></div><div>If I create visual studio 2008 files with this, I end up getting the following project files:</div><div><br></div><div>project1.vcproj</div><div>project2.vcproj</div><div>project3.vcproj</div><div>project3.sln</div>
<div><br></div><div>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:</div>
<div><br></div><div><font face="'courier new', monospace">project( foo )</font></div><div><font face="'courier new', monospace"><br></font></div>I get:</div>
<div>project1.vcproj</div><div>project2.vcproj</div><div>project3.vcproj</div><div>foo.sln</div><div><br></div><div>So it gives me some limited control over the naming, but it isn't ideal.</div>
<br></blockquote></div></div><div><br>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.</div>
</div></blockquote><div><br></div><div>What you are doing sounds like:</div><div><br></div><div><div>project( foo )</div><div>add_library( foo STATIC foo1.cpp )</div><div>add_library( foo STATIC foo2.cpp )</div><div>add_library( foo STATIC foo3.cpp )</div>
</div><div> </div><div>Is this true? If it is, you can't do this in v2.6.4. CMake will fail because you are creating multiple libraries with the same name. What exactly is it you are doing?</div></div>