summaryrefslogtreecommitdiff
path: root/man/CMakeLists.txt
blob: 9b6956ac3725e994d6e222854a119004f30af6fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
set(PYTHON python)
set(LIBRARY "libcmark")

if (NOT MSVC)
  add_custom_target(man ALL
    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/cmark.3
    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/cmark.1
    )
  add_custom_command(
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cmark.3
    DEPENDS ${CMAKE_SOURCE_DIR}/src/cmark.h
    DEPENDS ${LIBRARY}
    COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/make_man_page.py
    ${CMAKE_SOURCE_DIR}/src/cmark.h >
    ${CMAKE_CURRENT_BINARY_DIR}/cmark.3
    )
  add_custom_command(
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cmark.1
    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/man1/cmark.1
    COMMAND cp
    ${CMAKE_CURRENT_SOURCE_DIR}/man1/cmark.1
    ${CMAKE_CURRENT_BINARY_DIR}/cmark.1
    )
endif(NOT MSVC)

INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmark.1
  DESTINATION share/man/man1)

INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmark.3
  DESTINATION share/man/man3)