[libxslt] cmake: Fix build with libxslt and libxml2 as subprojects



commit 7bcc8dca27041e2b03855508fe54d435d816a78f
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Thu Sep 22 12:59:13 2022 +0200

    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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]