From e6741ce784dab86d89fcca4b4ec8184ba6721d25 Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Thu, 13 May 2010 01:49:25 +0000 Subject: 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 --- modules/FindDocBookXML.cmake | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'modules/FindDocBookXML.cmake') 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} ) -- cgit v1.2.1