[CMake] selective compilation according to suffix

Mathias Gaunard mathias.gaunard at ens-lyon.org
Wed May 30 21:43:42 EDT 2012


On 29/05/2012 10:48, Ilias Miroslav wrote:
> Dear CMake experts,
>
> in our project we have some categories of compiler flags, like 'safe flags'-no optimization, 'runtime checking flags', 'profiling flags' and so on.
>
> I would like to have defined own filename extensions according to  specific compilers flags, let say
>
> make VERBOSE=1 source_file.r  compiles source file (C,Fortran,C++) with runtime checking flags
> make VERBOSE=1 source_file.s  creates object  without optimizatin
> make VERBOSE=1 source_file.rs  creates object file with runtime checking flags and without optimization
>
> and make source_file.o makes 'classic' object file.
>
> Any clues, please ?

Just make a macro or function that generates those targets.


More information about the CMake mailing list