1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 11:32:48 -05:00

Add the man pages to the 'make install' target.

doc/CMakeLists.txt now sets a variable indicating that we either have,
or can build, each individual man page. And when we call our
installed_program() function to mark a program as official enough to
put in 'make install', that function also installs the man page
similarly if it exists, and warns if not.

For the convenience of people building-and-installing from the .tar.gz
we ship, I've arranged that they can still get the man pages installed
without needing Halibut: the previous commit ensured that the prebuilt
man pages are still in the tarball, and this one arranges that if we
don't have Halibut but we do have prebuilt man pages, then we can
'build' them by copying from the prebuilt versions.
This commit is contained in:
Simon Tatham
2021-05-03 16:25:21 +01:00
parent 31f496b59c
commit e706c04451
3 changed files with 18 additions and 0 deletions

View File

@ -8,6 +8,7 @@ include(CheckIncludeFile)
include(CheckLibraryExists)
include(CheckSymbolExists)
include(CheckCSourceCompiles)
include(GNUInstallDirs)
set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-D_DEFAULT_SOURCE -D_GNU_SOURCE)
@ -120,4 +121,11 @@ function(installed_program target)
# CMAKE_INSTALL_BINDIR.
install(TARGETS ${target})
endif()
if(HAVE_MANPAGE_${target}_1)
install(FILES ${CMAKE_BINARY_DIR}/doc/${target}.1
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
else()
message(WARNING "Could not build man page ${target}.1")
endif()
endfunction()