Skip to content

Commit 64aa715

Browse files
committed
cmake: add proper targets for man page generation
Otherwise, the output was suppressed when Ninja was used.
1 parent a259e99 commit 64aa715

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,15 @@ macro(create_manpage BINARY)
179179
else()
180180
set(H2M_ARGS "")
181181
endif()
182-
add_custom_command(TARGET ${BINARY} POST_BUILD
182+
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${BINARY}.1"
183183
COMMAND env LC_ALL=C ${HELP2MAN} --no-info --section 1 ${H2M_ARGS}
184184
${CMAKE_CURRENT_BINARY_DIR}/${BINARY}
185185
> ${BINARY}.1 || rm -f ${BINARY}.1
186+
DEPENDS ${BINARY} "${CMAKE_SOURCE_DIR}/doc/${BINARY}.h2m"
186187
COMMENT "Generating ${BINARY} man page"
187188
VERBATIM)
189+
add_custom_target(man-${BINARY} ALL DEPENDS
190+
"${CMAKE_CURRENT_BINARY_DIR}/${BINARY}.1")
188191
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BINARY}.1
189192
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
190193
endmacro(create_manpage)

0 commit comments

Comments
 (0)