FindCImg.cmake: Propagate png and jpeg library paths properly#328
Conversation
According to FindPkgConfig documentation, the ${prefix}_LINK_LIBRARIES expands
to a full path to the library. This is what we want to pass to
target_link_libraries() later, because this allows CMake to properly generate
-L and -l flags. Using just ${prefix}_LIBRARIES works on Linux, where libraries
are put in the default library search path, but fails on FreeBSD.
This change does not fix the case for STATIC_BUILD due to bug on the CMake side:
Kitware/CMake@7e4adca
TheAssassin
left a comment
There was a problem hiding this comment.
Looks good to me. Let's see if CI agrees. Thanks!
|
Unfortunately, this change breaks dynamic linking which the coverage build uses (and possibly other users, too). Looks like this requires some additional logic (and we should perhaps not allow that coverage build to fail). Can you please explain why this is not working on FreeBSD? I think using |
To successfully link to a pkg-config-based library, one should pass both In CMake passing an absolute path to |
According to FindPkgConfig documentation, the ${prefix}_LINK_LIBRARIES expands to a full path to the library. This is what we want to pass to target_link_libraries() later, because this allows CMake to properly generate -L and -l flags. Using just ${prefix}_LIBRARIES works on Linux, where libraries are put in the default library search path, but fails on FreeBSD.
This change does not fix the case for STATIC_BUILD due to bug on the CMake side: Kitware/CMake@7e4adca