Skip to content

Generated files unzip.h and zip.h shall be in build directory #588

@piwaneczko

Description

@piwaneczko

Discussed in https://github.com/zlib-ng/minizip-ng/discussions/587

Originally posted by piwaneczko August 3, 2021
Generated files shall be always placed in build directory.

AC:

  • Header template file.h.in is created:
    /* @FILE_H@ -- Compatibility layer shim
        part of the minizip-ng project
        This program is distributed under the terms of the same license as zlib.
        See the accompanying LICENSE file for the full text of the license.
    */
    #ifndef @MZ_COMPAT_FILE@
    #define @MZ_COMPAT_FILE@

    #include "mz_compat.h"
    #endif
  • CMakeLists.txt is updated:
    if(MZ_COMPAT)
        set(FILE_H "zip.h")
        set(MZ_COMPAT_FILE "MZ_COMPAT_ZIP")
        configure(file.h.in zip.h)

        set(FILE_H "unzip.h")
        set(MZ_COMPAT_FILE "MZ_COMPAT_UNZIP")
        configure(file.h.in unzip.h)

        if(MZ_COMPAT_VERSION)
            list(APPEND MINIZIP_DEF -DMZ_COMPAT_VERSION=${MZ_COMPAT_VERSION})
        endif()
        list(APPEND MINIZIP_SRC mz_compat.c)
        list(APPEND MINIZIP_HDR mz_compat.h ${CMAKE_CURRENT_BINARY_DIR}/zip.h ${CMAKE_CURRENT_BINARY_DIR}/unzip.h)
    endif()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions