summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@codelibre.net>2022-06-11 09:51:12 +0100
committerRoger Leigh <rleigh@codelibre.net>2022-06-11 10:10:08 +0100
commit47d0894f1339efd3f43a9aaaad2694238ed49f98 (patch)
treee3bf0951b5ad8d1a5ffd783e2a29f9764fc8c13c
parent033f8b51b83c3cf86e01e5613d0ae3a148e61388 (diff)
downloadlibtiff-git-47d0894f1339efd3f43a9aaaad2694238ed49f98.tar.gz
build: Distribute and install HTML documentation
-rw-r--r--doc/CMakeLists.txt4
-rw-r--r--doc/Makefile.am20
2 files changed, 18 insertions, 6 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 83b46fb8..14a00d8f 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -137,6 +137,10 @@ if (BUILD_SPHINX AND SPHINX_BUILD)
WORKING_DIRECTORY "${sphinx_srcdir}"
DEPENDS doc-linkcheck)
add_dependencies(doc-locallinkcheck ${PROJECT_NAME}-doc-locallinkcheck)
+elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/html-prebuilt/")
+ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/html-prebuilt/"
+ DESTINATION "${CMAKE_INSTALL_DOCDIR}/manual/html"
+ COMPONENT "runtime")
else()
message(WARNING "Manual pages and HTML manual will not be generated or installed")
endif()
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 8bf82325..87938d21 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -34,7 +34,6 @@ doc-html:
-d "$(builddir)/cache" \
-b html \
"$(srcdir)" "$(builddir)/html"
-endif
html/index.html: doc-html
@@ -44,15 +43,21 @@ clean-local:
rm -r html
rm -r cache
-install-data-local:
- find html -type d | sed -e 's;^html;;' | while read dir; do \
+html_installdir = html
+else
+html_installdir = $(srcdir)/html-prebuilt
+endif
+
+
+install-data-local: all-local
+ find $(html_installdir) -type d | sed -e 's;^$(html_installdir);;' | while read dir; do \
echo " $(MKDIR_P) '$(DESTDIR)$(docdir)$$dir'"; \
$(MKDIR_P) "$(DESTDIR)$(docdir)$$dir" || exit 1; \
done
- find html -type f | sed -e 's;^html;;' | while read docfile; do \
+ find $(html_installdir) -type f | sed -e 's;^$(html_installdir);;' | while read docfile; do \
docsubdir=$$(dirname $$docfile); \
- echo "$(INSTALL_DATA) 'html$$docfile' '$(DESTDIR)$(docdir)$$docsubdir'"; \
- $(INSTALL_DATA) "html$$docfile" "$(DESTDIR)$(docdir)$$docsubdir"; \
+ echo "$(INSTALL_DATA) '$(html_installdir)$$docfile' '$(DESTDIR)$(docdir)$$docsubdir'"; \
+ $(INSTALL_DATA) "$(html_installdir)$$docfile" "$(DESTDIR)$(docdir)$$docsubdir"; \
done
uninstall-local:
@@ -147,4 +152,7 @@ EXTRA_DIST = \
static \
$(rst_sources)
+dist-hook: doc-html
+ cp -r html $(distdir)/html-prebuilt
+
.PHONY: doc-html