<div>I do something like this (I think it was taken from the VTK CmakeLists.txt file):</div>
<div> </div>
<div>#-----------------------------------------------------------------------------<br># Let's use the highest warning level.<br>#-----------------------------------------------------------------------------<br>IF(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv|nmake)")
<br> # Use the highest warning level for visual studio.<br> IF(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")<br> STRING(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
<br> ELSE(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")<br> SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")<br> ENDIF(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")<br> IF(CMAKE_C_FLAGS MATCHES "/W[0-4]")
<br> STRING(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")<br> ELSE(CMAKE_C_FLAGS MATCHES "/W[0-4]")<br> SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")<br>
ENDIF(CMAKE_C_FLAGS MATCHES "/W[0-4]")<br> # Disable deprecation warnings for standard C functions in VS2005 and later<br> IF(CMAKE_COMPILER_2005)<br> ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
<br> ENDIF(CMAKE_COMPILER_2005)<br>ENDIF(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv|nmake)")<br>IF(CMAKE_BUILD_TOOL MATCHES "make")<br> IF(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")<br> SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
<br> ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")<br> IF(NOT CMAKE_C_FLAGS MATCHES "-Wall")<br> SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")<br> ENDIF(NOT CMAKE_C_FLAGS MATCHES "-Wall")
<br>ENDIF(CMAKE_BUILD_TOOL MATCHES "make")<br> </div>
<div> </div>
<div>Andrew</div>
<div><br> </div><br><br>
<div><span class="gmail_quote">On 8/28/07, <b class="gmail_sendername">Michael Wagner</b> <<a href="mailto:michael.wagner@pluto.uni-freiburg.de">michael.wagner@pluto.uni-freiburg.de</a>> 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'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 2006 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>___________________________________________