How to create a C #define for a certain target using CMake?

后端 未结 3 1745
面向向阳花
面向向阳花 2020-12-30 01:45

I feel a little stupid right now. After recently converting a few smaller projects to use CMake, I decided to also get rid of a few \"Platform_Config.h\" files. These files

3条回答
  •  轮回少年
    2020-12-30 02:27

    In case you want to set defines per target: Since 2.8.11 you can use target_compile_definitions.

    In earlier versions you probably don't want to use set_target_properties as is, since it overwrites any defines you set previously. Call get_target_property first instead, then merge with previous values. See add_target_definitions here.

提交回复
热议问题