I have been using FetchContent_MakeAvailable(SetupHunter) with multiple different packages successfully already, but now I tried it with Boost and it failed with the following errors:
CMake Error at C:/.hunter/_Base/b67e11d/083dd95/9877faf/Install/lib/cmake/Boost/BoostConfig.cmake:4 (include):
include could not find load file:
hunter_check_toolchain_definition
Call Stack (most recent call first):
CMakeLists.txt:15 (find_package)
CMake Error at C:/.hunter/_Base/b67e11d/083dd95/9877faf/Install/lib/cmake/Boost/BoostConfig.cmake:7 (include):
include could not find load file:
hunter_internal_error
Call Stack (most recent call first):
CMakeLists.txt:15 (find_package)
CMake Error at C:/.hunter/_Base/b67e11d/083dd95/9877faf/Install/lib/cmake/Boost/BoostConfig.cmake:8 (include):
include could not find load file:
hunter_status_debug
Call Stack (most recent call first):
CMakeLists.txt:15 (find_package)
[hunter ** INTERNAL **] Unexpected empty string
[hunter ** INTERNAL **] [Directory:C:/.hunter/_Base/b67e11d/083dd95/9877faf/Install/lib/cmake/Boost]
------------------------------ ERROR -----------------------------
/error.internal.html
------------------------------------------------------------------
CMake Error at C:/.hunter/_Base/Download/Hunter/0.23.234/b67e11d/Unpacked/cmake/modules/hunter_error_page.cmake:12 (message):
Call Stack (most recent call first):
C:/.hunter/_Base/Download/Hunter/0.23.234/b67e11d/Unpacked/cmake/modules/hunter_internal_error.cmake:13 (hunter_error_page)
C:/.hunter/_Base/Download/Hunter/0.23.234/b67e11d/Unpacked/cmake/modules/hunter_assert_not_empty_string.cmake:9 (hunter_internal_error)
C:/.hunter/_Base/Download/Hunter/0.23.234/b67e11d/Unpacked/cmake/modules/hunter_check_toolchain_definition.cmake:46 (hunter_assert_not_empty_string)
C:/.hunter/_Base/b67e11d/083dd95/9877faf/Install/lib/cmake/Boost/BoostConfig.cmake:43 (hunter_check_toolchain_definition)
CMakeLists.txt:15 (find_package)
The CMakeLists.txt looks like follows:
cmake_minimum_required(VERSION 3.2)
set(HUNTER_Boost_COMPONENTS chrono date_time)
set(HUNTER_PACKAGES Boost)
set(HUNTER_Boost_VERSION 1.71.0-p0)
# option(HUNTER_NO_TOOLCHAIN_ID_RECALCULATION "" ON)
include(FetchContent)
FetchContent_Declare(SetupHunter GIT_REPOSITORY https://github.com/cpp-pm/gate)
FetchContent_MakeAvailable(SetupHunter)
project(use-pkg-components)
find_package(Boost CONFIG REQUIRED chrono date_time)
add_executable(use-pkg-components main.cpp)
target_link_libraries(use-pkg-components PRIVATE
Boost::chrono
Boost::date_time
)
Interestingly the same basic setup works fine when I manually download & set up HunterGate.cmake:
cmake_minimum_required(VERSION 3.2)
set(HUNTER_Boost_COMPONENTS chrono date_time)
set(HUNTER_PACKAGES Boost)
set(HUNTER_Boost_VERSION 1.71.0-p0)
# option(HUNTER_NO_TOOLCHAIN_ID_RECALCULATION "" ON)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.234.tar.gz"
SHA1 "b67e11d7e9ee503e9f6e1b45eb1ef7bf2fb31279"
)
project(use-pkg-components)
hunter_add_package(Boost COMPONENTS chrono date_time)
find_package(Boost CONFIG REQUIRED chrono date_time)
add_executable(use-pkg-components main.cpp)
target_link_libraries(use-pkg-components PRIVATE
Boost::chrono
Boost::date_time
)
Any ideas what could be the issue ?
Thanks
I have been using
FetchContent_MakeAvailable(SetupHunter)with multiple different packages successfully already, but now I tried it with Boost and it failed with the following errors:The CMakeLists.txt looks like follows:
Interestingly the same basic setup works fine when I manually download & set up HunterGate.cmake:
Any ideas what could be the issue ?
Thanks