From 9fb81c6e54a2fe05c0ad0b877fd32f30358e3877 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 21 Aug 2016 20:37:14 +0200 Subject: CMake: Discover docbook stylesheet in other locations Distributions seem to install this stuff all over the place, so let's add a common list of paths we know about. --- CMake/Documentation.cmake | 34 ++++++++++++++++-- doc/docbook-html-style.xsl | 40 --------------------- doc/docbook-html-style.xsl.cmake.in | 40 +++++++++++++++++++++ doc/docbook-text-style.xsl | 70 ------------------------------------- doc/docbook-text-style.xsl.cmake.in | 70 +++++++++++++++++++++++++++++++++++++ doc/manpage-style.xsl | 18 ---------- doc/manpage-style.xsl.cmake.in | 18 ++++++++++ 7 files changed, 159 insertions(+), 131 deletions(-) delete mode 100644 doc/docbook-html-style.xsl create mode 100644 doc/docbook-html-style.xsl.cmake.in delete mode 100644 doc/docbook-text-style.xsl create mode 100644 doc/docbook-text-style.xsl.cmake.in delete mode 100644 doc/manpage-style.xsl create mode 100644 doc/manpage-style.xsl.cmake.in diff --git a/CMake/Documentation.cmake b/CMake/Documentation.cmake index f679b82e1..f3bbfdc6b 100644 --- a/CMake/Documentation.cmake +++ b/CMake/Documentation.cmake @@ -24,6 +24,34 @@ # SOFTWARE. +find_path(DOCBOOK_XSL manpages/docbook.xsl + # Debian + /usr/share/xml/docbook/stylesheet/docbook-xsl + /usr/share/xml/docbook/stylesheet/nwalsh + # OpenSUSE + /usr/share/xml/docbook/stylesheet/nwalsh/current + # Arch + /usr/share/xml/docbook/xsl-stylesheets + # Fedora + /usr/share/sgml/docbook/xsl-stylesheets + # Fink + ${CMAKE_INSTALL_PREFIX}/share/xml/xsl/docbook-xsl + # FreeBSD + ${CMAKE_INSTALL_PREFIX}/share/xsl/docbook/ + NO_DEFAULT_PATH) + +if(NOT DOCBOOK_XSL) + message(FATAL_ERROR "Could not find docbook xsl") +endif() + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docbook-text-style.xsl.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/docbook-text-style.xsl) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docbook-html-style.xsl.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/docbook-html-style.xsl) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/manpage-style.xsl.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/manpage-style.xsl) + + # Split up a string of the form DOCUMENT[.DOCUMENT][.LANGUAGE][.SECTION].EXTENSION # # There might be up to two parts in the document name. The language must be @@ -123,7 +151,7 @@ function(xsltproc_one) else() set(manpage_output "${CMAKE_CURRENT_BINARY_DIR}/${document}.${section}") endif() - set(manpage_stylesheet "${CMAKE_CURRENT_SOURCE_DIR}/manpage-style.xsl") + set(manpage_stylesheet "${CMAKE_CURRENT_BINARY_DIR}/manpage-style.xsl") set(manpage_params) install(FILES ${manpage_output} @@ -137,7 +165,7 @@ function(xsltproc_one) set(html_output "${CMAKE_CURRENT_BINARY_DIR}/${document}.html") endif() set(html_params --stringparam base.dir ${html_output}) - set(html_stylesheet "${CMAKE_CURRENT_SOURCE_DIR}/docbook-html-style.xsl") + set(html_stylesheet "${CMAKE_CURRENT_BINARY_DIR}/docbook-html-style.xsl") install(DIRECTORY ${html_output} DESTINATION ${DOC_INSTALL} OPTIONAL) @@ -150,7 +178,7 @@ function(xsltproc_one) set(text_output "${CMAKE_CURRENT_BINARY_DIR}/${document}.text") endif() set(text_params --stringparam base.dir ${text_output}) - set(text_stylesheet "${CMAKE_CURRENT_SOURCE_DIR}/docbook-text-style.xsl") + set(text_stylesheet "${CMAKE_CURRENT_BINARY_DIR}/docbook-text-style.xsl") file(RELATIVE_PATH text_output_relative ${CMAKE_CURRENT_BINARY_DIR} ${text_output}) diff --git a/doc/docbook-html-style.xsl b/doc/docbook-html-style.xsl deleted file mode 100644 index e4af9f557..000000000 --- a/doc/docbook-html-style.xsl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - -
-
- - index - - - - - - - - - - - - - - - - - - -
diff --git a/doc/docbook-html-style.xsl.cmake.in b/doc/docbook-html-style.xsl.cmake.in new file mode 100644 index 000000000..9216d8e6e --- /dev/null +++ b/doc/docbook-html-style.xsl.cmake.in @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + +
+
+ + index + + + + + + + + + + + + + + + + + + +
diff --git a/doc/docbook-text-style.xsl b/doc/docbook-text-style.xsl deleted file mode 100644 index 376dded52..000000000 --- a/doc/docbook-text-style.xsl +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - -
-
- -
-
-
-
- -
- -
-
- - -
- -
-
-
- - - -
    - -
-
- - - - - - - - - - - - - - - - - - - - - -
- -
-
- -
diff --git a/doc/docbook-text-style.xsl.cmake.in b/doc/docbook-text-style.xsl.cmake.in new file mode 100644 index 000000000..36af1bcb2 --- /dev/null +++ b/doc/docbook-text-style.xsl.cmake.in @@ -0,0 +1,70 @@ + + + + + + + + + + + + + +
+
+ +
+
+
+
+ +
+ +
+
+ + +
+ +
+
+
+ + + +
    + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
diff --git a/doc/manpage-style.xsl b/doc/manpage-style.xsl deleted file mode 100644 index a780bad13..000000000 --- a/doc/manpage-style.xsl +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - -<> - - - - - - - - - diff --git a/doc/manpage-style.xsl.cmake.in b/doc/manpage-style.xsl.cmake.in new file mode 100644 index 000000000..53d6780cb --- /dev/null +++ b/doc/manpage-style.xsl.cmake.in @@ -0,0 +1,18 @@ + + + + + + +<> + + + + + + + + + -- cgit v1.2.3