File: Findrst2man.cmake

package info (click to toggle)
rdma-core 33.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,844 kB
  • sloc: ansic: 145,804; python: 5,688; sh: 2,761; perl: 1,465; makefile: 73
file content (21 lines) | stat: -rw-r--r-- 722 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# COPYRIGHT (c) 2019 Mellanox Technologies Ltd
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
find_program(RST2MAN_EXECUTABLE NAMES rst2man)

if(RST2MAN_EXECUTABLE)
  execute_process(COMMAND "${RST2MAN_EXECUTABLE}" --version
    OUTPUT_VARIABLE _VERSION
    RESULT_VARIABLE _VERSION_RESULT
    ERROR_QUIET)

  if(NOT _VERSION_RESULT)
    string(REGEX REPLACE "^rst2man \\(Docutils ([^,]+), .*" "\\1" RST2MAN_VERSION_STRING "${_VERSION}")
  endif()
  unset(_VERSION_RESULT)
  unset(_VERSION)
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(rst2man REQUIRED_VARS RST2MAN_EXECUTABLE RST2MAN_VERSION_STRING VERSION_VAR RST2MAN_VERSION_STRING)

mark_as_advanced(RST2MAN_EXECUTABLE)