Files
gMod/cmake/libzip.cmake
T
DubbleClick ab2d8cdb0a 1.5.4 (#7)
* toggle use_folders on

* Rename pipelines

* its a strcpy :(

* add miniz, add xorstream, add non-working ziploader

* start integrating libzip (WIP)

* use ExternalProject test (doesnt work maybe?!)

* further work in integrating libzippp [WIP]
can't build libzip yet (neither manually nor in the vs build), as it doesn't find zlib

* LibZip build script

* make libzip build too
todo: specify cmake find_library to check the paths we install to

* prepare everything in cmake

* fix rebuilding of libzip/zlib

* fix stupid double quotes

* libzippp works

* Setup libzippp archive loading

* Remove allocation of new data when adding file to TextureServer

* Enable CI on dev

* Create LICENSE (#5)

* add mbedtls

* fix cmake (forgot to substitute, woops)

* fix %lu warnings for printing addresses

* enable debug messages, some formatting

* remove mbedtls, fix libzip for /MD(d)

* some code changes

* fix cmake logic, str replace min cmake version in libzip-src/CMakeLists.txt to 3.15

* linker errors in release

* c++ify a little

* remove unnecessary duplicate c++23 definition

* Fixes to gMod_XorStream when calculating stream length

* Fix loading tpf contents with password

* Implemented complete parsing

* Cleanup file loading

* Change to NI

* Revert "Change to NI"

This reverts commit 19b511d907.

* update XorStreamReader to read whole file, then xor

* delete a lot of unused code

* loading logic

* rename console window

* 1.5.4

* remove pointless mutex

* wtf is this code

---------

Co-authored-by: Alex Macocian <amacocian@yahoo.com>
2023-11-17 21:58:04 +01:00

66 lines
1.8 KiB
CMake

include_guard()
include(FetchContent)
include(zlib)
FetchContent_Declare(
libzip
GIT_REPOSITORY https://github.com/nih-at/libzip
GIT_TAG v1.10.1)
FetchContent_GetProperties(libzip)
if (libzip_POPULATED)
message(STATUS "Skipping libzip download")
return()
endif()
FetchContent_Populate(libzip)
if(EXISTS ${CMAKE_INSTALL_PREFIX}/lib/zip.lib)
message(STATUS "Skipping libzip build")
return()
endif()
set(OPTIONS
"-A" "Win32"
"-DZLIB_LIBRARY:PATH=${CMAKE_INSTALL_PREFIX}/lib/zlibstatic.lib"
"-DZLIB_INCLUDE_DIR:PATH=${CMAKE_INSTALL_PREFIX}/include"
"-DENABLE_COMMONCRYPTO=OFF"
"-DENABLE_GNUTLS=OFF"
"-DENABLE_MBEDTLS=OFF"
"-DENABLE_OPENSSL=OFF"
"-DENABLE_WINDOWS_CRYPTO=ON"
"-DENABLE_FDOPEN=OFF"
"-DENABLE_BZIP2=OFF"
"-DENABLE_LZMA=OFF"
"-DENABLE_ZSTD=OFF"
"-DBUILD_TOOLS=OFF"
"-DBUILD_REGRESS=OFF"
"-DBUILD_EXAMPLES=OFF"
"-DBUILD_DOC=OFF"
"-DLIBZIP_DO_INSTALL=ON"
"-DBUILD_SHARED_LIBS=OFF"
"-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}"
"-DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY}"
)
message("Building libzip with OPTIONS:\n${OPTIONS}")
# Patch CMakeLists.txt to require version 3.15 - otherwise cmake ignores MSVC_RUNTIME_LIBRARY
file(READ ${libzip_SOURCE_DIR}/CMakeLists.txt FILE_CONTENT)
string(REPLACE "VERSION 3.5.0" "VERSION 3.15.0" UPDATED_CONTENT "${FILE_CONTENT}")
file(WRITE ${libzip_SOURCE_DIR}/CMakeLists.txt "${UPDATED_CONTENT}")
execute_process(
COMMAND ${CMAKE_COMMAND} ${OPTIONS} .
WORKING_DIRECTORY ${libzip_SOURCE_DIR}
)
execute_process(
COMMAND ${CMAKE_COMMAND} --build . --config Release
WORKING_DIRECTORY ${libzip_SOURCE_DIR}
)
execute_process(
COMMAND ${CMAKE_COMMAND} --install . --config Release
WORKING_DIRECTORY ${libzip_SOURCE_DIR}
)
message(STATUS "Finished libzip build")