Fix ALIAS target name to be consistent with imported target.

Co-authored-by: SpaceIm <SpaceIm@users.noreply.github.com>
This commit is contained in:
Nathan Moinvaziri 2023-04-15 23:12:19 -07:00
parent e15e1462f2
commit be23e857ed

View File

@ -649,7 +649,12 @@ set(MINIZIP_TARGET minizip${MZ_LIB_SUFFIX})
set(MINIZIP_PC ${CMAKE_CURRENT_BINARY_DIR}/${MINIZIP_TARGET}.pc) set(MINIZIP_PC ${CMAKE_CURRENT_BINARY_DIR}/${MINIZIP_TARGET}.pc)
configure_file(minizip.pc.cmakein ${MINIZIP_PC} @ONLY) configure_file(minizip.pc.cmakein ${MINIZIP_PC} @ONLY)
# Create minizip library and aliases
add_library(${MINIZIP_TARGET} ${MINIZIP_SRC} ${MINIZIP_HDR}) add_library(${MINIZIP_TARGET} ${MINIZIP_SRC} ${MINIZIP_HDR})
add_library(MINIZIP::${MINIZIP_TARGET} ALIAS ${MINIZIP_TARGET})
if(NOT TARGET MINIZIP::minizip)
add_library(MINIZIP::minizip ALIAS ${MINIZIP_TARGET})
endif()
set_target_properties(${MINIZIP_TARGET} PROPERTIES set_target_properties(${MINIZIP_TARGET} PROPERTIES
VERSION ${VERSION} VERSION ${VERSION}
@ -682,9 +687,6 @@ if(MZ_COMPAT)
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>) $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
endif() endif()
# Create minizip alias
add_library(MINIZIP::minizip ALIAS ${MINIZIP_TARGET})
# Install files # Install files
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
target_include_directories(${MINIZIP_TARGET} PUBLIC target_include_directories(${MINIZIP_TARGET} PUBLIC