diff --git a/CMLibCodeCoverage.cmake b/CMLibCodeCoverage.cmake index 2277a43..5ce4869 100644 --- a/CMLibCodeCoverage.cmake +++ b/CMLibCodeCoverage.cmake @@ -7,7 +7,7 @@ function(add_code_coverage target) if(CMLIB_ENABLE_CODE_COVERAGE) if(CMAKE_CXX_COMPILER_IS_GCC) target_compile_options(${target} PUBLIC "--coverage") - set_property(TARGET ${target} APPEND PROPERTY LINK_FLAGS "--coverage") + set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " --coverage") if(LCOV_EXE) add_custom_target( diff --git a/CMLibCommonTargetProperties.cmake b/CMLibCommonTargetProperties.cmake index 514bfd3..07f36b9 100644 --- a/CMLibCommonTargetProperties.cmake +++ b/CMLibCommonTargetProperties.cmake @@ -51,7 +51,7 @@ function(common_target_properties target) endif() endif() if(CMAKE_CXX_COMPILER_IS_GCC AND NOT APPLE) - set_property(TARGET ${target} APPEND PROPERTY LINK_FLAGS "-Wl,--no-as-needed") + set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--no-as-needed") endif() endif() @@ -61,10 +61,10 @@ function(common_target_properties target) check_cxx_compiler_flag(-fno-fat-lto-objects CXX_HAS_NO_FAT_LTO_FLAG) if(CXX_HAS_LTO_FLAG) target_compile_options(${target} PUBLIC "-flto") - set_property(TARGET ${target} APPEND PROPERTY LINK_FLAGS "-flto") + set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " -flto") if(CXX_HAS_NO_FAT_LTO_FLAG) target_compile_options(${target} PUBLIC "-fno-fat-lto-objects") - set_property(TARGET ${target} APPEND PROPERTY LINK_FLAGS "-fno-fat-lto-objects") + set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " -fno-fat-lto-objects") endif() endif() endif()