[Cmake] Determining host compiler/OS from CMake

William A. Hoffman bill.hoffman at kitware.com
Mon Mar 4 18:07:36 EST 2002


Seems a bit too specific.   You can do the same with an IF statement.
You may want to add the flags to one file for another reason than the type 
of compiler.

I guess we could have something like this:

SOURCE_FILES_FLAGS("-flag -flag2" file1 file2 VARIABLE)
Where VARIABLE is optional, but if present and true then the flags are added.
So you could do:
SOURCE_FILES_FLAGS("-flag -flag2" file1 file2 CMAKE_COMPILER_IS_GNUCXX)


-Bill


At 02:46 PM 3/4/2002 -0500, Andy Cedilnik wrote:
>Ok, how about:
>SOURCE_FILES_FLAGS("gcc" -Dfoobar file1 file2)
>which means add flag -Dfoobar to gcc compiler. If compiler is aCC don't do
>anything.
>
>                         Andy
>
>At 02:31 PM 3/4/2002 -0500, Bill Hoffman wrote:
>>This is more than adding a -D, it can be used to add any arbitrary flag
>>to the compiler on a per file basis.
>>
>>-Bill
>>
>>
>>At 02:25 PM 3/4/2002 -0500, Andy Cedilnik wrote:
>> >At 02:16 PM 3/4/2002 -0500, Bill Hoffman wrote:
>> >>I have just added per file flags with the command:
>> >>
>> >>SOURCE_FILES_FLAGS("-Dfoobar" file1 file2 ...)
>
>
>_______________________________________________
>Cmake mailing list
>Cmake at public.kitware.com
>http://public.kitware.com/mailman/listinfo/cmake





More information about the CMake mailing list