Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PNG_ZLIB_VERNUM and ZLIB_VERNUM is different when building with MSYS cmake #679

@devildevilson

Description

@devildevilson

Hello libpng community!

Im trying to build 'zlib-ng' and 'libpng' as deps through FetchContent_Declare in cmake using mingw32-w64 compiler. Cmake easily fetches the libraries from github, but at the build time I getting this error.

#  error The include path of <zlib.h> is incorrect

I checked both defines and found out that libpng sets them for different values

#define PNG_ZBUF_SIZE 8192
#define PNG_ZLIB_VERNUM 0x1310 // <---
#define PNG_Z_DEFAULT_COMPRESSION (-1)

against

#define ZLIB_VERSION "1.3.1.zlib-ng"
#define ZLIB_VERNUM 0x131f // <---
#define ZLIB_VER_MAJOR 1

Im using cmake version 3.31.4

Part of CMakeLists.txt:

FetchContent_Declare(
  ZLIB
  GIT_REPOSITORY https://github.com/zlib-ng/zlib-ng.git
  GIT_TAG        2.2.4
  OVERRIDE_FIND_PACKAGE 
)

FetchContent_Declare(
  PNG
  GIT_REPOSITORY https://github.com/pnggroup/libpng.git
  GIT_TAG        v1.6.48
  OVERRIDE_FIND_PACKAGE 
)

What I possibly doing wrong? Could you point me to the right direction?

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