Skip to content
Snippets Groups Projects
Verified Commit 1f178757 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Fix coeurl lookup

parent 13d219e8
No related branches found
No related tags found
No related merge requests found
......@@ -191,20 +191,22 @@ if(USE_BUNDLED_COEURL)
FetchContent_MakeAvailable(coeurl)
set(COEURL_TARGET_NAME coeurl::coeurl)
else()
# FindPkgConfig sets this as a cache variable, which breaks find_package
if(DEFINED coeurl_FOUND)
unset(coeurl_FOUND CACHE)
find_package(PkgConfig)
pkg_check_modules(coeurl IMPORTED_TARGET coeurl>=0.1.1)
if (TARGET PkgConfig::coeurl)
set(COEURL_TARGET_NAME PkgConfig::coeurl)
endif()
endif()
if(NOT TARGET PkgConfig::coeurl)
find_package(coeurl 0.1.1 CONFIG)
if (coeurl_FOUND)
if (TARGET coeurl::coeurl)
set(COEURL_TARGET_NAME coeurl::coeurl)
endif()
endif()
if(NOT COEURL_TARGET_NAME)
find_package(PkgConfig REQUIRED)
pkg_check_modules(coeurl REQUIRED IMPORTED_TARGET coeurl>=0.1.1)
set(COEURL_TARGET_NAME PkgConfig::coeurl)
if (NOT COEURL_TARGET_NAME)
message(ERROR "Couldn't find coeurl")
endif()
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment