>> foreach(x IN LISTS mysrcs)
>> message("at ${x}")
>> set_property(SOURCE x APPEND PROPERTY COMPILE_DEFINITIONS
>> "TEST1;TEST2;")
>
> almost there but you forgot to take value of 'x'
>
> set_property(SOURCE ${x} APPEND PROPERTY COMPILE_DEFINITIONS "TEST1;TEST2;")
>
> works fo
Le jeu. 23 août 2018 à 19:18, George PF a écrit :
> > > However, whatever I write into 'set_property()' - no APPEND, single
> entry,
> > > not quoted - does not end up
> > > on the compiler command line. Is there a type mismatch which is
> silently
> > > ignored?
> > >
> >
> > Or you are doing th
> > However, whatever I write into 'set_property()' - no APPEND, single entry,
> > not quoted - does not end up
> > on the compiler command line. Is there a type mismatch which is silently
> > ignored?
> >
>
> Or you are doing this in a directory which is not the one where the target
> is defined
Le jeu. 23 août 2018 à 18:31, George PF a écrit :
> Thank you for the precise pointers, I added to the same CMakeLists.txt:
>
> get_property(mysrcs TARGET mylib PROPERTY SOURCES)
>
> foreach(x IN LISTS mysrcs)
> message("at ${x}")
> set_property(SOURCE x APPEND PROPERTY CO
Thank you for the precise pointers, I added to the same CMakeLists.txt:
get_property(mysrcs TARGET mylib PROPERTY SOURCES)
foreach(x IN LISTS mysrcs)
message("at ${x}")
set_property(SOURCE x APPEND PROPERTY COMPILE_DEFINITIONS
"TEST1;TEST2;")
#set_source_files_pr
Le jeu. 23 août 2018 à 13:02, George PF a écrit :
> Hello,
>
> following "modern cmake" conventions I want to create a library where
> every single file is compiled with an individual define (-D_fileX_,
> required for a macro which integrates code into every translation unit).
>
> So following th
Hello,
following "modern cmake" conventions I want to create a library where every
single file is compiled with an individual define (-D_fileX_, required for a
macro which integrates code into every translation unit).
So following this
add_library(mylib SHARED file1.c file2.c)
target_l