Add target properties to an existing imported library in CMake

前端 未结 1 524
别跟我提以往
别跟我提以往 2021-01-22 02:25

External project is built by CMake and installed in a directory visible via CMAKE_PREFIX_PATH. As it\'s CMake project, it installs proper .cmake files.

相关标签:
1条回答
  • 2021-01-22 02:42

    Command target_compile_definitions with INTERFACE keyword appends to property INTERFACE_COMPILE_DEFINITIONS but doesn't work with IMPORTED targets. You need to use a command which directly works with the target properties:

    set_property(TARGET _external_lib_name_ APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS FOO_BAR)
    
    0 讨论(0)
提交回复
热议问题