1
0

pkgconfig.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. diff --git a/CMakeLists.txt b/CMakeLists.txt
  2. index 0ccac52..218747a 100644
  3. --- a/CMakeLists.txt
  4. +++ b/CMakeLists.txt
  5. @@ -820,12 +820,15 @@ endif()
  6. # We use the same files like ./configure, so we have to set its vars.
  7. # Only do this on Windows for Cygwin - the files don't make much sense outside
  8. # of a UNIX look-alike.
  9. -if(NOT WIN32 OR CYGWIN OR MINGW)
  10. +if(1)
  11. set(prefix ${CMAKE_INSTALL_PREFIX})
  12. set(exec_prefix ${CMAKE_INSTALL_PREFIX})
  13. set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
  14. set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
  15. - set(LIBS "-lz -lm")
  16. + set(LIBS "")
  17. + if(M_LIBRARY)
  18. + string(APPEND LIBS "-lm")
  19. + endif()
  20. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
  21. ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY)
  22. create_symlink(libpng.pc FILE ${PNGLIB_NAME}.pc)
  23. @@ -894,6 +897,9 @@ if(NOT SKIP_INSTALL_PROGRAMS AND NOT SKIP_INSTALL_ALL)
  24. endif()
  25. if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL)
  26. + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc
  27. + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
  28. +elseif(0)
  29. # Install man pages
  30. if(NOT PNG_MAN_DIR)
  31. set(PNG_MAN_DIR "share/man")