summaryrefslogtreecommitdiff
path: root/man/CMakeLists.txt
blob: b37966aacdd89b651f9489e5189512abeae26709 (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
set(PYTHON python2)

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)