Thanks for the information!<br><br><div class="gmail_quote">On Tue, May 22, 2012 at 3:27 PM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It is customary, but not enforced, to have only one project command in a CMakeLists.txt file.<div><br></div><div>The project command maps to generated *.sln files for the Visual Studio generators.</div>
<div><br></div><div>
All targets defined after the project command in the same CMakeLists.txt file, or any included by virtue of add_subdirectory, will appear in the *.sln file that corresponds to that project command.</div><div><br></div><div>
To prevent this, simply organize things differently.<br><br></div><div>There's no way with existing CMake to undefine a project or target.</div><div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div>
<div><br><div class="gmail_quote"><div><div class="h5">On Tue, May 22, 2012 at 2:49 PM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi,<div><br></div><div>I was wondering if there is a way to undefined a project(). I want to do this to prevent projects from being included in a solution when I generate for Visual Studio. Example:</div><div><br></div><div>
project( A )</div><div>add_executable( A a.cpp )</div><div>project( B )</div><div>add_executable( B b.cpp )</div><div>add_executable( C c.cpp )</div><div><br></div><div>I don't want B to be in A's solution when I open A.sln. I'm assuming this is the behavior, unless project(B) call cancels out project(A)?</div>
<div><br></div><div>Also, I don't want project C to appear in either A or B solutions.</div><div><br></div><div>The reason why I'm doing this is because I have setup my CMake scripts to allow a solution file to be generated for executables (so I can open each executable solution in different instances of visual studio, with ONLY that executable + dependency projects in it). However, since sometimes multiple executable projects can be defined in the same directory, or other libraries that aren't a dependency of that executable, I do not want those to be included in the project().</div>
<br></div></div><span class="HOEnZb"><font color="#888888">--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></font></span></blockquote></div><br></div>
</blockquote></div><br>