-
Notifications
You must be signed in to change notification settings - Fork 192
Description
- I've read Brief overview section and do understand basic concepts. [Yes]
- I've read F.A.Q. section and there is no solution to my problem there. [Yes]
- I've read Code of Conduct, I promise to be polite and will do my best at being constructive. [Yes]
- I've read Reporting bugs section carefully. [Yes]
- I've checked that all the
hunter_add_package/find_packageAPI used by me in the example is the same as in documentation. [Yes] - I'm using latest Hunter
URL/SHA1. [Yes]
- I've created SSCCE reproducing the issue:
# CMakeLists.txt
cmake_minimum_required(VERSION 3.5...4.2.1)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.26.6.tar.gz"
SHA1 "e70c29f878f5d5f5cdf1b9ccd628fb872e8624a8"
FILEPATH "${CMAKE_CURRENT_LIST_DIR}/cmake/HunterConfig.cmake"
)
project(Test)
hunter_add_package(ZLIB)
find_package(ZLIB CONFIG REQUIRED)# cmake/HunterConfig.cmake
include_guard()
hunter_config(ZLIB
URL "https://codeload.github.com/madler/zlib/zip/tags/v1.3.1.2"
VERSION "1.3.1.2"
SHA1 "7a93d599baf1c6983357e241f2571bf6860512b0"
CMAKE_ARGS
ZLIB_BUILD_TESTING=OFF
ZLIB_BUILD_SHARED=OFF
ZLIB_BUILD_STATIC=ON
ZLIB_BUILD_MINIZIP=OFF
ZLIB_INSTALL=ON
ZLIB_PREFIX=OFF
)Here is the log until first error reported by Hunter, option HUNTER_STATUS_DEBUG is ON:
[hunter ** FATAL ERROR **] File not exists:
[hunter ** FATAL ERROR **] H:/Hunter/_Base/e70c29f/1d28e7f/a1abce3/Build/ZLIB/Install/share/pkgconfig/zlib.pc
[hunter ** FATAL ERROR **] (check HUNTER_PACKAGE_UNRELOCATABLE_TEXT_FILES)
[hunter ** FATAL ERROR **] [Directory:H:/Hunter/_Base/Download/Hunter/0.26.6/e70c29f/Unpacked/cmake/projects/ZLIB]
I've checked that the first error in logs IS NOT external.build.failed. [No]
- I'm building on [Windows 10].
- [I'm using official CMake release]
- CMake version: <4.2.1>
- I'm not using toolchain
I'm using the next command line on generate step:
cmake -B Build
Hi! I'm a long time Hunter user and recently observed an issue with the default ZLib package recipe. There's an argument here which assumes that the zlib.pc file will always be located at a non-standard path:
hunter/cmake/projects/ZLIB/hunter.cmake
Lines 155 to 156 in f6cfd86
| PACKAGE_UNRELOCATABLE_TEXT_FILES | |
| "share/pkgconfig/zlib.pc" |
However, with the latest version of ZLib, there has been a lot of modernization and standardization in its CMakeLists.txt file, which ultimately as far as I can tell no longer requires any custom modifications or forking of this project in order to use it. I generally maintain all of my own forks of libraries to make custom changes where required. However, since it now includes GNUInstallDirs, the zlib.pc file ends up at a different location, but the recipe incorrectly assumes that it will always be located at the old path. Since I'm using my own Hunter configuration file to consume the original source directly, this ultimately causes building of this dependency to fail with no obvious way to fix this except for forking Hunter itself and making my own changes, or making a custom branch of ZLib which copies the pkg-config directory to the old path, neither of which are particularly ideal.
Hopefully this is something that can be easily fixed, or perhaps worked around? I'm not sure what custom CMake changes are in place for ZLib, but I don't think they are necessary anymore for the latest version.
I'm not super familiar with all of the inner workings of Hunter, but I can try to put together a pull request if it might be helpful as well.
Thank you!