diff --git a/.gitignore b/.gitignore index 1863cd9f7f29ac761ba13653c76cbca13f6f2ec7..73ecfae0ea21755ff4b03d2245509bd12bfcc4d5 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ RPM tags extra/txt2c extra/bin2c +extra/dist/tarantoolctl.1 cmake_install.cmake config.mk doc/www/content/docs/dev_guide.html diff --git a/cmake/pod2man.cmake b/cmake/pod2man.cmake index 39572e9847749f9f38cb30f9a0ee7533dd6dfff8..517d8d9217a70794e158356efc64b609cd90a808 100644 --- a/cmake/pod2man.cmake +++ b/cmake/pod2man.cmake @@ -1,30 +1,34 @@ # Generate man pages of the project by using the POD header # written in the tool source code. To use it - include this # file in CMakeLists.txt and invoke -# POD2MAN(<podfile> <manfile> <section> <center>) -FIND_PROGRAM(POD2MAN pod2man) +# pod2man(<podfile> <manfile> <section> <center>) +find_program(POD2MAN pod2man) -MACRO(pod2man PODFILE MANFILE SECTION OUTPATH CENTER) - if (NOT POD2MAN STREQUAL "POD2MAN-NOTFOUND") - IF(NOT EXISTS ${PODFILE}) - message(FATAL ERROR "Could not find pod file ${PODFILE} to generate man page") - ENDIF(NOT EXISTS ${PODFILE}) +if(NOT POD2MAN) + message(STATUS "Could not find pod2man - man pages disabled") +endif(NOT POD2MAN) - SET(OUTPATH_NEW "${PROJECT_BINARY_DIR}/${OUTPATH}") +macro(pod2man PODFILE MANFILE SECTION OUTPATH CENTER) + if(NOT EXISTS ${PODFILE}) + message(FATAL ERROR "Could not find pod file ${PODFILE} to generate man page") + endif(NOT EXISTS ${PODFILE}) - ADD_CUSTOM_COMMAND( + if(POD2MAN) + set(OUTPATH_NEW "${PROJECT_BINARY_DIR}/${OUTPATH}") + + add_custom_command( OUTPUT ${OUTPATH_NEW}/${MANFILE}.${SECTION} COMMAND ${POD2MAN} --section ${SECTION} --center ${CENTER} - --release --stderr --name ${MANFILE} ${PODFILE} > + --release --stderr --name ${MANFILE} ${PODFILE} ${OUTPATH_NEW}/${MANFILE}.${SECTION} ) - SET(MANPAGE_TARGET "man-${MANFILE}") - ADD_CUSTOM_TARGET(${MANPAGE_TARGET} ALL + set(MANPAGE_TARGET "man-${MANFILE}") + add_custom_target(${MANPAGE_TARGET} ALL DEPENDS ${OUTPATH_NEW}/${MANFILE}.${SECTION} ) - INSTALL( + install( FILES ${OUTPATH_NEW}/${MANFILE}.${SECTION} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${SECTION} ) endif() -ENDMACRO(pod2man PODFILE MANFILE SECTION OUTPATH CENTER) +endmacro(pod2man PODFILE MANFILE SECTION OUTPATH CENTER)