[CMake] How to disable specific warnings in VS IDE

Petr Kmoch petr.kmoch at gmail.com
Mon Feb 23 02:25:25 EST 2015


Hi,

Simply pass the appropriate compiler flags to the compiler. The flag in
question is

/wd1234

To disable warning C1234 (more info on MSDN:
https://msdn.microsoft.com/en-us/library/thxezb7y%28v=vs.120%29.aspx )

How you pass them to the compiler depends on what you normally use. The
options are:

Variable CMAKE_CXX_FLAGS
Per-configuration variables CMAKE_CXX_FLAGS_CONFIGNAME
Target or source property COMPILE_FLAGS (space-separated)
Directory or target property COMPILE_OPTIONS (normal list, supports
generator expressions)

Hope this helps.

Petr

On Sat, Feb 21, 2015 at 9:55 PM, llvm 999 <llvm.999 at outlook.com> wrote:

> Hi, I am using cmake to generate build file for a MS Visual Studio
> project/solution.
>
> I would like to get some help in specifying a list of (VC++) compiler's
> warnings so that the generated project file will have the list of warnings
> in the "Disable Specific Warnings" field in the project file.
>
> I have tried for quite a while to figure this out but have no success.
>
> Any help/hint will be very much appreciated.
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150223/7abf0986/attachment.html>


More information about the CMake mailing list