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