vcpkg/ports/zziplib/CMakeLists.txt
Victor Romero 050e71d01d
Remove references to CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS (#5937)
* [various ports] remove references to CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS

* [alac,benchmark,capnproto] Fix  check_linkage call

* [fastlz] Fix SHA512

* [coroutine] Fix dynamic build

* [folly] Find double-conversion

* [gamma] Use vcpkg_from_github

* [librsync] Enable static builds

* [netcdf-cxx4] Fix SHA512

* [octomap] Fix static build

* [tidy-html5] Fix static build

* [various ports] remove custom messages for shared/static builds, modernize some scripts in the meantime

* [folly] Use ras0219's fix for link paths

* [octomap] Fix exported targets

* [uvatlas] Set tool download SHA512

* [duktape+python2] fix portfile to call configure with correct python version, manage python2 also outside win32

* [suitesparse] osx fix

* [gtkmm] Call vcpkg_check_linkage after including vcpkg functions

* [duktape] Resolve conflicts

* [duktape] FIxed typo in Python paths

* [wangle] Find zlib

* [openssl-uwp] Fix SHA512

* [glib] Allow static builds on non-Windows

* [suitesparse] Fix build on Windows

* [multiple ports] Bump CONTROL version

* [multiple ports] Fix description indent

* [directxtk] Fix CONTROL file

* [bde,duktape,qpid-proton] Build packages with python2 installed

* [binn] remove CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS

* [gdal,live555,uriparser] Fix regressions

* [live555] Update to 2019.04.24
2019-05-02 22:57:43 -07:00

88 lines
2.3 KiB
CMake

cmake_minimum_required(VERSION 3.0)
include(GNUInstallDirs)
project(zziplib C)
find_package(zlib)
include_directories(${ZLIB_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
if(MSVC)
set(CMAKE_DEBUG_POSTFIX "d")
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
endif()
if(UNIX)
# Find autotools output
set(ZZLIB_AUTOOLS_INCLUDE_DIRS)
file(GLOB CHILDREN RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/*")
foreach(CHILD ${CHILDREN})
string(REGEX MATCH "x86_64*" ZZLIB_AUTOOLS_OUTPUT_FOLDER "${CHILD}")
if (ZZLIB_AUTOOLS_OUTPUT_FOLDER)
set(ZZLIB_AUTOOLS_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/${CHILD})
include_directories(${ZZLIB_AUTOOLS_INCLUDE_DIRS})
include_directories(${ZZLIB_AUTOOLS_INCLUDE_DIRS}/zzip)
endif()
endforeach()
endif()
# List the header files
set(HEADERS zzip/__debug.h
zzip/__dirent.h
zzip/__fnmatch.h
zzip/__hints.h
zzip/__mmap.h
zzip/_msvc.h
zzip/autoconf.h
zzip/conf.h
zzip/fetch.h
zzip/file.h
zzip/format.h
zzip/fseeko.h
zzip/info.h
zzip/lib.h
zzip/memdisk.h
zzip/mmapped.h
zzip/plugin.h
zzip/stdint.h
zzip/types.h
zzip/write.h
zzip/zzip.h
)
if(UNIX)
file(GLOB OTHER_HEADERS ${ZZLIB_AUTOOLS_INCLUDE_DIRS}/zzip/*.h)
list(APPEND HEADERS ${OTHER_HEADERS})
else()
list(APPEND HEADERS zzip/_msvc.h)
endif()
# List the source files
set(SRCS zzip/dir.c
zzip/err.c
zzip/fetch.c
zzip/file.c
zzip/info.c
zzip/plugin.c
zzip/stat.c
zzip/zip.c
)
add_library(zziplib ${SRCS} ${HEADERS})
if(BUILD_SHARED_LIBS)
target_compile_definitions(zziplib PRIVATE -DZZIPLIB_EXPORTS)
endif()
target_link_libraries(zziplib ${ZLIB_LIBRARIES})
install(TARGETS zziplib
COMPONENT runtime
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib)
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/zzip)