aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2017-02-25 14:40:24 +0100
committerPeter Wu <peter@lekensteyn.nl>2017-03-21 14:49:53 +0100
commit84a226a30b2d43f8fb0da996152a8376f1e21d8e (patch)
treee8838a07ad36ca94576637b82fccf7bb58d0373f /docs
parent6f6e9193df20261c275108eeb49c34ee2f71a275 (diff)
cmake: build manual pages (including curl.1)
Also make Perl mandatory to allow building the docs. While CMakeLists.txt could probably read the list of manual pages from Makefile.am, actually putting those in CMakeLists.txt is cleaner so that is what is done here. Fixes #1230 Ref: https://github.com/curl/curl/pull/1288
Diffstat (limited to 'docs')
-rw-r--r--docs/CMakeLists.txt3
-rw-r--r--docs/cmdline-opts/CMakeLists.txt12
2 files changed, 15 insertions, 0 deletions
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
new file mode 100644
index 000000000..4b111b85a
--- /dev/null
+++ b/docs/CMakeLists.txt
@@ -0,0 +1,3 @@
+#add_subdirectory(examples)
+#add_subdirectory(libcurl)
+add_subdirectory(cmdline-opts)
diff --git a/docs/cmdline-opts/CMakeLists.txt b/docs/cmdline-opts/CMakeLists.txt
new file mode 100644
index 000000000..ccee4a142
--- /dev/null
+++ b/docs/cmdline-opts/CMakeLists.txt
@@ -0,0 +1,12 @@
+set(MANPAGE "${CMAKE_BINARY_DIR}/docs/curl.1")
+
+# Load DPAGES and OTHERPAGES from shared file
+transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
+include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
+
+add_custom_command(OUTPUT "${MANPAGE}"
+ COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/gen.pl" mainpage "${CMAKE_CURRENT_SOURCE_DIR}" > "${MANPAGE}"
+ DEPENDS "${DPAGES}" "${OTHERPAGES}"
+ VERBATIM
+)
+add_custom_target(generate-curl.1 DEPENDS "${MANPAGE}")