From f0780bf173ddfdb7ebbf2c7cd2ffd2e447379a65 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Tue, 13 Oct 2026 03:42:37 +0000 Subject: build: place generated man page under build/doc Co-Authored-By: Claude Fable 5.1 --- CMakeLists.txt | 7 ++++--- README.md | 7 +++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b230fe5..e63860b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,12 +44,13 @@ target_link_libraries(cpsc ) add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cpsc.1" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/doc/cpsc.1" + COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/doc" COMMAND pandoc --standalone --from=markdown --to=man "${CMAKE_CURRENT_SOURCE_DIR}/doc/cpsc.md" - --output "${CMAKE_CURRENT_BINARY_DIR}/cpsc.1" + --output "${CMAKE_CURRENT_BINARY_DIR}/doc/cpsc.1" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/doc/cpsc.md" COMMENT "Generating cpsc(1) manual" VERBATIM ) -add_custom_target(doc DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/cpsc.1") +add_custom_target(doc DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/doc/cpsc.1") diff --git a/README.md b/README.md index ba4132c..5f8a223 100644 --- a/README.md +++ b/README.md @@ -103,8 +103,7 @@ if execution fails. ## Manual -The command-line quick reference is in `doc/cpsc.md`. Generating the man page -requires Pandoc; ordinary builds do not. +The command-line quick reference is in `doc/cpsc.md`. Generating the man page requires Pandoc; ordinary builds do not. From the project root on Linux: @@ -112,11 +111,11 @@ From the project root on Linux: sudo apt-get install pandoc cmake -S . -B build make -C build doc -man ./build/cpsc.1 +man ./build/doc/cpsc.1 ``` You can also run `make doc` inside the configured `build/` directory. -The output is `build/cpsc.1` and is regenerated when the Markdown source changes. +The output is `build/doc/cpsc.1` and is regenerated when the Markdown source changes. # Note -- cgit v1.3.1-4-g156e