2017-03-06 11:39:27 +08:00
|
|
|
cmake_minimum_required(VERSION 3.2)
|
2017-03-02 21:41:17 +08:00
|
|
|
project(zlib)
|
|
|
|
|
2017-03-06 11:39:27 +08:00
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
2017-03-02 21:41:17 +08:00
|
|
|
include(ExternalProject)
|
|
|
|
ExternalProject_Add(zlib-download
|
|
|
|
GIT_REPOSITORY https://github.com/madler/zlib
|
|
|
|
INSTALL_COMMAND "")
|
|
|
|
|
|
|
|
set(ZLIB_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR}/zlib-download-prefix/src/zlib-download)
|
|
|
|
set(ZLIB_INCLUDE_DIR ${ZLIB_ROOT_DIR})
|
|
|
|
set(ZLIB_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/zlib-download-prefix/src/zlib-download-build)
|
|
|
|
|
|
|
|
add_library(zlib STATIC IMPORTED)
|
|
|
|
set_property(TARGET zlib PROPERTY IMPORTED_LOCATION ${ZLIB_BUILD_DIR}/libz.a)
|
|
|
|
add_dependencies(zlib zlib-download)
|