As noted on the wiki <a href="http://www.cmake.org/Wiki/CMake_Useful_Variables">http://www.cmake.org/Wiki/CMake_Useful_Variables</a><br><br>&quot;Note that CMAKE_BUILD_TYPE is not initialized with a readable value at
configuration time. This is because the user is free to select a build
type at build time. Use CMAKE_CFG_INTDIR if you need a variable that
evaluates to the correct build time directory.&quot;<br><br>I do think it is regrettable, however, that CMAKE_BUILD_TYPE has this behavior.&nbsp; An unknowing user would expect it to have a useful value.<br><br>Cheers,<br>Brandon Van Every
<br><br><br><br><div><span class="gmail_quote">On 5/24/07, <b class="gmail_sendername">Won-Ki Jeong</b> &lt;<a href="mailto:graphor@gmail.com">graphor@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I tried that, but it does not seem to work. For example, I tried to<br>set a different build flag as follows:<br><br>IF(CMAKE_BUILD_TYPE MATCHES &quot;Debug&quot;)<br>&nbsp;&nbsp;SET(buildFlag ${buildFlag} -g)<br>ELSE(CMAKE_BUILD_TYPE MATCHES &quot;Debug&quot;)
<br>&nbsp;&nbsp;SET(buildFlag ${buildFlag} -O)<br>ENDIF(CMAKE_BUILD_TYPE MATCHES &quot;Debug&quot;)<br><br>but buildFlag is always set to &quot;-O&quot; no matter which build type I<br>select. Is it because build type is set after CMake creates project
<br>file (for Visual Studio)? Is there any trick to do this?<br>_______________________________________________<br>CMake mailing list<br><a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br><a href="http://www.cmake.org/mailman/listinfo/cmake">
http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>