Hi Eric, <div><br></div><div>In our different projects, we use an approach similar to this one:</div><div><br></div><div><pre style="word-wrap:break-word;white-space:pre-wrap"># Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  message(STATUS &quot;Setting build type to &#39;Debug&#39; as none was specified.&quot;)
  set(CMAKE_BUILD_TYPE Debug CACHE STRING &quot;Choose the type of build.&quot; FORCE)
  # Set the possible values of build type for cmake-gui
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS &quot;Debug&quot; &quot;Release&quot;
    &quot;MinSizeRel&quot; &quot;RelWithDebInfo&quot;)
endif()</pre></div><div><br></div><div><br></div><div>See <a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=CMakeLists.txt;h=a57fd66ef333fc26bf74fe658c88c3c634f54c3a;hb=HEAD#l12">http://vtk.org/gitweb?p=VTK.git;a=blob;f=CMakeLists.txt;h=a57fd66ef333fc26bf74fe658c88c3c634f54c3a;hb=HEAD#l12</a></div>

<div><br><br>Hth</div><div>Jc</div><div><br><div class="gmail_quote">On Fri, May 11, 2012 at 11:21 AM, pellegrini <span dir="ltr">&lt;<a href="mailto:pellegrini@ill.fr" target="_blank">pellegrini@ill.fr</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
when cmake is run without specifying the build type using -D CMAKE_BUILD_TYPE, it is the Debug mode that is selected as<br>
the default. I would like to find a way to use Release as the default value when the user does not specify any build<br>
type in the cmake command line.<br>
<br>