On 25/06/2011 07:30, "Michael Hertling" <mhertl...@online.de> wrote:

>On 06/24/2011 04:16 PM, Owen Shepherd wrote:
>> I think the appropriate solution here is a project-specific dialect
>>flag -
>> perhaps one taking options in the GNU format since it seems most
>>familiar.
>> One could perhaps generalise this further - a file-specific dialect flag
>> which defaults to the value of the project-specific flag
>
>If there are individual compilers for C89/C99, and a projects needs a
>C99 one, any dialect flags - project/directory/target/file specific -
>would be of no use, wouldn't they? Rather, one must specify the C99
>compiler if it isn't found automatically by CMake during the initial
>configuration, and the project might consider to check the compiler's
>C99 capabilities.

Sorry - I should have said property rather than flag. That is, something
along the lines of
        set_target_properties(the_target PROPERTIES C_DIALECT C99)
Or
        set_source_files_properties(myfile.c PROPERTIES C_DIALECT C99)

(I'm not entirely sure here whether the source file property should be
C_DIALECT or just DIALECT. The language, after all, should be unambiguous
at this point)

It would then be the responsibility of the Cmake machinery to choose the
right compiler and set it up for building code with the given dialect.

-- Owen Shepherd
http://www.owenshepherd.net
owen.sheph...@e43.eu (general) / oshephe...@shef.ac.uk (academic)




_______________________________________________
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