1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00

cmake: Implement dependent options

This should make sure that configurations are valid but doesn't warn
about invalid configurations.

CMake only supports boolean options and I have no idea how features
like "minimal" or "legacy" that change default values of other options
could be supported.

Fixes #551.
This commit is contained in:
Nick Wellnhofer 2024-06-23 00:32:12 +02:00
parent 600c6ca4bc
commit 7655ed2cc0

View File

@ -19,13 +19,13 @@ include(CheckLibraryExists)
include(CheckLinkerFlag)
include(CheckStructHasMember)
include(CheckSymbolExists)
include(CMakeDependentOption)
include(CMakePackageConfigHelpers)
include(FindPkgConfig)
include(GNUInstallDirs)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
set(LIBXML2_WITH_AUTOMATA ON)
option(LIBXML2_WITH_C14N "Add the Canonicalization support" ON)
option(LIBXML2_WITH_CATALOG "Add the Catalog support" ON)
option(LIBXML2_WITH_DEBUG "Add the debugging module" ON)
set(LIBXML2_WITH_EXPR ON)
@ -42,22 +42,41 @@ option(LIBXML2_WITH_PATTERN "Add the xmlPattern selection interface" ON)
option(LIBXML2_WITH_PROGRAMS "Build programs" ON)
option(LIBXML2_WITH_PUSH "Add the PUSH parser interfaces" ON)
option(LIBXML2_WITH_PYTHON "Build Python bindings" ON)
option(LIBXML2_WITH_READER "Add the xmlReader parsing interface" ON)
option(LIBXML2_WITH_REGEXPS "Add Regular Expressions support" ON)
option(LIBXML2_WITH_SAX1 "Add the older SAX1 interface" ON)
option(LIBXML2_WITH_SCHEMAS "Add Relax-NG and Schemas support" ON)
option(LIBXML2_WITH_SCHEMATRON "Add Schematron support" ON)
option(LIBXML2_WITH_TESTS "Build tests" ON)
option(LIBXML2_WITH_THREADS "Add multithread support" ON)
option(LIBXML2_WITH_THREAD_ALLOC "Add per-thread memory" OFF)
option(LIBXML2_WITH_TLS "Enable thread-local storage" OFF)
set(LIBXML2_WITH_UNICODE ON)
option(LIBXML2_WITH_VALID "Add the DTD validation support" ON)
option(LIBXML2_WITH_WRITER "Add the xmlWriter saving interface" ON)
option(LIBXML2_WITH_XINCLUDE "Add the XInclude support" ON)
option(LIBXML2_WITH_XPATH "Add the XPATH support" ON)
option(LIBXML2_WITH_XPTR "Add the XPointer support" ON)
option(LIBXML2_WITH_ZLIB "Use libz" OFF)
cmake_dependent_option(
LIBXML2_WITH_C14N "Add the Canonicalization support" ON
"LIBXML2_WITH_OUTPUT;LIBXML2_WITH_XPATH" OFF)
cmake_dependent_option(
LIBXML2_WITH_READER "Add the xmlReader parsing interface" ON
"LIBXML2_WITH_PUSH" OFF)
cmake_dependent_option(
LIBXML2_WITH_SCHEMAS "Add Relax-NG and Schemas support" ON
"LIBXML2_WITH_PATTERN;LIBXML2_WITH_REGEXPS" OFF)
cmake_dependent_option(
LIBXML2_WITH_SCHEMATRON "Add Schematron support" ON
"LIBXML2_WITH_PATTERN;LIBXML2_WITH_XPATH" OFF)
cmake_dependent_option(
LIBXML2_WITH_THREAD_ALLOC "Add per-thread memory" OFF
"LIBXML2_WITH_THREADS" OFF)
cmake_dependent_option(
LIBXML2_WITH_WRITER "Add the xmlWriter saving interface" ON
"LIBXML2_WITH_OUTPUT;LIBXML2_WITH_PUSH" OFF)
cmake_dependent_option(
LIBXML2_WITH_XINCLUDE "Add the XInclude support" ON
"LIBXML2_WITH_XPATH" OFF)
cmake_dependent_option(
LIBXML2_WITH_XPTR "Add the XPointer support" ON
"LIBXML2_WITH_XPATH" OFF)
set(LIBXML2_XMLCONF_WORKING_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Working directory for XML Conformance Test Suite")
if(LIBXML2_WITH_PYTHON)