<div>I do something like this (I think it was taken from the VTK CmakeLists.txt file):</div>
<div>&nbsp;</div>
<div>#-----------------------------------------------------------------------------<br># Let&#39;s use the highest warning level.<br>#-----------------------------------------------------------------------------<br>IF(CMAKE_BUILD_TOOL MATCHES &quot;(msdev|devenv|nmake)&quot;)
<br>&nbsp; # Use the highest warning level for visual studio.<br>&nbsp; IF(CMAKE_CXX_FLAGS MATCHES &quot;/W[0-4]&quot;)<br>&nbsp;&nbsp;&nbsp; STRING(REGEX REPLACE &quot;/W[0-4]&quot; &quot;/W4&quot; CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS}&quot;)
<br>&nbsp; ELSE(CMAKE_CXX_FLAGS MATCHES &quot;/W[0-4]&quot;)<br>&nbsp;&nbsp;&nbsp; SET(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} /W4&quot;)<br>&nbsp; ENDIF(CMAKE_CXX_FLAGS MATCHES &quot;/W[0-4]&quot;)<br>&nbsp; IF(CMAKE_C_FLAGS MATCHES &quot;/W[0-4]&quot;)
<br>&nbsp;&nbsp;&nbsp; STRING(REGEX REPLACE &quot;/W[0-4]&quot; &quot;/W4&quot; CMAKE_C_FLAGS &quot;${CMAKE_C_FLAGS}&quot;)<br>&nbsp; ELSE(CMAKE_C_FLAGS MATCHES &quot;/W[0-4]&quot;)<br>&nbsp;&nbsp;&nbsp; SET(CMAKE_C_FLAGS &quot;${CMAKE_C_FLAGS} /W4&quot;)<br>
&nbsp; ENDIF(CMAKE_C_FLAGS MATCHES &quot;/W[0-4]&quot;)<br>&nbsp; # Disable deprecation warnings for standard C functions in VS2005 and later<br>&nbsp; IF(CMAKE_COMPILER_2005)<br>&nbsp;&nbsp;&nbsp; ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
<br>&nbsp; ENDIF(CMAKE_COMPILER_2005)<br>ENDIF(CMAKE_BUILD_TOOL MATCHES &quot;(msdev|devenv|nmake)&quot;)<br>IF(CMAKE_BUILD_TOOL MATCHES &quot;make&quot;)<br>&nbsp; IF(NOT CMAKE_CXX_FLAGS MATCHES &quot;-Wall&quot;)<br>&nbsp;&nbsp;&nbsp; SET(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} -Wall&quot;)
<br>&nbsp; ENDIF(NOT CMAKE_CXX_FLAGS MATCHES &quot;-Wall&quot;)<br>&nbsp; IF(NOT CMAKE_C_FLAGS MATCHES &quot;-Wall&quot;)<br>&nbsp;&nbsp;&nbsp; SET(CMAKE_C_FLAGS &quot;${CMAKE_C_FLAGS} -Wall&quot;)<br>&nbsp; ENDIF(NOT CMAKE_C_FLAGS MATCHES &quot;-Wall&quot;)
<br>ENDIF(CMAKE_BUILD_TOOL MATCHES &quot;make&quot;)<br>&nbsp;</div>
<div>&nbsp;</div>
<div>Andrew</div>
<div><br>&nbsp;</div><br><br>
<div><span class="gmail_quote">On 8/28/07, <b class="gmail_sendername">Michael Wagner</b> &lt;<a href="mailto:michael.wagner@pluto.uni-freiburg.de">michael.wagner@pluto.uni-freiburg.de</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi,<br><br>Whenever I&#39;m compiling, there are no warnings shown.<br>Is there a command or variable that can be used to turn on warnings?
<br><br>When searching the wiki, the only information I found was this page:<br><a href="http://www.cmake.org/Wiki/CMake_Platform_Dependent_Issues">http://www.cmake.org/Wiki/CMake_Platform_Dependent_Issues</a><br>which tells me the right flags for all the different compilers. That is
<br>wonderfull, I just need to know how to turn that stuff on!<br><br>Maybe somebody out there knows how to turn on warnings. (Hopefully you<br>are not all fearless coders that laugh in the face of warnings... ;-)<br><br>
cheers,<br><br>Michael<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><br clear="all"><br>-- <br>___________________________________________<br>Andrew J. P. Maclean<br>Centre for Autonomous Systems<br>The Rose Street Building J04<br>The University of Sydney&nbsp;&nbsp;2006&nbsp;&nbsp;NSW
<br>AUSTRALIA<br>Ph: +61 2 9351 3283<br>Fax: +61 2 9351 7474<br>URL: <a href="http://www.acfr.usyd.edu.au/">http://www.acfr.usyd.edu.au/</a><br>___________________________________________