[CMake] how to build two libraries from same sources but with different defines?

Denis Scherbakov denis_scherbakov at yahoo.com
Fri Apr 24 11:53:45 EDT 2009



COMPILE_FLAGS in SET_TARGET_PROPERTIES will allow you to set per-target compile flags and definitions.

Denis


> I am building my library for two different processors arm7
> and arm9.
> devkitArm requeres ARM7 or ARM9 macroses should be defined
> when
> building for any processor. I tried to write
> 
> include_directories(./)
> 
> set(SOURCES
>    src/library.cpp
>    )
> 
>    add_definitions(-DARM7)
>    add_library(sandbox-arm7 ${SOURCES})
>    remove_definitions(-DARM7)
>    add_definitions(-DARM9)
>    add_library(sandbox-arm9 ${SOURCES})
>    remove_definitions(-DARM9)
> 
> but it does not work as expected.



      


More information about the CMake mailing list