<div dir="ltr">mkdir build-d<div>cd build-d</div><div>cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=out ../your/source/procject</div><div>cmake --build . </div><div>cd ..</div><div><br></div><div>mkdir build-r<div>cd build-r</div><div>cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out ../your/source/procject</div><div>cmake --build . --target install</div><div>cd ..</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 25, 2015 at 1:16 AM, Adam Getchell <span dir="ltr"><<a href="mailto:adam.getchell@gmail.com" target="_blank">adam.getchell@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 dir="ltr">Thanks for your reply.<div><br></div><div>I'm not sure I follow your answer. I do delete the directory each time I build, but I'm still not understanding how you're building release or debug versions to begin with.</div><div><br></div><div>I'm just automatically getting Release, unless I edit CMakeCache.txt after I've built once.</div><div><br></div><div>I just checked CGAL_CreateSingleSourceCGALProgram.cmake which is invoked in my CMakeLists.txt, but I do not see it setting the build type to Release.</div><div><br></div><div><a href="https://github.com/acgetchell/CDT-plusplus/blob/master/CMakeLists.txt" target="_blank">https://github.com/acgetchell/CDT-plusplus/blob/master/CMakeLists.txt</a><br></div><div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 24, 2015 at 12:20 PM, J Decker <span dir="ltr"><<a href="mailto:d3ck0r@gmail.com" target="_blank">d3ck0r@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 dir="ltr">I use a different directory to build release and debug versions....<div><br><div>if you didn't delete, then when it goes to build partial things, the .obj files will still be newer than the .c files and will cause mixed release-debug builds which generally results in bizarre crashes.</div><div>Once chosen, can't change the build type of a build; although if you could it should do a clean also.</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Tue, Feb 24, 2015 at 11:42 AM, Adam Getchell <span dir="ltr"><<a href="mailto:adam.getchell@gmail.com" target="_blank">adam.getchell@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><div dir="ltr">Hello all,<div><br></div><div>I've browsed this thread:</div><div><br></div><div><a href="http://www.cmake.org/pipermail/cmake/2008-September/023808.html" target="_blank">http://www.cmake.org/pipermail/cmake/2008-September/023808.html</a></div><div><br></div><div>But it doesn't work. My project is set to Release regardless, whether I do:</div><div><br></div><div><div>project( CDT-plusplus_ )</div><div>set(CMAKE_BUILD_TYPE RelWithDebInfo)</div></div><div><br></div><div>Or:</div><div><br></div><div><div>#</div><div># If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their definition</div><div># and dump it in the cache along with proper documentation, otherwise set CMAKE_BUILD_TYPE</div><div># to Debug prior to calling PROJECT()</div><div>#</div><div>IF(DEFINED CMAKE_BUILD_TYPE)</div><div>   SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of</div><div>build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug</div><div>Release RelWithDebInfo MinSizeRel.")</div><div>ELSE()</div><div>   SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build,</div><div>options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release</div><div>RelWithDebInfo MinSizeRel.")</div><div>ENDIF()</div><div><br></div><div>project( CDT-plusplus_ )</div></div><div><br></div><div>The only way I can change the build type is by going into my build directory and editing CMakeCache.txt. However, I use an out of source build, so my build directory is generated automatically by scripts such as:</div><div><br></div><div><a href="https://github.com/acgetchell/CDT-plusplus/blob/master/scan-build.sh" target="_blank">https://github.com/acgetchell/CDT-plusplus/blob/master/scan-build.sh</a><br></div><div><br></div><div>What's the correct method for being able to set the type of build via the command line?<span><font color="#888888"><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div>Adam Getchell</div><div><a href="http://about.me/adamgetchell" target="_blank">about.me/adamgetchell</a></div>"Invincibility is in oneself, vulnerability in the opponent." -- Sun Tzu</div></div>
</font></span></div></div>
<br></div></div>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</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>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</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>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div>Adam Getchell</div><div><a href="http://about.me/adamgetchell" target="_blank">about.me/adamgetchell</a></div>"Invincibility is in oneself, vulnerability in the opponent." -- Sun Tzu</div></div>
</div>
</div></div></blockquote></div><br></div>