[CMake] Settings different compile options for diff. files in same folder..

Denis Scherbakov denis_scherbakov at yahoo.com
Thu May 14 05:34:49 EDT 2009



> I have a folder in which there are 5 files
> folder
>  ...
> Out of these from 4th and 5th iam making a library if iam
> working on windows else with the rest three iam building one
> library for the folder.

Does the follwoing work?

SET (MAIN_SRCS
     a1.c
     a2.c
     a3.c
)

SET (ADD_SRCS
     a4.c
     a5.c
)

SET_SOURCE_FILES_PROPERTIES(${MAIN_SRCS} PROPERTIES COMPILE_FLAGS "whatever I want")
SET_SOURCE_FILES_PROPERTIES(${ADD_SRCS} PROPERTIES COMPILE_FLAGS "more I want")

ADD_LIBRARY(Library ${MAIN_SRCS} ${ADD_SRCS})



      


More information about the CMake mailing list