Skip to content

Commit 9ce7f45

Browse files
committed
cmake: always install man pages, only install for the binaries installed
There are currently two problems with the manpage installation: - Installing man pages is conditional on "build_doc", which otherwise controls whether the PDF and HTML is generated. However, the man pages are small and statically checked into git -- their purpose is not to fully document doxygen, but provide versions of the `--help` text which don't require running the program, and can be searched and indexed. Distributors *always* expect software to install the man pages, even when documentation is disabled. - All the manpages are installed together, for 4 different programs. But depending on build configuration, 3 of those programs might not be built. It makes no sense to document the `--help` text for programs which are not installed.
1 parent ee1d4b5 commit 9ce7f45

File tree

2 files changed

+33
-16
lines changed

2 files changed

+33
-16
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,10 @@ if (build_doc_chm)
223223
endif ()
224224
endif ()
225225

226+
# always parse doc directory to at least install man pages
227+
add_subdirectory(doc)
226228
if (build_doc)
227229
add_subdirectory(examples)
228-
add_subdirectory(doc)
229230
endif ()
230231

231232
add_subdirectory(doc_internal)

doc/CMakeLists.txt

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,40 @@ include (${TOP}/cmake/version.cmake)
1515
string(TIMESTAMP DATE "%d-%m-%Y")
1616
string(TIMESTAMP YEAR "%Y")
1717

18+
# Always install man pages
19+
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/man)
20+
configure_file(${PROJECT_SOURCE_DIR}/doc/doxygen.1 ${PROJECT_BINARY_DIR}/man/doxygen.1)
21+
configure_file(${PROJECT_SOURCE_DIR}/doc/doxywizard.1 ${PROJECT_BINARY_DIR}/man/doxywizard.1)
22+
configure_file(${PROJECT_SOURCE_DIR}/doc/doxysearch.1 ${PROJECT_BINARY_DIR}/man/doxysearch.1)
23+
configure_file(${PROJECT_SOURCE_DIR}/doc/doxyindexer.1 ${PROJECT_BINARY_DIR}/man/doxyindexer.1)
24+
25+
26+
include(GNUInstallDirs)
27+
install(FILES
28+
"${PROJECT_BINARY_DIR}/man/doxygen.1"
29+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
30+
31+
if (build_search)
32+
install(FILES
33+
"${PROJECT_BINARY_DIR}/man/doxyindexer.1"
34+
"${PROJECT_BINARY_DIR}/man/doxysearch.1"
35+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
36+
endif()
37+
if (build_wizard)
38+
install(FILES
39+
"${PROJECT_BINARY_DIR}/man/doxywizard.1"
40+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
41+
endif()
42+
43+
# The rest of this file is only for when built documentation is requested.
44+
if (NOT build_doc)
45+
return()
46+
endif()
47+
1848
find_package(Python REQUIRED)
1949
find_program(EPSTOPDF NAMES epstopdf )
2050
find_program(PDFLATEX NAMES pdflatex )
2151
find_program(MAKEINDEX NAMES makeindex )
22-
include(GNUInstallDirs)
2352

2453
if (doxygen_BINARY_DIR)
2554
set(DOXYGEN_EXECUTABLE ${doxygen_BINARY_DIR}/bin/doxygen)
@@ -122,8 +151,7 @@ endif ()
122151

123152
file(GLOB LANG_FILES CONFIGURE_DEPENDS "${TOP}/src//translator_??.h")
124153

125-
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/man
126-
${PROJECT_BINARY_DIR}/src
154+
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/src
127155
${PROJECT_BINARY_DIR}/doc
128156
${PROJECT_BINARY_DIR}/doc/images)
129157

@@ -156,10 +184,6 @@ endforeach()
156184

157185
configure_file(${PROJECT_SOURCE_DIR}/doc/manual.sty ${PROJECT_BINARY_DIR}/doc/manual.sty COPYONLY)
158186
configure_file(${PROJECT_SOURCE_DIR}/doc/doxygen_manual.tex ${PROJECT_BINARY_DIR}/doc/doxygen_manual.tex COPYONLY)
159-
configure_file(${PROJECT_SOURCE_DIR}/doc/doxygen.1 ${PROJECT_BINARY_DIR}/man/doxygen.1)
160-
configure_file(${PROJECT_SOURCE_DIR}/doc/doxywizard.1 ${PROJECT_BINARY_DIR}/man/doxywizard.1)
161-
configure_file(${PROJECT_SOURCE_DIR}/doc/doxysearch.1 ${PROJECT_BINARY_DIR}/man/doxysearch.1)
162-
configure_file(${PROJECT_SOURCE_DIR}/doc/doxyindexer.1 ${PROJECT_BINARY_DIR}/man/doxyindexer.1)
163187
configure_file(${PROJECT_SOURCE_DIR}/templates/icon/doxygen.ico ${PROJECT_BINARY_DIR}/doc/doxygen.ico COPYONLY)
164188

165189
# Call the main page "Introduction" in LaTeX, which is more appropriate for that format.
@@ -247,14 +271,6 @@ add_custom_target(docs_chm
247271
)
248272
endif ()
249273
################################################################################
250-
install(FILES
251-
"${PROJECT_BINARY_DIR}/man/doxygen.1"
252-
"${PROJECT_BINARY_DIR}/man/doxywizard.1"
253-
"${PROJECT_BINARY_DIR}/man/doxysearch.1"
254-
"${PROJECT_BINARY_DIR}/man/doxyindexer.1"
255-
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
256-
)
257-
258274
install(CODE "if(NOT EXISTS \"${PROJECT_BINARY_DIR}/latex/doxygen_manual.pdf\")
259275
message(FATAL_ERROR \"\nTerminating:\n documentation has not been generated, \n create documentation by using the 'docs' target followed by an 'install'\n\")
260276
endif()"

0 commit comments

Comments
 (0)