mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 09:27:59 +00: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:
parent
31f496b59c
commit
e706c04451
@ -3,6 +3,8 @@ project(putty LANGUAGES C)
|
||||
|
||||
include(cmake/setup.cmake)
|
||||
|
||||
# Scan the docs directory first, so that when we start calling
|
||||
# installed_program(), we'll know if we have man pages available
|
||||
add_subdirectory(doc)
|
||||
|
||||
add_compile_definitions(HAVE_CMAKE_H)
|
||||
|
@ -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()
|
||||
|
@ -103,6 +103,14 @@ macro(manpage title section)
|
||||
DEPENDS
|
||||
mancfg.but man-${title}.but)
|
||||
list(APPEND manpage_outputs ${title}.${section})
|
||||
set(HAVE_MANPAGE_${title}_${section} ON PARENT_SCOPE)
|
||||
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${title}.${section})
|
||||
add_custom_command(OUTPUT ${title}.${section}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${title}.${section} ${title}.${section}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${title}.${section})
|
||||
list(APPEND manpage_outputs ${title}.${section})
|
||||
set(HAVE_MANPAGE_${title}_${section} ON PARENT_SCOPE)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user