diff options
author | Matthew Woehlke <mw_triad@users.sourceforge.net> | 2010-05-13 01:49:25 +0000 |
---|---|---|
committer | Matthew Woehlke <mw_triad@users.sourceforge.net> | 2010-05-13 01:49:25 +0000 |
commit | e6741ce784dab86d89fcca4b4ec8184ba6721d25 (patch) | |
tree | ff797ae6b261b50f9c8eeb1b638735a7f6008cfb | |
parent | 121693506b0439e408a9b9e9fa3a16abc5ccff65 (diff) | |
download | extra-cmake-modules-e6741ce784dab86d89fcca4b4ec8184ba6721d25.tar.gz extra-cmake-modules-e6741ce784dab86d89fcca4b4ec8184ba6721d25.tar.bz2 |
Find docbook better when the package version is part of the DTD path.
This is (somewhat) less hackish than the previous approach and is
reportedly needed for OpenSolaris. It should work on all Fedora versions
past and future that use the same convention (and have the required DTD
version, of course) and for anything else with similar conventions.
svn path=/trunk/KDE/kdelibs/; revision=1126043
-rw-r--r-- | modules/FindDocBookXML.cmake | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/modules/FindDocBookXML.cmake b/modules/FindDocBookXML.cmake index 3ed4a1d8..ec3c0d64 100644 --- a/modules/FindDocBookXML.cmake +++ b/modules/FindDocBookXML.cmake @@ -27,15 +27,19 @@ set (DTD_PATH_LIST share/xml/docbook/${DOCBOOKXML_CURRENTDTD_VERSION} ) -#hacks for Fedora -set (DTD_PATH_LIST ${DTD_PATH_LIST} - share/sgml/docbook/xml-dtd-4.2-1.0-48.fc12 - share/sgml/docbook/xml-dtd-4.2-1.0-50.fc13 -) - +# hacks for systems that use the package version in the DTD dirs, +# e.g. Fedora, OpenSolaris +foreach (DTD_PREFIX_ITER ${CMAKE_SYSTEM_PREFIX_PATH}) + file(GLOB DTD_SUFFIX_ITER RELATIVE ${DTD_PREFIX_ITER} + ${DTD_PREFIX_ITER}/share/sgml/docbook/xml-dtd-${DOCBOOKXML_CURRENTDTD_VERSION}-* + ) + if (DTD_SUFFIX_ITER) + list (APPEND DTD_PATH_LIST ${DTD_SUFFIX_ITER}) + endif () +endforeach () + find_path (DOCBOOKXML_CURRENTDTD_DIR docbookx.dtd PATHS ${CMAKE_SYSTEM_PREFIX_PATH} - PATH_SUFFIXES ${DTD_PATH_LIST} ) |