Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add libzip and zlib into same project, but libzip report find_package error "Could NOT find ZLIB" #252

Closed
Demonese opened this issue Aug 7, 2021 · 3 comments
Labels
compile There is a problem compiling libzip.

Comments

@Demonese
Copy link

Demonese commented Aug 7, 2021

Compiler Error
This is CMake error, isn't compiler error

[cmake] CMake Error at C:/Library/cmake/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
[cmake]   Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) (Required is
[cmake]   at least version "1.1.2")
[cmake] Call Stack (most recent call first):
[cmake]   C:/Library/cmake/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
[cmake]   C:/Library/cmake/share/cmake-3.21/Modules/FindZLIB.cmake:120 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
[cmake]   remote/libzip/CMakeLists.txt:178 (find_package)

libzip Version
master

Operating System and Compiler

Windows 10 Pro 21H1 (19043.1151)
[cmake] -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19043.
[cmake] -- The C compiler identification is MSVC 19.29.30040.0
[cmake] -- The CXX compiler identification is MSVC 19.29.30040.0

Autodetected Configuration
amd64 Release

-G "Visual Studio 16 2019" -T host=x64 -A x64

Additional context
project root CMakeLists.txt

add_subdirectory(remote/zlib)
add_subdirectory(remote/libzip)

zlib and libzip are git submodule
image

@Demonese Demonese added the compile There is a problem compiling libzip. label Aug 7, 2021
@0-wiz-0
Copy link
Member

0-wiz-0 commented Aug 7, 2021

libzip uses cmake's FindPackage to look for zlib.
cmake tries to find zlib, but if it's not in one of the directories searched by default by your compiler it will usually not find it.
You can set cmake's ZLIB_INCLUDE_DIR and ZLIB_LIBRARY variables to help cmake find zlib.

@0-wiz-0 0-wiz-0 closed this as completed Aug 7, 2021
@UltraEngine
Copy link

UltraEngine commented Mar 22, 2024

You can set cmake's ZLIB_INCLUDE_DIR and ZLIB_LIBRARY variables to help cmake find zlib.

How do I do this? Do they accept relative paths? What is the library value supposed to be?

@0-wiz-0
Copy link
Member

0-wiz-0 commented Mar 22, 2024

See https://cmake.org/ or https://github.com/nih-at/libzip/blob/main/INSTALL.md -- add "-DFOO=BAR" to the command line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compile There is a problem compiling libzip.
Projects
None yet
Development

No branches or pull requests

3 participants