<div dir="ltr"><div>I like having something like this.... defines CMAKE_BUILD_TYPE to be a droplist of choices...<br><br>----</div><div><div><br></div>if( NOT CMAKE_CONFIGURATION_TYPES )</div><div><span style="white-space:pre"> </span>set( CMAKE_CONFIGURATION_TYPES debug release )</div><div>endif( NOT CMAKE_CONFIGURATION_TYPES )</div><div><br></div><div>set( CMAKE_BUILD_TYPE release CACHE STRING "Cached cmake build type"  )<br></div><div>set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )</div><div><br></div><div><div><br></div></div><div>-----</div><div><br><a href="https://cmake.org/cmake/help/v3.0/variable/CMAKE_CONFIGURATION_TYPES.html">https://cmake.org/cmake/help/v3.0/variable/CMAKE_CONFIGURATION_TYPES.html</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 31, 2017 at 9:28 PM, Michael Ellery <span dir="ltr"><<a href="mailto:mellery451@gmail.com" target="_blank">mellery451@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 class="HOEnZb"><div class="h5"><br>
<br>
> On Jul 31, 2017, at 8:48 PM, Florian Lindner <<a href="mailto:mailinglists@xgm.de">mailinglists@xgm.de</a>> wrote:<br>
><br>
> Hello<br>
><br>
> ccmake shows CMAKE_BUILD_TYPE as unset. From the compile commands it looks like also nothing like Debug nor Release.<br>
><br>
> Why is there no well-defined default set? How can I set a default?<br>
><br>
> Thanks,<br>
> Florian<br>
> --<br>
><br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>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" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/cmake</a><br>
<br>
<br>
</div></div>my recollection is that an unspecified build type results in a build that has no optimizations and no debug symbols generated. I’m not sure what the motivation for those default flags is. If you want to default to DEBUG, something like this should work:<br>
<br>
    if (NOT CMAKE_BUILD_TYPE)<br>
      set(CMAKE_BUILD_TYPE Debug)<br>
    endif()<br>
<br>
<br>
-MIke<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>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" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/cmake</a></div></div></blockquote></div><br></div>