This commit is contained in:
Richard Shaw 2025-08-07 21:44:51 -05:00
commit c381b15d4d

View file

@ -1,8 +1,9 @@
cmake_minimum_required(VERSION 3.5...4.0)
project(chunkfs
LANGUAGES C
)
cmake_minimum_required(VERSION 3.0)
set(VERSION 0.8)
add_definitions(-DVERSION="${VERSION}")
@ -29,11 +30,30 @@ add_executable(unchunkfs
target_link_libraries(unchunkfs fuse)
add_custom_target(manpage ALL)
# Define the manpage output file
set(MANPAGE_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/chunkfs.1")
add_custom_command(TARGET manpage
COMMAND pod2man -c '' -n CHUNKFS -r 'ChunkFS ${VERSION}' -s 1 ${CMAKE_SOURCE_DIR}/manpage.pod chunkfs.1
)
# Custom command to generate the manpage
add_custom_command(
OUTPUT ${MANPAGE_OUTPUT}
COMMAND pod2man
--center=""
--name="CHUNKFS"
--release="ChunkFS ${VERSION}"
--section=1
"${CMAKE_SOURCE_DIR}/manpage.pod"
"${MANPAGE_OUTPUT}"
DEPENDS "${CMAKE_SOURCE_DIR}/manpage.pod"
COMMENT "Generating chunkfs.1 manpage"
VERBATIM
)
# Custom target to depend on the manpage output
add_custom_target(
manpage
ALL
DEPENDS ${MANPAGE_OUTPUT}
)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink chunkfs.1 unchunkfs.1
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})