Our normal coding standards requires zero warnings with -wall -wextra  
(gcc/clang), but often the swig generated file has warnings.   We don't mind 
turning these warnings off for the generated file, but we still want to see 
them for other files in the project.  However I'm stumped on how to do this.

Currently I have

ADD_DEFINITIONS(-Wno-unused-parameter ...)

 which works but it disables the warning for non-generated files as well.

I understand the right way to do this is by:

Set_source_files_property(filename PROPERTIES COMPILE_FLAGS 
"-Wno-unused-parameter  ...")

However I don't have filename.  Instead I have myInputfile.i, which gets turns 
into something like myInputFilePYTHON_wrap.cxx.  Of course I can generate this 
name, but that seems fragile: if cmake desides to change the file mangling in 
the future I need to change my algorithm.

So the question is either: is there are good way to get the generated filename, 
or is there a different way I should be doing this?


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to