summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-06-17 19:49:18 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-06-17 19:49:18 +0200
commit1f17875721a38fb032c1ea7c646ca8fddb2dc92e (patch)
tree4621898c85433b56fc17a01814ff83eec1398b37
parentAdd option to disable implicit json conversions (diff)
downloadnheko-1f17875721a38fb032c1ea7c646ca8fddb2dc92e.tar.xz
Fix coeurl lookup
-rw-r--r--CMakeLists.txt18
1 files changed, 10 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt

index b858197f..3a4f1c20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -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() #