Configure fmt.pc library name correctly.

This commit is contained in:
Attila Mark 2020-01-24 19:39:01 -08:00
parent fcd72eb81b
commit e4d5fbc913
2 changed files with 10 additions and 1 deletions

View File

@ -178,6 +178,15 @@ set_target_properties(fmt PROPERTIES
VERSION ${FMT_VERSION} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}
DEBUG_POSTFIX d)
# Configure pkg-config fmt.pc properly
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
get_target_property(_FMT_LIB_POSTFIX ${PROJECT_NAME_LOWER} DEBUG_POSTFIX)
set(FMT_LIB_NAME ${PROJECT_NAME_LOWER}${_FMT_LIB_POSTFIX})
else()
set(FMT_LIB_NAME ${PROJECT_NAME_LOWER})
endif()
if (BUILD_SHARED_LIBS)
if (UNIX AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
# Fix rpmlint warning:

View File

@ -6,6 +6,6 @@ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: fmt
Description: A modern formatting library
Version: @FMT_VERSION@
Libs: -L${libdir} -lfmt
Libs: -L${libdir} -l@FMT_LIB_NAME@
Cflags: -I${includedir}