Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: add zlib dependency #973

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ target_link_libraries(heif-convert PRIVATE heif)
install(TARGETS heif-convert RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES heif-convert.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)


add_executable(heif-enc ${getopt_sources}
heif_enc.cc
../libheif/exif.cc
Expand Down Expand Up @@ -107,8 +106,8 @@ if (PNG_FOUND)
target_sources(heif-enc PRIVATE decoder_png.cc decoder_png.h)
endif ()


if (PNG_FOUND)
find_package(ZLIB)
if (PNG_FOUND AND ZLIB_FOUND)
add_executable(heif-thumbnailer ${getopt_sources}
encoder.cc
encoder.h
Expand All @@ -119,8 +118,9 @@ if (PNG_FOUND)
../libheif/exif.cc
common.cc
common.h)
target_link_libraries(heif-thumbnailer heif ${PNG_LIBRARIES})
target_link_libraries(heif-thumbnailer heif ${PNG_LIBRARIES} ${ZLIB_LIBRARIES})
target_include_directories(heif-thumbnailer PRIVATE ${PNG_INCLUDE_DIR})
target_include_directories(heif-thumbnailer PRIVATE ${ZLIB_INCLUDE_DIRS})

install(TARGETS heif-thumbnailer RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES heif-thumbnailer.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
Expand Down
2 changes: 1 addition & 1 deletion libheif/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ endif ()
if (WITH_DEFLATE_HEADER_COMPRESSION)
find_package(ZLIB REQUIRED)
if (ZLIB_FOUND)
target_link_libraries(heif PRIVATE ${ZLIB_LIBRARY})
target_link_libraries(heif PRIVATE ${ZLIB_LIBRARIES})
target_include_directories(heif PRIVATE ${ZLIB_INCLUDE_DIRS})
target_compile_definitions(heif PRIVATE WITH_DEFLATE_HEADER_COMPRESSION=1)
endif ()
Expand Down