Skip to content

Commit

Permalink
CMake: Resolve Missing ZLIB Warning When PNG is Disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey authored and kmilos committed Oct 9, 2024
1 parent 4173969 commit 81bc63d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ endif()
set_target_properties(exiv2lib_int PROPERTIES POSITION_INDEPENDENT_CODE ON COMPILE_DEFINITIONS exiv2lib_EXPORTS)

# NOTE: Cannot use target_link_libraries on OBJECT libraries with old versions of CMake
target_include_directories(exiv2lib_int PRIVATE ${ZLIB_INCLUDE_DIR})
target_include_directories(exiv2lib SYSTEM PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/xmpsdk/include>)

if(EXIV2_ENABLE_XMP OR EXIV2_ENABLE_EXTERNAL_XMP)
Expand Down Expand Up @@ -254,6 +253,7 @@ endif()

if(EXIV2_ENABLE_PNG)
target_link_libraries(exiv2lib PRIVATE ZLIB::ZLIB)
target_include_directories(exiv2lib_int PRIVATE ${ZLIB_INCLUDE_DIR})
list(APPEND requires_private_list "zlib")
endif()

Expand Down

0 comments on commit 81bc63d

Please sign in to comment.