From 7bcc8dca27041e2b03855508fe54d435d816a78f Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Thu, 22 Sep 2022 12:59:13 +0200 Subject: [PATCH] cmake: Fix build with libxslt and libxml2 as subprojects Fixes https://gitlab.gnome.org/GNOME/libxml2/-/issues/416 --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d44034e4..db3957d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,9 @@ include(CheckSymbolExists) include(CMakePackageConfigHelpers) include(GNUInstallDirs) -find_package(LibXml2 CONFIG REQUIRED) +if(NOT TARGET LibXml2) + find_package(LibXml2 CONFIG REQUIRED) +endif() option(BUILD_SHARED_LIBS "Build shared libraries" ON) option(LIBXSLT_WITH_DEBUGGER "Add the debugging support" ON)