Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong library name in fmt.pc when building Debug. #1264

Closed
ambitslix opened this issue Aug 12, 2019 · 4 comments
Closed

Wrong library name in fmt.pc when building Debug. #1264

ambitslix opened this issue Aug 12, 2019 · 4 comments

Comments

@ambitslix
Copy link
Contributor

The wrong library name is configured in fmt.pc file when with CMAKE_BUILD_TYPE=Debug.

As a result

$pkg-config --libs fmt

Returns -lfmt however the library name is actually "fmtd". The solution is to configure fmt.pc via variable. For example
...
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
library=@FMT_LIBRARY_NAME@

Name: fmt
Description: A modern formatting library
Version: @FMT_VERSION@
Libs: -L${libdir} -l${library}
Cflags: -I${includedir}

Alternately change:

CMakeLists.txt:183

set_target_properties(fmt PROPERTIES
VERSION ${FMT_VERSION} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}
DEBUG_POSTFIX d)

It seems unnecessary to have different names for library builds?

@vitaut
Copy link
Contributor

vitaut commented Aug 14, 2019

fmt.pc currently expects that the release version of the library is installed. If you want to add support for debug libraries there, please submit a PR.

It seems unnecessary to have different names for library builds?

It is convenient to distinguish between debug and release versions of the library and it allows placing them in one directory.

@vitaut vitaut closed this as completed Aug 14, 2019
@ambitslix
Copy link
Contributor Author

ambitslix commented Aug 15, 2019 via email

@ambitslix
Copy link
Contributor Author

ambitslix commented Aug 15, 2019 via email

@vitaut
Copy link
Contributor

vitaut commented Aug 17, 2019

are you ok with my solution in the ticket?

I'm fine with the solution "to configure fmt.pc via variable". Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants