cpp-pm/hunter

Missing OpenSSL 3.x IMPORTED Targets Crypto and SSL

AndreaLanfranchi opened this issue · 2 comments

  • 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_package API 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.20)

include("cmake/HunterGate.cmake")
HunterGate(
    URL "https://github.com/cpp-pm/hunter/archive/v0.24.18.tar.gz"
    SHA1 "1292e4d661e1770d6d6ca08c12c07cf34a0bf718"
    LOCAL
)

project(foo)

hunter_add_package(OpenSSL)
find_package(OpenSSL CONFIG REQUIRED COMPONENTS Crypto SSL)
if (NOT TARGET OpenSSL::Crypto)
    message(FATAL_ERROR "Mandatory package OpenSSL::Crypto not found but OPENSSL_FOUND==${OPENSSL_FOUND} and OPENSSL_CRYPTO_LIBRARY==${OPENSSL_CRYPTO_LIBRARY}")
endif ()

which eventually reports this during cmake configuration

[...]
-- [hunter] OPENSSL_ROOT: C:/.hunter/_Base/1292e4d/c6c4569/32b4a95/Install (ver.: 3.0.8)
CMake Error at CMakeLists.txt:144 (message):
  Mandatory package OpenSSL::Crypto not found but OPENSSL_FOUND==TRUE and
  OPENSSL_CRYPTO_LIBRARY==C:/.hunter/_Base/10738b5/c6c4569/455ccaf/Install/lib/libcrypto.lib

Am I missing something ?

P.s I'm on Windows

Strangely enough passing the additional -DHUNTER_STATUS_DEBUG=ON definition to my cmake invocation everything is fine and imported targets are properly detected.

Additional info

-- Cmake    3.25.2
-- Compiler MSVC 19.35.32215.0
-- Build    Release Windows AMD64
-- Host     Windows AMD64

Sorry for the noise. Just had my cmake local cache dirty for some reason.
Closing