https://github.com/kugelrund/dzip/commit/f1b1c569c4942a3e9ce3d092fcd6addbecc53a4d.patchFrom: kugelrund <6236137+kugelrund@users.noreply.github.com> Date: Mon, 4 Aug 2025 22:55:22 +0200 Subject: [PATCH] Suggest more modern CMake workflow --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,13 +1,6 @@ -cmake_minimum_required(VERSION 3.1.0) +cmake_minimum_required(VERSION 3.15) project(dzip) -set(CMAKE_C_STANDARD 11) -set(CMAKE_CXX_STANDARD 11) -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/install - CACHE PATH "Default installation directory." FORCE) -endif() - add_library(dzip_endian INTERFACE) if(CMAKE_C_BYTE_ORDER STREQUAL "BIG_ENDIAN") target_compile_definitions(dzip_endian INTERFACE DZIP_BIG_ENDIAN) --- a/README.md +++ b/README.md @@ -18,19 +18,32 @@ For other systems, please see section Compilation. If no system zlib is available, make sure to clone the repository using `--recurse-submodules` to clone the required zlib sources too. [CMake](https://cmake.org/) may be used to build Dzip. -For example, on unix systems, you may want to setup the build files using +For example, from the top-level directory the commands ```bash -mkdir build -cd build -cmake .. +cmake -B ./build -S . -DCMAKE_BUILD_TYPE=Release +cmake --build ./build +cmake --install ./build --prefix ./install ``` -followed by running `make` to compile, assuming you are using CMake with Makefiles. +may be run to get the compiled dzip executable in the install subdirectory. Note that compilation of the GUI is only supported on Windows with Visual Studio for now. -A simple way to generate the necessary Visual Studio projects is to use the `cmake-gui` on Windows. -Make sure to target Win32, other platforms (including x64) are not supported for now. +Make sure to target Win32, other architectures (including x64) are not supported for now. +The necessary Visual Studio projects may for example be generated with: + +```bash +cmake -B ./build -S . -G "Visual Studio 17 2022" -A Win32 -DCMAKE_INSTALL_PREFIX="./install" +``` + +You can then either open the generated Visual Studio solution and work from there, or for example run + +```bash +cmake --build ./build --config Release +cmake --install ./build +``` + +from the command line. ## Usage