From 9fc6a20acb2edea4ce4eb0b2c7cb6be49db3586f Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Mon, 9 May 2022 22:41:01 +0100 Subject: [PATCH] Use existing targets for libogg and libopus if available --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee37291..62171fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,8 +22,12 @@ option(OP_DISABLE_DOCS "Do not build API documentation" OFF) include(GNUInstallDirs) -find_package(Ogg REQUIRED) -find_package(Opus REQUIRED) +if (NOT TARGET Ogg::ogg) + find_package(Ogg REQUIRED) +endif() +if(NOT TARGET Opus::opus) + find_package(Opus REQUIRED) +endif() include(CMakePushCheckState) include(CheckSymbolExists)