Browse Source

Avoid duplicating the `lib` prefix in the pkg-config file

This is in accordance with omitting the `lib` prefix of the target if the
project name already starts with `lib`.
charconv
Martchus 1 year ago
parent
commit
7fb2a9ed73
  1. 4
      cmake/modules/LibraryTarget.cmake

4
cmake/modules/LibraryTarget.cmake

@ -375,8 +375,10 @@ macro (compute_dependencies_for_package_config DEPENDS OUTPUT_VAR_PKGS OUTPUT_VA
endmacro ()
compute_dependencies_for_package_config(META_PUBLIC_LIB_DEPENDS META_PUBLIC_PC_PKGS META_PUBLIC_LIB_DEPENDS_FOR_PC YES)
compute_dependencies_for_package_config(META_PRIVATE_LIB_DEPENDS META_PRIVATE_PC_PKGS META_PRIVATE_LIB_DEPENDS_FOR_PC YES)
if (NOT META_HEADER_ONLY_LIB)
set(META_PUBLIC_LIB_DEPENDS_FOR_PC " -l${META_TARGET_NAME}${META_PUBLIC_LIB_DEPENDS_FOR_PC}")
string(REGEX REPLACE "^lib" "" META_TARGET_NAME_FOR_PC "${META_TARGET_NAME}")
set(META_PUBLIC_LIB_DEPENDS_FOR_PC " -l${META_TARGET_NAME_FOR_PC}${META_PUBLIC_LIB_DEPENDS_FOR_PC}")
endif ()
if (META_PUBLIC_LIB_DEPENDS_FOR_PC)
set(META_PUBLIC_LIB_DEPENDS_FOR_PC " -L\${libdir}${META_PUBLIC_LIB_DEPENDS_FOR_PC}")

Loading…
Cancel
Save