]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
CMakeLists.txt: Make libxml2 and expat optional 101/head
authorXiao-Long Chen <chenxiaolong@cxl.epac.to>
Sun, 15 Feb 2015 21:06:25 +0000 (16:06 -0500)
committerXiao-Long Chen <chenxiaolong@cxl.epac.to>
Sun, 15 Feb 2015 21:06:25 +0000 (16:06 -0500)
CMakeLists.txt

index 4974d7671d565139aa3f89c9fc4b7daca60c51e7..26c8e402761b4406f7d467233377ca086c39474f 100644 (file)
@@ -164,6 +164,7 @@ OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON)
 OPTION(ENABLE_LZMA "Enable the use of the system found LZMA library if found" ON)
 OPTION(ENABLE_ZLIB "Enable the use of the system found ZLIB library if found" ON)
 OPTION(ENABLE_BZip2 "Enable the use of the system found BZip2 library if found" ON)
+OPTION(ENABLE_LIBXML2 "Enable the use of the system found libxml2 library if found" ON)
 OPTION(ENABLE_EXPAT "Enable the use of the system found EXPAT library if found" ON)
 OPTION(ENABLE_PCREPOSIX "Enable the use of the system found PCREPOSIX library if found" ON)
 OPTION(ENABLE_LibGCC "Enable the use of the system found LibGCC library if found" ON)
@@ -965,8 +966,12 @@ ENDIF(ENABLE_ICONV)
 
 #
 # Find Libxml2
-FIND_PACKAGE(LibXml2)
 #
+IF(ENABLE_LIBXML2)
+  FIND_PACKAGE(LibXml2)
+ELSE()
+  SET(LIBXML2_FOUND FALSE)
+ENDIF()
 IF(LIBXML2_FOUND)
   CMAKE_PUSH_CHECK_STATE()     # Save the state of the variables
   INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
@@ -991,7 +996,11 @@ ELSE(LIBXML2_FOUND)
   #
   # Find Expat
   #
-  FIND_PACKAGE(EXPAT)
+  IF(ENABLE_EXPAT)
+    FIND_PACKAGE(EXPAT)
+  ELSE()
+    SET(EXPAT_FOUND FALSE)
+  ENDIF()
   IF(EXPAT_FOUND)
     CMAKE_PUSH_CHECK_STATE()   # Save the state of the variables
     INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIR})