[CMake] Setting the C dialect

Filipe Sousa filipe at ipb.pt
Wed Nov 1 10:46:37 EST 2006


Mattias Holm wrote:
> Hi there,
> 
> I am new to the list, so excuse me if this has been asked before.
> 
> I am trying to figure out if there is a good way of setting the  
> language dialect that you are using. For example, I am working with a  
> project written in C99, and thus I need to specify this.
> 
> Sure enough, I can use SET_SOURCE_FILES_PROPERTIES and set the  
> compile flags for every C-file to -std=c99/gnu99 and at least that  
> will work with GCC. Is there any way to do this portably, and without  
> setting the compile flags on every source file?


IF(CMAKE_COMPILER_IS_GNUCC)
  SET(CMAKE_C_FLAGS -std=c99)
ENDIF()

-- 
Filipe Sousa

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://public.kitware.com/pipermail/cmake/attachments/20061101/943c32ec/signature.pgp


More information about the CMake mailing list