[CMake] Build several libraries with different compilation flags

Ryan Pavlik rpavlik at iastate.edu
Fri Oct 1 10:14:37 EDT 2010


  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
>
>

-- 
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

Member, ACM and ACM SIGCHI
Member, ASME

http://academic.cleardefinition.com



More information about the CMake mailing list