Changeset View
Changeset View
Standalone View
Standalone View
cmake/FindDiscount.cmake
- This file was added.
1 | # - Find Discount | ||||
---|---|---|---|---|---|
2 | # Find the Discount markdown library. | ||||
3 | # | ||||
4 | # This module defines | ||||
5 | # Discount_FOUND - whether the Discount library was found | ||||
6 | # Discount_LIBRARIES - the Discount library | ||||
7 | # Discount_INCLUDE_DIR - the include path of the Discount library | ||||
8 | | ||||
9 | # Copyright (c) 2017, Julian Wolff, <wolff@julianwolff.de> | ||||
10 | # Copyright (c) 2018, Sune Vuorela, <sune@kde.org> | ||||
11 | # | ||||
12 | # Redistribution and use is allowed according to the terms of the BSD license. | ||||
13 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||||
14 | | ||||
15 | | ||||
16 | if (Discount_INCLUDE_DIR AND Discount_LIBRARIES) | ||||
17 | | ||||
18 | # Already in cache | ||||
19 | set (Discount_FOUND TRUE) | ||||
20 | | ||||
21 | else (Discount_INCLUDE_DIR AND Discount_LIBRARIES) | ||||
22 | | ||||
23 | find_library (Discount_LIBRARIES | ||||
24 | NAMES markdown libmarkdown | ||||
25 | ) | ||||
26 | | ||||
27 | find_path (Discount_INCLUDE_DIR | ||||
28 | NAMES mkdio.h | ||||
29 | ) | ||||
30 | | ||||
31 | include (FindPackageHandleStandardArgs) | ||||
32 | find_package_handle_standard_args (Discount DEFAULT_MSG Discount_LIBRARIES Discount_INCLUDE_DIR) | ||||
33 | | ||||
34 | endif (Discount_INCLUDE_DIR AND Discount_LIBRARIES) | ||||
35 | | ||||
36 | mark_as_advanced(Discount_INCLUDE_DIR Discount_LIBRARIES) | ||||
37 | | ||||
38 | if (Discount_FOUND) | ||||
39 | add_library(Discount::Lib UNKNOWN IMPORTED) | ||||
40 | set_target_properties(Discount::Lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${Discount_INCLUDE_DIR} IMPORTED_LOCATION ${Discount_LIBRARIES}) | ||||
41 | endif() |