FindPkgConfig with set_target_properties is unusable for setting CFLAGS/LDFLAGS
问题 pkg_check_modules from FindPkgConfig gives MYLIBRARY_LDFLAGS and MYLIBRARY_CFLAGS that are ordinary CMake lists (with semicolon-separator). The set_target_properties and set_property accept just one string. So that doesn't work because it doesn't expand the list: set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY LINK_FLAGS ${MYLIBRARY_LDFLAGS}) This gives same thing with the semicolons inside: set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY LINK_FLAGS "${MYLIBRARY_LDFLAGS}") set_target