1
0
mirror of https://github.com/madler/zlib synced 2025-03-28 21:13:15 +00:00
zlib/contrib/minizip/test/find_package_test.cmake.in

26 lines
796 B
CMake

cmake_minimum_required(VERSION 3.12)
project(
minizip_find_package
LANGUAGES C
VERSION @minizip_VERSION@)
option(MINIZIP_BUILD_SHARED "" @MINIZIP_BUILD_SHARED@)
option(MINIZIP_BUILD_STATIC "" @MINIZIP_BUILD_STATIC@)
find_package(minizip ${minizip_VERSION} CONFIG REQUIRED)
set(MINIZIP_SRCS
@minizip_SOURCE_DIR@/ioapi.c
$<$<BOOL:${WIN32}>:@minizip_SOURCE_DIR@/iowin32.c>
@minizip_SOURCE_DIR@/minizip.c @minizip_SOURCE_DIR@/zip.c)
if(MINIZIP_BUILD_SHARED)
add_executable(test_example ${MINIZIP_SRCS})
target_link_libraries(test_example MINIZIP::minizip)
endif(MINIZIP_BUILD_SHARED)
if(MINIZIP_BUILD_STATIC)
add_executable(test_example_static ${MINIZIP_SRCS})
target_link_libraries(test_example_static MINIZIP::minizipstatic)
endif(MINIZIP_BUILD_STATIC)