Skip to content

Commit

Permalink
CMake: Update FindZLIB_NG For Target
Browse files Browse the repository at this point in the history
Generate an import target to bring `FindZLIB_NG.cmake` up to
par with the CMake-default shipped `FindZLIB.cmake`.
  • Loading branch information
ax3l committed Aug 18, 2023
1 parent 42ec0a7 commit a8dec57
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cmake/FindZLIB_NG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,21 @@ else(ZLIB_NG_INCLUDE_DIR AND ZLIB_NG_LIBRARIES)
set(ZLIB_NG_FOUND FALSE)
endif(ZLIB_NG_INCLUDE_DIR AND ZLIB_NG_LIBRARIES)

# generate CMake target
if(ZLIB_NG_FOUND)
message(STATUS "Found zlib-ng: ${ZLIB_NG_LIBRARIES}, ${ZLIB_NG_INCLUDE_DIR}")
endif(ZLIB_NG_FOUND)

set(ZLIB_NG_INCLUDE_DIRS ${ZLIB_NG_INCLUDE_DIR})

if(NOT TARGET ZLIB_NG::ZLIB_NG)
add_library(ZLIB_NG::ZLIB_NG UNKNOWN IMPORTED)
set_target_properties(ZLIB_NG::ZLIB_NG PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_NG_INCLUDE_DIRS}")

set_property(TARGET ZLIB_NG::ZLIB_NG APPEND PROPERTY
IMPORTED_LOCATION "${ZLIB_NG_LIBRARIES}")
endif()
endif()

#[[
Copyright https://github.com/zlib-ng/minizip-ng, 2021
Expand Down

0 comments on commit a8dec57

Please sign in to comment.