[CMake] COMPILE_DEFINITIONS

John Drescher drescherjm at gmail.com
Tue Dec 11 14:32:46 EST 2012


On Tue, Dec 11, 2012 at 2:24 PM, John Drescher <drescherjm at gmail.com> wrote:
> My goal is to a specific definition to the Debug and RelWithDebInfo
> configurations for all targets in the project but not to the Release
> configuration when using VisualStudio. I believe that
> COMPILE_DEFINITIONS<CONFIG> appears to support this however I am
> unsure if I have to get the previous value of the COMPILE_DEFINITIONS
> before setting the new value?
>


It looks like

set_property(
    DIRECTORY
    APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG MyDef
)

set_property(
    DIRECTORY
    APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO MyDef
)

is what I am after.

John


More information about the CMake mailing list