[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 98/205: cmake: add support for building HTML and PD
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 98/205: cmake: add support for building HTML and PDF docs |
Date: |
Thu, 20 Apr 2017 16:20:38 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.54.0
in repository gnurl.
commit 898b012a9bf388590c4be7f526815b5ab74feca1
Author: Peter Wu <address@hidden>
AuthorDate: Sat Feb 25 18:14:57 2017 +0100
cmake: add support for building HTML and PDF docs
Note that for some reason there is this warning (that also exists with
autotools, added since curl-7_15_1-94-ga718cb05f):
docs/libcurl/curl_multi_socket_all.3:1: can't open
`man3/curl_multi_socket.3': No such file or directory
Additionally, adjust the roffit --mandir option to support creating
links when doing out-of-tree builds.
Ref: https://github.com/curl/curl/pull/1288
---
docs/CMakeLists.txt | 2 +-
docs/libcurl/CMakeLists.txt | 55 ++++++++++++++++++++++++++++++++++++++++
docs/libcurl/opts/CMakeLists.txt | 12 +++++++++
3 files changed, 68 insertions(+), 1 deletion(-)
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index 4b111b85a..694861725 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -1,3 +1,3 @@
#add_subdirectory(examples)
-#add_subdirectory(libcurl)
+add_subdirectory(libcurl)
add_subdirectory(cmdline-opts)
diff --git a/docs/libcurl/CMakeLists.txt b/docs/libcurl/CMakeLists.txt
new file mode 100644
index 000000000..bdbcad45f
--- /dev/null
+++ b/docs/libcurl/CMakeLists.txt
@@ -0,0 +1,55 @@
+# Load man_MANS from shared file
+transform_makefile_inc("Makefile.inc"
"${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
+include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
+
+function(add_manual_pages _listname)
+ foreach(_file IN LISTS ${_listname})
+ if(_file STREQUAL "libcurl-symbols.3")
+ # Special case, an auto-generated file.
+ set(_srcfile "${CMAKE_CURRENT_BINARY_DIR}/${_file}")
+ else()
+ set(_srcfile "${CMAKE_CURRENT_SOURCE_DIR}/${_file}")
+ endif()
+
+ string(REPLACE ".3" ".html" _htmlfile
"${CMAKE_CURRENT_BINARY_DIR}/${_file}")
+ add_custom_command(OUTPUT "${_htmlfile}"
+ COMMAND roffit "--mandir=${CMAKE_CURRENT_SOURCE_DIR}" "${_srcfile}" >
"${_htmlfile}"
+ DEPENDS "${_srcfile}"
+ VERBATIM
+ )
+
+ string(REPLACE ".3" ".pdf" _pdffile "${CMAKE_CURRENT_BINARY_DIR}/${_file}")
+ string(REPLACE ".3" ".ps" _psfile "${CMAKE_CURRENT_BINARY_DIR}/${_file}")
+ # XXX any reason why groff -Tpdf (for gropdf) is not used?
+ add_custom_command(OUTPUT "${_pdffile}"
+ COMMAND groff -Tps -man "${_srcfile}" > "${_psfile}"
+ COMMAND ps2pdf "${_psfile}" "${_pdffile}"
+ COMMAND "${CMAKE_COMMAND}" -E remove "${_psfile}"
+ DEPENDS "${_srcfile}"
+ #BYPRODUCTS "${_psfile}"
+ VERBATIM
+ )
+ # "BYPRODUCTS" for add_custom_command requires CMake 3.2. For now hope that
+ # the temporary files are removed (i.e. the command is not interrupted).
+ endforeach()
+endfunction()
+
+add_custom_command(OUTPUT libcurl-symbols.3
+ COMMAND
+ "${PERL_EXECUTABLE}"
+ "${CMAKE_CURRENT_SOURCE_DIR}/mksymbolsmanpage.pl" <
+ "${CMAKE_CURRENT_SOURCE_DIR}/symbols-in-versions" > libcurl-symbols.3
+ DEPENDS
+ "${CMAKE_CURRENT_SOURCE_DIR}/symbols-in-versions"
+ "${CMAKE_CURRENT_SOURCE_DIR}/mksymbolsmanpage.pl"
+ VERBATIM
+)
+
+add_manual_pages(man_MANS)
+
+string(REPLACE ".3" ".html" HTMLPAGES "${man_MANS}")
+string(REPLACE ".3" ".pdf" PDFPAGES "${man_MANS}")
+add_custom_target(html DEPENDS "${HTMLPAGES}")
+add_custom_target(pdf DEPENDS "${PDFPAGES}")
+
+add_subdirectory(opts)
diff --git a/docs/libcurl/opts/CMakeLists.txt b/docs/libcurl/opts/CMakeLists.txt
new file mode 100644
index 000000000..24c011180
--- /dev/null
+++ b/docs/libcurl/opts/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Load man_MANS from shared file
+transform_makefile_inc("Makefile.inc"
"${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
+include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
+
+add_manual_pages(man_MANS)
+
+string(REPLACE ".3" ".html" HTMLPAGES "${man_MANS}")
+string(REPLACE ".3" ".pdf" PDFPAGES "${man_MANS}")
+add_custom_target(opts-html DEPENDS "${HTMLPAGES}")
+add_custom_target(opts-pdf DEPENDS "${PDFPAGES}")
+add_dependencies(html opts-html)
+add_dependencies(pdf opts-pdf)
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 72/205: test1287: added verbose logs keyword, (continued)
- [GNUnet-SVN] [gnurl] 72/205: test1287: added verbose logs keyword, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 76/205: RELEASE-NOTES: synced with c25e0761d0fc49c4, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 52/205: openssl: unbreak the build after 6448f98c1857de, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 91/205: CONTRIBUTE: mention referring to github issues in commit msgs, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 86/205: darwinssl: fix typo in variable name, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 94/205: RELEASE-NOTES: typo, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 85/205: tool_operate: Fix showing HTTPS-Proxy options on CURLE_SSL_CACERT, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 113/205: .gitattributes: turn off CRLF for *.am, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 120/205: http: do not treat FTPS over CONNECT as HTTPS, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 110/205: tests/README: make "Run" section foolproof, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 98/205: cmake: add support for building HTML and PDF docs,
gnunet <=
- [GNUnet-SVN] [gnurl] 95/205: examples: comment typos in http2 examples, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 70/205: url: add option CURLOPT_SUPPRESS_CONNECT_HEADERS, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 22/205: url: split off proxy init and parsing from create_conn, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 122/205: make: use the variable MAKE for recursive calls, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 129/205: cmake: add cmake file in docs/libcurl/opts/ to dist, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 45/205: gitignore: Ignore man page dist files, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 74/205: test1440/1: depend on well-defined file: behaviour, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 88/205: test714/5: added HTTP as a required feature, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 114/205: multi: fix MinGW-w64 compiler warnings, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 117/205: openssl: exclude DSA code when OPENSSL_NO_DSA is defined, gnunet, 2017/04/20