github #3: add ronn dependency and generate man pages with CMake

This commit is contained in:
Marcus Holland-Moritz 2020-11-30 12:26:51 +01:00
parent cd42e21e2b
commit 6e2a110b51
5 changed files with 16 additions and 7 deletions

View File

@ -50,6 +50,7 @@ pkg_check_modules(LIBLZMA IMPORTED_TARGET liblzma>=5.2.4)
pkg_check_modules(LIBZSTD IMPORTED_TARGET libzstd>=1.3.8)
find_path(SPARSEHASH_INCLUDE_DIR sparsehash/dense_hash_map REQUIRED)
find_program(RONN_EXE ronn)
set(compiler_only
ON
@ -140,6 +141,19 @@ if(WITH_TESTS)
gtest_discover_tests(dwarfs_test)
endif()
foreach(man dwarfs mkdwarfs)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/man/${man}.1
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/man
COMMAND ${RONN_EXE} -r ${CMAKE_CURRENT_SOURCE_DIR}/doc/${man}.md
>${CMAKE_CURRENT_BINARY_DIR}/man/${man}.1
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/doc/${man}.md)
list(APPEND MAN_PAGES ${CMAKE_CURRENT_BINARY_DIR}/man/${man}.1)
endforeach()
add_custom_target(manpages DEPENDS ${MAN_PAGES})
add_dependencies(mkdwarfs manpages)
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_constants.cpp
@ -276,7 +290,7 @@ install(
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
install(FILES man/dwarfs.1 man/mkdwarfs.1 DESTINATION share/man/man1)
install(FILES ${MAN_PAGES} DESTINATION share/man/man1)
install(DIRECTORY include/dwarfs DESTINATION include)
set(CPACK_SOURCE_GENERATOR "TBZ2")

View File

@ -117,6 +117,7 @@ A good starting point for apt-based systems is probably:
make \
bison \
flex \
ronn \
pkg-config \
binutils-dev \
libboost-all-dev \

View File

@ -1,6 +0,0 @@
all: dwarfs.1 mkdwarfs.1
.SUFFIXES: .md .1
.md.1:
@ronn -r $<