[CMake] "rule" to generate assembler listings for each c file

Arne Pagel arne at pagelnet.de
Mon Jan 11 16:32:07 EST 2010


Hi Luca,
thank you for the idea, I will try it.
It looks if this could help me, even if I don't understand every command in detail.
I think I wouldn't have brought this out with reading the docs.

best regards
Arne


Luca Cappa schrieb:
> Hi Arne,
> 
> I think this cmake script shows what you need to do to add a compiler 
> flag for each source file.
> It adds a dummy flag "/flagadded:FILE_NAME" for each source file 
> according to its name.
> 
> project(flags_per_file)
> cmake_minimum_required(VERSION 2.6)
> 
> set(SOURCES x1.c x2.c x3.c)
> add_executable(executable ${SOURCES})
> 
> foreach(FILE ${SOURCES})
>   set_source_files_properties (${FILE}
>       PROPERTIES
>       COMPILE_FLAGS "/flagadded:${FILE}")
>   message("${FILE} -->> /flagadded:${FILE}")
> endforeach(FILE in ${SOURCES})



More information about the CMake mailing list