From 99960006e189e1117673809bfd0467d5b97e26c8 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 29 Jan 2013 19:52:06 +0100 Subject: [PATCH] Uses cmake provided expat find package. The cmake provided expat find package is more up to date. There is no need to maintain an additional one. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=59733 --- cmake/CMakeLists.txt | 15 +++++----- cmake/modules/FindLibExpat.cmake | 61 -------------------------------------- 2 Dateien geändert, 8 Zeilen hinzugefügt(+), 68 Zeilen entfernt(-) delete mode 100644 cmake/modules/FindLibExpat.cmake diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 51aa4f4..9a37e40 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1,3 +1,6 @@ +# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules") + # we do not need to have WIN32 defined set(CMAKE_LEGACY_CYGWIN_WIN32 0) @@ -9,8 +12,6 @@ if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) -# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked -set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules") # detect version include(MacrosAutotools) @@ -98,7 +99,7 @@ option (DBUS_ENABLE_STATS "enable bus daemon usage statistics" OFF) option (DBUS_ENABLE_STATS "enable bus daemon usage statistics" OFF) if (DBUS_USE_EXPAT) - find_package(LibExpat) + find_package(EXPAT) else () find_package(LibXml2) endif () @@ -298,14 +299,14 @@ if("${sysname}" MATCHES ".*SOLARIS.*") endif("${sysname}" MATCHES ".*SOLARIS.*") #AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[libxml/expat]],[XML library to use])) -if(NOT LIBXML2_FOUND AND NOT LIBEXPAT_FOUND) +if(NOT LIBXML2_FOUND AND NOT EXPAT_FOUND) message(FATAL "Neither expat nor libxml2 found!") -endif(NOT LIBXML2_FOUND AND NOT LIBEXPAT_FOUND) +endif(NOT LIBXML2_FOUND AND NOT EXPAT_FOUND) if(DBUS_USE_EXPAT) SET(XML_LIB "Expat") - SET(XML_LIBRARY ${LIBEXPAT_LIBRARIES}) - SET(XML_INCLUDE_DIR ${LIBEXPAT_INCLUDE_DIR}) + SET(XML_LIBRARY ${EXPAT_LIBRARIES}) + SET(XML_INCLUDE_DIR ${EXPAT_INCLUDE_DIR}) else(DBUS_USE_EXPAT) SET(XML_LIB "LibXML2") SET(XML_LIBRARY ${LIBXML2_LIBRARIES}) diff --git a/cmake/modules/FindLibExpat.cmake b/cmake/modules/FindLibExpat.cmake deleted file mode 100644 index a07c8de..0000000 --- a/cmake/modules/FindLibExpat.cmake +++ /dev/null @@ -1,61 +0,0 @@ -# - Try to find LIBEXPAT -# Once done this will define -# -# LIBEXPAT_FOUND - system has LIBEXPAT -# LIBEXPAT_INCLUDE_DIR - the LIBEXPAT include directory -# LIBEXPAT_LIBRARIES - the libraries needed to use LIBEXPAT -# LIBEXPAT_DEFINITIONS - Compiler switches required for using LIBEXPAT - -if (LIBEXPAT_INCLUDE_DIR AND LIBEXPAT_LIBRARIES) - - # in cache already - SET(LIBEXPAT_FOUND TRUE) - -else (LIBEXPAT_INCLUDE_DIR AND LIBEXPAT_LIBRARIES) - - IF (WIN32) - file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _progFiles) - find_FILE(LIBEXPAT_DIR expat Source/lib/expat.h - PATHS - "${_progFiles}" - ) - if (LIBEXPAT_DIR) - set (_LIBEXPATIncDir ${LIBEXPAT_DIR}/Source/lib) - set (_LIBEXPATLinkDir ${LIBEXPAT_DIR}/libs) - endif (LIBEXPAT_DIR) - ELSE (WIN32) - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - INCLUDE(UsePkgConfig) - PKGCONFIG(LIBEXPAT-2.0 _LIBEXPATIncDir _LIBEXPATLinkDir _LIBEXPATLinkFlags _LiIconvCflags) - SET(LIBEXPAT_DEFINITIONS ${_LIBEXPATCflags}) - ENDIF (WIN32) - - FIND_PATH(LIBEXPAT_INCLUDE_DIR expat.h - PATHS - ${_LIBEXPATIncDir} - PATH_SUFFIXES LIBEXPAT - ) - - FIND_LIBRARY(LIBEXPAT_LIBRARIES NAMES expat libexpat - PATHS - ${_LIBEXPATLinkDir} - ) - - if (LIBEXPAT_INCLUDE_DIR AND LIBEXPAT_LIBRARIES) - set(LIBEXPAT_FOUND TRUE) - endif (LIBEXPAT_INCLUDE_DIR AND LIBEXPAT_LIBRARIES) - - if (LIBEXPAT_FOUND) - if (NOT LIBEXPAT_FIND_QUIETLY) - message(STATUS "Found libexpat: ${LIBEXPAT_LIBRARIES}") - endif (NOT LIBEXPAT_FIND_QUIETLY) - else (LIBEXPAT_FOUND) - if (LIBEXPAT_FIND_REQUIRED) - message(SEND_ERROR "Could NOT find libexpat") - endif (LIBEXPAT_FIND_REQUIRED) - endif (LIBEXPAT_FOUND) - - MARK_AS_ADVANCED(LIBEXPAT_INCLUDE_DIR LIBEXPAT_LIBRARIES) - -endif (LIBEXPAT_INCLUDE_DIR AND LIBEXPAT_LIBRARIES) -- 1.7.10.4