cmake_minimum_required(VERSION 2.8) project(zip3) set(CMAKE_CXX_STANDARD 11) set(CMAKE_POSITION_INDEPENDENT_CODE ON) include_directories(minizip ${CMAKE_CURRENT_BINARY_DIR}) add_subdirectory(zlib-1.2.11) add_library(minizip minizip/ioapi.c minizip/miniunz.c minizip/minizip.c minizip/mztools.c minizip/unzip.c minizip/zip.c) target_link_libraries(minizip zlibstatic) add_library(unzip_tool unzip_tool.cpp) target_link_libraries(unzip_tool minizip) add_executable(zip3 main.cpp) target_link_libraries(zip3 unzip_tool)