From 219c7a42a54c668459d0002bab2d8a0e635bf62b Mon Sep 17 00:00:00 2001 From: Xiao-Long Chen Date: Sun, 15 Feb 2015 16:06:25 -0500 Subject: [PATCH] CMakeLists.txt: Make libxml2 and expat optional --- CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4974d7671..26c8e4027 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) -- 2.47.2