You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.2 KiB

  1. From 9f734b13f4ea062af98652c4c7678f667d2d85c7 Mon Sep 17 00:00:00 2001
  2. From: David Callu <callu.david@gmail.com>
  3. Date: Thu, 4 Jul 2019 15:15:53 +0200
  4. Subject: [PATCH] cmake: Use the correct ZLIB_* variable names
  5. ZLIB_LIBRARIES and ZLIB_INCLUDE_DIRS are the official cmake variable
  6. names.
  7. ---
  8. CMakeLists.txt | 15 ++++++++-------
  9. 1 file changed, 8 insertions(+), 7 deletions(-)
  10. --- a/CMakeLists.txt
  11. +++ b/CMakeLists.txt
  12. @@ -40,7 +40,7 @@ option(PNG_BUILD_ZLIB "Custom zlib Locat
  13. if(NOT PNG_BUILD_ZLIB)
  14. find_package(ZLIB REQUIRED)
  15. - include_directories(${ZLIB_INCLUDE_DIR})
  16. + include_directories(${ZLIB_INCLUDE_DIRS})
  17. endif()
  18. if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
  19. @@ -523,7 +523,7 @@ if(PNG_DEBUG)
  20. endif()
  21. # NOW BUILD OUR TARGET
  22. -include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
  23. +include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS})
  24. unset(PNG_LIB_TARGETS)
  25. @@ -537,7 +537,7 @@ if(PNG_SHARED)
  26. set_target_properties(png PROPERTIES PREFIX "lib")
  27. set_target_properties(png PROPERTIES IMPORT_PREFIX "lib")
  28. endif()
  29. - target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY})
  30. + target_link_libraries(png ${ZLIB_LIBRARIES} ${M_LIBRARY})
  31. if(UNIX AND AWK)
  32. if(HAVE_LD_VERSION_SCRIPT)
  33. @@ -572,7 +572,7 @@ if(PNG_STATIC)
  34. # msvc does not append 'lib' - do it here to have consistent name
  35. set_target_properties(png_static PROPERTIES PREFIX "lib")
  36. endif()
  37. - target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY})
  38. + target_link_libraries(png_static ${ZLIB_LIBRARIES} ${M_LIBRARY})
  39. endif()
  40. if(PNG_FRAMEWORK)
  41. @@ -589,7 +589,7 @@ if(PNG_FRAMEWORK)
  42. XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
  43. PUBLIC_HEADER "${libpng_public_hdrs}"
  44. OUTPUT_NAME png)
  45. - target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY})
  46. + target_link_libraries(png_framework ${ZLIB_LIBRARIES} ${M_LIBRARY})
  47. endif()
  48. if(NOT PNG_LIB_TARGETS)
  49. @@ -754,7 +754,7 @@ if(PNG_SHARED AND PNG_EXECUTABLES)
  50. set(PNG_BIN_TARGETS pngfix)
  51. add_executable(png-fix-itxt ${png_fix_itxt_sources})
  52. - target_link_libraries(png-fix-itxt ${ZLIB_LIBRARY} ${M_LIBRARY})
  53. + target_link_libraries(png-fix-itxt ${ZLIB_LIBRARIES} ${M_LIBRARY})
  54. list(APPEND PNG_BIN_TARGETS png-fix-itxt)
  55. endif()