Warning, /sdk/pology/cmake/FindDocbookXSL.cmake is written in an unsupported language. File is not indexed.

0001 # TODO: Add doc comments.
0002 
0003 include(FindPackageHandleStandardArgs)
0004 
0005 # Find root directory of XSL stylesheets.
0006 if(NOT DOCBOOK_XSL_DIR)
0007     message(STATUS
0008         "Looking for Docbook XSL stylesheets "
0009         "(use -DDOCBOOK_XSL_DIR= to set manually)...")
0010     set(docbook_stylesheet_paths
0011         share/xml/docbook/stylesheet/docbook-xsl
0012         share/xml/docbook/xsl-stylesheets
0013         share/sgml/docbook/xsl-stylesheets
0014         share/xml/docbook/stylesheet/nwalsh/current
0015         share/xml/docbook/stylesheet/nwalsh
0016         share/xsl/docbook
0017         share/xsl/docbook-xsl
0018     )
0019     find_path(DOCBOOK_XSL_DIR lib/lib.xsl
0020         PATHS ${CMAKE_SYSTEM_PREFIX_PATH}
0021         PATH_SUFFIXES ${docbook_stylesheet_paths}
0022     )
0023 else()
0024     if(NOT EXISTS ${DOCBOOK_XSL_DIR}/lib/lib.xsl)
0025         set(DOCBOOK_XSL_DIR no)
0026     endif()
0027 endif()
0028 
0029 # Check stylesheets version.
0030 if(EXISTS ${DOCBOOK_XSL_DIR}/VERSION)
0031     file(READ ${DOCBOOK_XSL_DIR}/VERSION contents)
0032     string(REGEX REPLACE ".*<fm:Version>([^<]*)</fm:Version>.*" "\\1"
0033                          rawversion "${contents}")
0034     string(REGEX REPLACE "(.*[0-9]).*" "\\1"
0035                          DOCBOOK_XSL_VERSION "${rawversion}")
0036 endif()
0037 
0038 find_package_handle_standard_args(DocbookXSL
0039     REQUIRED_VARS DOCBOOK_XSL_DIR
0040     VERSION_VAR DOCBOOK_XSL_VERSION
0041 )