From f5a7eacec19610c37514bc28c5553b215dd81372 Mon Sep 17 00:00:00 2001 From: Dawit Alemayehu Date: Fri, 14 May 2010 04:31:59 +0000 Subject: Fix the location detection of docbook xsl style sheet in platforms that use version number in the path names, e.g. ArchLinux. svn path=/trunk/KDE/kdelibs/; revision=1126482 --- modules/FindDocBookXSL.cmake | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'modules/FindDocBookXSL.cmake') diff --git a/modules/FindDocBookXSL.cmake b/modules/FindDocBookXSL.cmake index 44f69699..60ce2e70 100644 --- a/modules/FindDocBookXSL.cmake +++ b/modules/FindDocBookXSL.cmake @@ -10,12 +10,24 @@ # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. +set (STYLESHEET_PATH_LIST + share/xml/docbook/stylesheet/docbook-xsl + share/sgml/docbook/xsl-stylesheets + share/xml/docbook/stylesheet/nwalsh/current +) + +foreach (STYLESHEET_PREFIX_ITER ${CMAKE_SYSTEM_PREFIX_PATH}) + file(GLOB STYLESHEET_SUFFIX_ITER RELATIVE ${STYLESHEET_PREFIX_ITER} + ${STYLESHEET_PREFIX_ITER}/share/xml/docbook/xsl-stylesheets-* + ) + if (STYLESHEET_SUFFIX_ITER) + list (APPEND STYLESHEET_PATH_LIST ${STYLESHEET_SUFFIX_ITER}) + endif () +endforeach () + find_path (DOCBOOKXSL_DIR VERSION PATHS ${CMAKE_SYSTEM_PREFIX_PATH} - PATH_SUFFIXES - share/xml/docbook/stylesheet/docbook-xsl - share/sgml/docbook/xsl-stylesheets - share/xml/docbook/stylesheet/nwalsh/current + PATH_SUFFIXES ${STYLESHEET_PATH_LIST} ) find_package_handle_standard_args (DocBookXSL -- cgit v1.2.1