From 8ed42410bf362453199d92a196fc6e1302623792 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 17 May 2021 17:03:43 +0200 Subject: [PATCH] 3rdparty: Add option to build against system pugixml Signed-off-by: Emmanuel Gil Peyrot --- 3rdparty/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 7974883a55..ac978a8eac 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -38,7 +38,13 @@ add_subdirectory(libpng EXCLUDE_FROM_ALL) # pugixml -add_subdirectory(pugixml EXCLUDE_FROM_ALL) +if (USE_SYSTEM_PUGIXML) + pkg_check_modules(PUGIXML REQUIRED IMPORTED_TARGET pugixml>=1.11) + add_library(pugixml INTERFACE) + target_link_libraries(pugixml INTERFACE PkgConfig::PUGIXML) +else() + add_subdirectory(pugixml EXCLUDE_FROM_ALL) +endif() # libusb