summaryrefslogtreecommitdiff
path: root/man/CMakeLists.txt
blob: 2c3f5ef5c215c2ceecd387d9b0f2ca0d5abfed0c (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
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
    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)