File: Findpandoc.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-- 693 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# COPYRIGHT (c) 2017 Mellanox Technologies Ltd
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
find_program(PANDOC_EXECUTABLE NAMES pandoc)

if(PANDOC_EXECUTABLE)
  execute_process(COMMAND "${PANDOC_EXECUTABLE}" -v
    OUTPUT_VARIABLE _VERSION
    RESULT_VARIABLE _VERSION_RESULT
    ERROR_QUIET)

  if(NOT _VERSION_RESULT)
    string(REGEX REPLACE "^pandoc ([^\n]+)\n.*" "\\1" PANDOC_VERSION_STRING "${_VERSION}")
  endif()
  unset(_VERSION_RESULT)
  unset(_VERSION)
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(pandoc REQUIRED_VARS PANDOC_EXECUTABLE PANDOC_VERSION_STRING VERSION_VAR PANDOC_VERSION_STRING)

mark_as_advanced(PANDOC_EXECUTABLE)