From 564f38396fbaeaae22b066fd36da5cd346305599 Mon Sep 17 00:00:00 2001 From: Gleb Popov <6yearold@gmail.com> Date: Mon, 15 Mar 2021 10:25:20 +0300 Subject: [PATCH] Add CMake option to allow using system pugixml library --- cmake/fetch_pugixml.cmake | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cmake/fetch_pugixml.cmake b/cmake/fetch_pugixml.cmake index b5f870bea..88ac3cf7b 100644 --- a/cmake/fetch_pugixml.cmake +++ b/cmake/fetch_pugixml.cmake @@ -18,9 +18,16 @@ message(" - fetch_pugixml") Include(FetchContent) -FetchContent_Declare( - pugixml - GIT_REPOSITORY https://github.com/zeux/pugixml.git - GIT_TAG v1.11.4) +option(BUILD_PUGIXML "Build pugixml library, use system one otherwise" YES) -FetchContent_MakeAvailable(pugixml) +if(BUILD_PUGIXML) + + FetchContent_Declare( + pugixml + GIT_REPOSITORY https://github.com/zeux/pugixml.git + GIT_TAG v1.11.4) + + FetchContent_MakeAvailable(pugixml) +else() + find_package(pugixml REQUIRED) +endif()