[CMake] Warning D9025 : overriding '/W3' with '/W4'

Mateusz Loskot mateusz at loskot.net
Wed Jan 20 18:08:17 EST 2010


Philip Lowman wrote:
> On Mon, Jan 18, 2010 at 7:17 PM, Mateusz Loskot <mateusz at loskot.net> wrote:
>>
>> In CMakeLists.txt I have something like this:
>>
>> if(MSVC)
>>  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
>> endif()
>>
>> I configure my build using command prompt of Visual Studio 2005 (8.0):
>>
>> D:\dev\geos\_svn\build-nmake>cmake -G "NMake Makefiles" ..\trunk
>>
>> and the compiler flags look as follows:
>>
>> CMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR /W4 /MP
>>
>> I build and I'm getting D9025 warning:
>>
>> D:\dev\geos\_svn\build-nmake> nmake
>>
>> Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
>> Copyright (C) Microsoft Corporation.  All rights reserved.
>>
>> [  0%] Building CXX object src/CMakeFiles/geos.dir/algorithm/Angle.cpp.obj
>> cl : Command line warning D9025 : overriding '/W3' with '/W4'
>>
>>
>> Would it be possible to get rid of this warning with some CMake magic?
> 
> 
> Yes, you can use a regular expression to search and replace the
> contents of CMAKE_CXX_FLAGS "/W3" (or /W[0-9]) with /W4... see
> string(REGEX REPLACE...) in the docs.

The string manipulation does the trick for me, big thanks!


Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org


More information about the CMake mailing list