8000 Generated files unzip.h and zip.h shall be in build directory · Issue #588 · zlib-ng/minizip-ng · GitHub
[go: up one dir, main page]

Skip to content

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

Closed

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()

Activity

  1. nmoinvaz commented on Mar 5, 2022

    @nmoinvaz
    Member

    Thanks for the good report. I have incorporated it into the dev branch.

  2. piwaneczko commented on Mar 10, 2022

    @piwaneczko
    ContributorAuthor

    You have forgot to add build directory to include_directories for target:
    example target_include_directories(minizip PUBLIC ${minizip_BUILD_DIR})
    Now unzip.h and zip.h cannot by found by other source.
    I couldn't test it before

  3. nmoinvaz commented on Mar 10, 2022

    @nmoinvaz
    Member

    Ok please test dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      0