Commit 692baa9d authored by Ralf Habacker's avatar Ralf Habacker

Simplified cmake xml parser dependencies.

Find either expat or libxml2 xml parser libraries, depending on -DDBUS_USE_EXPAT=ON|OFF

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41027Reviewed-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
parent 337d9432
......@@ -87,9 +87,8 @@ if (WIN32)
include(Win32Macros)
addExplorerWrapper(${CMAKE_PROJECT_NAME})
endif (WIN32)
find_package(LibXml2)
find_package(LibExpat)
find_package(X11)
option (DBUS_USE_EXPAT "Use expat (== ON) or libxml2 (==OFF)" ON)
if(NOT WIN32)
OPTION(DBUS_ENABLE_ABSTRACT_SOCKETS "enable support for abstract sockets" ON)
......@@ -100,6 +99,13 @@ OPTION(DBUS_DISABLE_ASSERTS "Disable assertion checking" OFF)
option (DBUS_ENABLE_STATS "enable bus daemon usage statistics" OFF)
if (DBUS_USE_EXPAT)
find_package(LibExpat)
else ()
find_package(LibXml2)
endif ()
find_package(X11)
# analogous to AC_USE_SYSTEM_EXTENSIONS in configure.ac
add_definitions(-D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE)
......@@ -299,12 +305,6 @@ if(NOT LIBXML2_FOUND AND NOT LIBEXPAT_FOUND)
message(FATAL "Neither expat nor libxml2 found!")
endif(NOT LIBXML2_FOUND AND NOT LIBEXPAT_FOUND)
if(LIBEXPAT_FOUND)
OPTION(DBUS_USE_EXPAT "Use expat (== ON) or libxml2 (==OFF)" ON)
else(LIBEXPAT_FOUND)
OPTION(DBUS_USE_EXPAT "Use expat (== ON) or libxml2 (==OFF)" OFF)
endif(LIBEXPAT_FOUND)
if(DBUS_USE_EXPAT)
SET(XML_LIB "Expat")
SET(XML_LIBRARY ${LIBEXPAT_LIBRARIES})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment