<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div><span style="font-size: 12pt; ">Does that result in building the code 3 times?</span></div><div><span style="font-size: 12pt; ">And why would you need to repeat the install directives?</span></div><div><br></div><div>I've attached a CMakeLists.txt file for an example project that works for me without repeating install directives.</div><div><br></div><div>Clint</div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div dir="ltr">Here's a follow-up.<div><br></div><div>I was unable to get Jean-Christophes modification of Ansis' solution working. (I definitely did not want to repeat the install directives in this rather large project.) The "<span style="font-family:arial,sans-serif;font-size:13px" data-mce-style="font-family: arial,sans-serif; font-size: 13px;">-DCMAKE_BUILD_TYPE" lines don't really accomplish anything when building with Visual Studio. I was making progress but ultimately gave up. Here is where I stopped.</span></div><div><span style="font-family:arial,sans-serif;font-size:13px" data-mce-style="font-family: arial,sans-serif; font-size: 13px;"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px" data-mce-style="font-family: arial,sans-serif; font-size: 13px;">#####</span></div><div><div><span style="font-family:arial,sans-serif" data-mce-style="font-family: arial,sans-serif;">include(ExternalProject)</span><br></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;"><br></span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">ExternalProject_Add(MyProjectDebug</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">&nbsp; PREFIX Debug</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">&nbsp; SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">&nbsp; CMAKE_ARGS -G ${CMAKE_GENERATOR} -D CMAKE_BUILD_TYPE=Debug -D CPACK_BUILD_CONFIG=Debug</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">&nbsp; BUILD_COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR}/Debug/src/MyProjectDebug-build --config Debug</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">&nbsp; )&nbsp;</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;"><br></span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">ExternalProject_Add(MyProjectRelease</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">&nbsp; PREFIX Release</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">&nbsp; SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">&nbsp; CMAKE_ARGS -G ${CMAKE_GENERATOR} -D CMAKE_BUILD_TYPE=Release -D CPACK_BUILD_CONFIG=Release</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">&nbsp; BUILD_COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR}/Release/src/MyProjectRelease-build --config Release</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">&nbsp; )&nbsp;</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;"><br></span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;"><br></span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">set(CPACK_INSTALL_CMAKE_PROJECTS</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">&nbsp; "${CMAKE_BINARY_DIR}/Debug/src/MyProjectDebug-build;MyProject;ALL;/"</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">&nbsp; "${CMAKE_BINARY_DIR}/Release/src/MyProjectRelease-build;MyProject;ALL;/"</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">)</span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;"><br> </span></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">include(CPack)</span></div></div><div><span face="arial, sans-serif" data-mce-style="font-family: arial, sans-serif;" style="font-family: arial, sans-serif;">#####</span></div><div><br></div><div style="" data-mce-style=""><span style="font-family:arial,sans-serif;font-size:13px" data-mce-style="font-family: arial,sans-serif; font-size: 13px;">At this point, the debug build would build in the debug tree and the release build in the release tree. All is well to that point. However, when I would attempt to use CPack with no -C option it would attempt to package Debug from the Release tree. When I would attempt to use CPack with a -C option, it would fail on one or the other (whichever one I did not specify).</span></div><div style="" data-mce-style=""><span style="font-family:arial,sans-serif;font-size:13px" data-mce-style="font-family: arial,sans-serif; font-size: 13px;"><br></span></div><div style="" data-mce-style=""><span style="font-family:arial,sans-serif;font-size:13px" data-mce-style="font-family: arial,sans-serif; font-size: 13px;">I tried a slight fork of the above using the NMake generator instead of the Visual Studio 10 generator but still ran into some issues local to our CMake files. I may try to resolve that next, but if anybody has any hints of where go from here that would be appreciated.</span></div><div style="" data-mce-style=""><span style="font-family:arial,sans-serif;font-size:13px" data-mce-style="font-family: arial,sans-serif; font-size: 13px;"><br></span></div><div style="" data-mce-style=""><span style="font-family:arial,sans-serif;font-size:13px" data-mce-style="font-family: arial,sans-serif; font-size: 13px;">Frankly it seems to me that we should be able to package multiple configs without any of this extra work.</span></div></div><div class="gmail_extra"><br><div><br></div><div class="gmail_quote">On Fri, Feb 8, 2013 at 2:50 AM, Yngve Inntjore Levinsen <span dir="ltr">&lt;<a href="mailto:yngve.levinsen@gmail.com" target="_blank" data-mce-href="mailto:yngve.levinsen@gmail.com">yngve.levinsen@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div><div><div class="h5"><br><div>On 7/2/13 7:54 PM, Patrick Johnmeyer wrote:<br></div><blockquote>On Thu, Feb 7, 2013 at 12:41 PM, Yngve Inntjore Levinsen <span dir="ltr">&lt;<a href="mailto:yngve.levinsen@gmail.com" target="_blank" data-mce-href="mailto:yngve.levinsen@gmail.com">yngve.levinsen@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div>I think you are fighting the tool in any case, because you are asking to build multiple configurations in one build folder (?). Normally you would create one build folder per configuration.. Which I guess is what you are doing today.<br></div></blockquote><div>&nbsp;</div><div>No, the Visual Studio generator is not a "<i>single-configuration generator"</i>.&nbsp;all configurations are bundled into the single generated solution file. This is the standard behavior of CMake under "basic" usage.</div><div><br></div><div>Your solution using ExternalProject looks promising, though, I will try this out. Thanks!</div></div></blockquote></div></div>Aha, I have mostly used the Makefile generator, and never VS, so I didn't know that. I agree, the externalproject trick proposed by Ansis sounds better. Good luck!<br> <br> Cheers,<br> Yngve<br></div></blockquote></div><br></div><br>--<br><div><br></div>Powered by www.kitware.com<br><div><br></div>Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br><div><br></div>Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ<br><div><br></div>Follow this link to subscribe/unsubscribe:<br>http://www.cmake.org/mailman/listinfo/cmake</blockquote><div><br></div></div></body></html>