cpp-pm / hunter

CMake driven cross-platform package manager for C/C++.
BSD 2-Clause "Simplified" License
613 stars 181 forks source link

hunter_config(... URL ... SHA1 ...) fails with transitive dependencies #22

Closed craffael closed 5 years ago

craffael commented 5 years ago

cmake_minimum_required(VERSION 3.10) include("cmake/HunterGate.cmake") HunterGate( URL "https://github.com/cpp-pm/hunter/archive/v0.23.217.tar.gz" SHA1 "4b36c0f8ffc8f3b5718d5e24629fb40c56c99b13" LOCAL )

project(GettingStarted) hunter_add_package(lehrfempp) find_package(lehrfempp CONFIG REQUIRED) add_executable(getting_started main.cc) target_link_libraries(getting_started LF::lf.base)

cmake/Hunter/config.cmake

hunter_config(lehrfempp URL "https://github.com/craffael/lehrfempp/archive/20bf18775ff80f227abea649a87683b1b3d62399.tar.gz" SHA1 "be08de982ad28a55f9512874f832e3718af684a3" )


Here is the log until first error reported by Hunter, option `HUNTER_STATUS_DEBUG` is `ON`:
* [out.txt](https://github.com/cpp-pm/hunter/files/3675146/out.txt)

I've checked that the first error in logs **IS NOT** `external.build.failed`. **Yes**

<!--- Info about environment -->
* I'm building on Linux
* I'm using system CMake
* CMake version: 3.10.2

* I'm not using toolchain

I'm using the next command line on generate step:

cmake -H. -Bbin



---

In this testcase I'm including the package lehrfempp. The lehrfempp package in turn depends again on Boost::program_options . If I omit the `hunter_config` directive, everything works as expected but I don't get the version that I want. If I use the `hunter_config`  directive, hunter seems to download the correct version of lehrfempp but then later on the find_package call fails.
bkotzz commented 5 years ago

So when you don’t specify the config, it is using the default version of lehrfempp that has already been added to hunter. When you do specify the config, you are choosing a specific version (I believe 0.8) that hasn’t been added to hunter or tested in hunter. Has anything changed in that package between versions that may cause this?

craffael commented 5 years ago

You were right. I should have tested this more thoroughly, there was one commit that introduced an error in the meantime. Arrgh.