[Cmake-commits] CMake branch, next, updated. v2.8.7-2283-ge8f216d
Rolf Eike Beer
eike at sf-mail.de
Thu Jan 26 12:36:26 EST 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via e8f216d2ead9cc3ce2deb198270e0207b3208d53 (commit)
via 9d7a00104f6efa4f13cf2a5c69c79b9d6f6e261d (commit)
from 68259f4f63f4afb5f591c888cdd6f7f194339213 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e8f216d2ead9cc3ce2deb198270e0207b3208d53
commit e8f216d2ead9cc3ce2deb198270e0207b3208d53
Merge: 68259f4 9d7a001
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Thu Jan 26 12:36:23 2012 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jan 26 12:36:23 2012 -0500
Merge topic 'improve-libxml2' into next
9d7a001 FindLibXml2: detect version when PkgConfig is not used
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9d7a00104f6efa4f13cf2a5c69c79b9d6f6e261d
commit 9d7a00104f6efa4f13cf2a5c69c79b9d6f6e261d
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Thu Jan 26 18:35:14 2012 +0100
Commit: Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Thu Jan 26 18:35:13 2012 +0100
FindLibXml2: detect version when PkgConfig is not used
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index a797b12..48a5498 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -45,15 +45,22 @@ FIND_PROGRAM(LIBXML2_XMLLINT_EXECUTABLE xmllint)
# for backwards compat. with KDE 4.0.x:
SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
+IF(PC_LIBXML_VERSION)
+ SET(LIBXML2_VERSION_STRING ${PC_LIBXML_VERSION})
+ELSEIF(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h")
+ FILE(STRINGS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h" libxml2_version_str
+ REGEX "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\".*\"")
+
+ STRING(REGEX REPLACE "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
+ LIBXML2_VERSION_STRING "${libxml2_version_str}")
+ UNSET(libxml2_version_str)
+ENDIF()
+
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2
REQUIRED_VARS LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR
- VERSION_VAR PC_LIBXML_VERSION)
-
-IF(LIBXML2_FOUND)
- SET(LIBXML2_VERSION_STRING ${PC_LIBXML_VERSION})
-ENDIF()
+ VERSION_VAR LIBXML2_VERSION_STRING)
MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)
-----------------------------------------------------------------------
Summary of changes:
Modules/FindLibXml2.cmake | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list