Rolf Eike Beer wrote:
> First, FindPNG.cmake doesn't care about pkg-config files, if that is bug Yes, I noticed that after I wrote the remark about the pkg-config files, and didn't think to remove it (= I diagnosed the issue while writing the message). > or feature depends on your personal things. CMake will detect the > library using the full path (as it has done), and construct proper -L > and -l from that. It doesn't happen here, which makes me suspect that > you don't even link to ${PNG_LIBRARIES} or PNG::PNG (the latter being >From the CMake file (digikam-5.6.0/core/app/CMakeLists.txt): target_link_libraries(digikamcore PUBLIC Qt5::Core Qt5::Gui Qt5::Xml Qt5::Widgets Qt5::Sql Qt5::WebKitWidgets Qt5::PrintSupport Qt5::Concurrent KF5::Solid KF5::WindowSystem KF5::ConfigGui KF5::CoreAddons KF5::Service KF5::XmlGui KF5::I18n # Required by CImg which use pthread internally. ${CMAKE_THREAD_LIBS_INIT} ${LCMS2_LIBRARIES} # filters ${TIFF_LIBRARIES} ${PNG_LIBRARIES} ${EXIV2_LIBRARIES} libdng libraw ) > the better version). It seems to me like the -lpng you see comes from > QtWebkitWidgets, which would also need to be linked against your library It does and is, but I don't find a reference to libpng in its cmake modules (nor in any other of Qt5's modules, for that matter). So while your hypothesis seems reasonable I don't see where the -lpng would be added by Qt's modules. (FWIW, QtWebKit also has a .pc file, but it doesn't add - lz after -lpng so unless someone reorders the link library order that file cannot be the source of the issue either.) I've asked a more generic question about fully-qualified path conversion to -lfoo on the general ML ("/path/to/libpng.so automatic conversion to -lpng"). R. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers