<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">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">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?<br clear="all"><div><br></div>-- <br><div class="gmail_signature"><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>