mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-04 21:08:14 +02:00
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=41027 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
parent
337d9432f2
commit
692baa9d6a
1 changed files with 9 additions and 9 deletions
|
|
@ -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})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue