-
Notifications
You must be signed in to change notification settings - Fork 213
/
FindMarkdown.cmake
59 lines (52 loc) · 1.36 KB
/
FindMarkdown.cmake
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# - try to find Markdown tool
#
# Cache Variables:
# MARKDOWN_EXECUTABLE
#
# Non-cache variables you might use in your CMakeLists.txt:
# MARKDOWN_FOUND
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2011 Rylie Pavlik <[email protected]>
# https://ryliepavlik.com/
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright 2011, Iowa State University
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# SPDX-License-Identifier: BSL-1.0
file(TO_CMAKE_PATH "${MARKDOWN_ROOT_DIR}" MARKDOWN_ROOT_DIR)
set(MARKDOWN_ROOT_DIR
"${MARKDOWN_ROOT_DIR}"
CACHE
PATH
"Path to search for Markdown")
if(MARKDOWN_EXECUTABLE AND NOT EXISTS "${MARKDOWN_EXECUTABLE}")
set(MARKDOWN_EXECUTABLE "notfound" CACHE PATH FORCE "")
endif()
# If we have a custom path, look there first.
if(MARKDOWN_ROOT_DIR)
find_program(MARKDOWN_EXECUTABLE
NAMES
markdown
PATHS
"${MARKDOWN_ROOT_DIR}"
PATH_SUFFIXES
bin
NO_DEFAULT_PATH)
endif()
find_program(MARKDOWN_EXECUTABLE NAMES markdown)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Markdown
DEFAULT_MSG
MARKDOWN_EXECUTABLE)
if(MARKDOWN_FOUND)
mark_as_advanced(MARKDOWN_ROOT_DIR)
endif()
mark_as_advanced(MARKDOWN_EXECUTABLE)