[CMake] RES: Specify compiler flags for only one file

Renan Greinert renan.greinert at totvs.com.br
Thu Oct 20 13:03:48 EDT 2011


Thank you Alex!

 

 

>set_source_files_properties(... COMPILE_FLAGS ... ) should do it.
> 
>Alex

 

 

On Wednesday 19 October 2011, Renan Greinert wrote:
>> Hello everybody,
>> 
>> 
>> 
>> I have a simple Project like this:
>> 
>> set(PROJ_SOURCES
>> 
>>   main.cpp
>> 
>>   manager.cpp
>> 
>>   exceptionhandler.cpp
>> 
>>   sqlite3.c )
>> 
>> 
>> 
>> #and the following flags for visual studio
>> 
>> set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} /EHsc /Oi /Ot /GF /GS- /W4")
>> 
>> 
>> 
>> The problem is that we want to compile with warnings level 4 (/W4), but
we
>> have 3rd part files (sqlite3.c in the example) and it throws thousands of
>> warnings. So, only that file, I'd like to compile with /W0 param.
>> 
>> 
>> Is it possible to do that with CMake?
 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111020/71084f84/attachment.htm>


More information about the CMake mailing list