Opened 20 months ago

Last modified 20 months ago

#65713 assigned defect

libfmt8/libfmt9 change makes libfmt unusable OOB with external software,

Reported by: Lord-Kamina (Gregorio Litenstein) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: libfmt libfmt8 libfmt9

Description

I have a project that depends on libfmt. Until recently it was working perfectly, but since libfmt was obsoleted and replaced by libfmt8 and libfmt9, CMake will no longer find fmt.

This is likely to the fact that the location of the cmake config files changed with these updates.

Change History (9)

comment:1 Changed 20 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: mascguy added

comment:2 Changed 20 months ago by Lord-Kamina (Gregorio Litenstein)

Doing sudo ln -sf /opt/local/lib/libfmt9/cmake/fmt/ /opt/local/lib/cmake/ works around the issue for me. Maybe this is a job for port select?

comment:3 Changed 20 months ago by mascguy (Christopher Nielsen)

Unfortunately it's extremely problematic if we install headers and libs directly in ${prefix}/include and ${prefix}/lib, now that we support multiple versions installed side-by-side. And adding a symlink is going to cause compilation issues for other ports, so you really don't want to do that.

Instead, it's trivial to update projects. You simply need to add the appropriate search path, for the version you want:

  • For pkgconfig (usually covers CMake too, along with Ninja): ${prefix}/lib/libfmtX/pkgconfig
  • For pure CMake: ${prefix}/lib/libfmtX/cmake

If you can share info regarding the project you're working with, I can provide guidance specific to it.

Last edited 20 months ago by mascguy (Christopher Nielsen) (previous) (diff)

comment:4 Changed 20 months ago by mascguy (Christopher Nielsen)

Cc: mascguy removed
Owner: set to mascguy
Status: newassigned
Version: 2.7.2

comment:5 Changed 20 months ago by Lord-Kamina (Gregorio Litenstein)

Version: 2.7.2

I'm not saying you we install headers and libs directly in ${prefix}/include and ${prefix}/lib, nor symlinks in there either. Notice how my symlink is just for the cmake configuration files. but there has to be a way to not break cmake detection. I know I could add to CMAKE_PREFIX_PATH, but when I want to support using macports and homebrew and VS and mingw-w64 on windows and various flavors of Linux, it quickly begins to become unmanageable.

The approach that has been taken essentially negates all benefit derived from fmt including its own cmake config files.

Another possible fix would be to have those files installed in /opt/local/lib/cmake/fmtX instead of /opt/local/lib/libfmtX/cmake/fmt

comment:6 Changed 20 months ago by mascguy (Christopher Nielsen)

Please point me to the source code for your project, so that I can see what you're working with.

comment:7 Changed 20 months ago by Lord-Kamina (Gregorio Litenstein)

https://github.com/performous/performous/

find_package(fmt REQUIRED CONFIG)
target_link_libraries(performous PRIVATE fmt::fmt)

Should work universally; and it used to.

Last edited 20 months ago by Lord-Kamina (Gregorio Litenstein) (previous) (diff)

comment:8 in reply to:  5 ; Changed 20 months ago by mascguy (Christopher Nielsen)

Replying to Lord-Kamina:

Another possible fix would be to have those files installed in /opt/local/lib/cmake/fmtX instead of /opt/local/lib/libfmtX/cmake/fmt

Thanks for sharing the project link. And I'll also run some tests with your suggested approach, to see what the result is.

Regardless, we certainly want to try to accommodate you if possible. More to follow, once I've done more testing/digging.

comment:9 in reply to:  8 Changed 20 months ago by Lord-Kamina (Gregorio Litenstein)

Replying to mascguy:

Replying to Lord-Kamina:

Another possible fix would be to have those files installed in /opt/local/lib/cmake/fmtX instead of /opt/local/lib/libfmtX/cmake/fmt

Thanks for sharing the project link. And I'll also run some tests with your suggested approach, to see what the result is.

Regardless, we certainly want to try to accommodate you if possible. More to follow, once I've done more testing/digging.

Thank you!

Of course, I'm available to help eventually so we can find the best way to solve it.

Note: See TracTickets for help on using tickets.