diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2019-03-16 10:13:46 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-03-16 10:14:00 (GMT) |
commit | 0bd2e3aa5747f455971e1bf5960a2a623327e5cd (patch) | |
tree | f622a047bad982afa39deb47e7d729a7a4622692 /Modules | |
parent | 49f606f3bbce969a4fc79e0be5bdcb690c78c959 (diff) | |
parent | b759fa9b8e2fa8ac93e4b57a0e09fcdc5e0e50af (diff) | |
download | CMake-0bd2e3aa5747f455971e1bf5960a2a623327e5cd.zip CMake-0bd2e3aa5747f455971e1bf5960a2a623327e5cd.tar.gz CMake-0bd2e3aa5747f455971e1bf5960a2a623327e5cd.tar.bz2 |
Merge topic 'pkg-config-linker-flags'
b759fa9b8e FindPkgConfig: Set linker flags on imported targets
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3082
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindPkgConfig.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index e192426..cf0ae09 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -242,7 +242,7 @@ endfunction() function(_pkg_create_imp_target _prefix _imp_target_global) # only create the target if it is linkable, i.e. no executables if (NOT TARGET PkgConfig::${_prefix} - AND ( ${_prefix}_INCLUDE_DIRS OR ${_prefix}_LINK_LIBRARIES OR ${_prefix}_CFLAGS_OTHER )) + AND ( ${_prefix}_INCLUDE_DIRS OR ${_prefix}_LINK_LIBRARIES OR ${_prefix}_LDFLAGS_OTHER OR ${_prefix}_CFLAGS_OTHER )) if(${_imp_target_global}) set(_global_opt "GLOBAL") else() @@ -258,6 +258,10 @@ function(_pkg_create_imp_target _prefix _imp_target_global) set_property(TARGET PkgConfig::${_prefix} PROPERTY INTERFACE_LINK_LIBRARIES "${${_prefix}_LINK_LIBRARIES}") endif() + if(${_prefix}_LDFLAGS_OTHER) + set_property(TARGET PkgConfig::${_prefix} PROPERTY + INTERFACE_LINK_OPTIONS "${${_prefix}_LDFLAGS_OTHER}") + endif() if(${_prefix}_CFLAGS_OTHER) set_property(TARGET PkgConfig::${_prefix} PROPERTY INTERFACE_COMPILE_OPTIONS "${${_prefix}_CFLAGS_OTHER}") |