[CMake] Build several libraries with different compilation flags
Marcel Loose
loose at astron.nl
Fri Oct 1 11:32:19 EDT 2010
Hi Eric,
I'm not sure your solution is going to work. Once your file1, file2, ...
are compiled for building my_lib1, there's reason for CMake to compile
them again for my_lib2, because the object files are already up-to-date.
I guess you'll have a better chance using target_properties, as Ryan
suggested.
HTH,
Marcel Loose.
On Fri, 2010-10-01 at 17:10 +0200, pellegrini wrote:
> Hi Ryan,
>
> Yes, that might be the solution if I wanted to change the compiler flags
> for the whole library but in my case, that is not on the whole
> library that I want to apply a new set of compiler flags but only on a
> small number of files.
>
> Ryan Pavlik a écrit :
> > Look at the target properties instead of the source file properties.
> >
> > Ryan
> >
> > On 10/01/2010 08:27 AM, pellegrini wrote:
> >> Hello everybody,
> >>
> >> I would like to build two libraries that contain the same files but
> >> with a slightly different set of compilation flags
> >> from one library to another. This within the same makefile. I was
> >> thinking about an approach such as:
> >>
> >> add_library(my_lib1, STATIC, src_files ...)
> >> set_source_files_properties(file1, file2 ... PROPERTIES COMPILE_FLAGS
> >> ...)
> >> add_library(my_lib2, STATIC, src_files ...)
> >> set_source_files_properties(file1, file2 ... PROPERTIES COMPILE_FLAGS
> >> ...)
> >>
> >> does cmake sensitive to the order of these instruction ?
> >>
> >> thank you very much
> >>
> >> Eric
> >>
> >>
> >
>
>
More information about the CMake
mailing list