[CMake] How to set different compiler flags for two projects in one solution

Tyler Roscoe tyler at cryptio.net
Mon Jun 22 11:52:41 EDT 2009


On Mon, Jun 22, 2009 at 01:11:25PM +0200, ariasgore at gmx.de wrote:
> I have two projects in my solution where Project B depends on Project A.
> Unfortunately Project B requires completely different properties. I
> know that I can use SET_TARGET_PROPERTIES to add my specific compiler
> and linker flags but how can I remove specific compiler and linker
> flags for only target B?

I would use get_target_properties(), followed by string(REPLACE ...),
followed by set_target_properties(). Will that strategy work for you?

tyler


More information about the CMake mailing list