|
|
|
@ -2,9 +2,8 @@ |
|
|
|
# Find the discount markdown library. |
|
|
|
# Find the discount markdown library. |
|
|
|
# |
|
|
|
# |
|
|
|
# This module defines |
|
|
|
# This module defines |
|
|
|
# discount_FOUND - whether the discount library was found |
|
|
|
# Discount_FOUND - whether the discount library was found |
|
|
|
# discount_LIBRARIES - the discount library |
|
|
|
# PkgConfig::Discount - the discount target to link to |
|
|
|
# discount_INCLUDE_DIR - the include path of the discount library |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Copyright (c) 2017, Julian Wolff, <wolff@julianwolff.de> |
|
|
|
# Copyright (c) 2017, Julian Wolff, <wolff@julianwolff.de> |
|
|
|
# Copyright (c) 2018, Sune Vuorela, <sune@kde.org> |
|
|
|
# Copyright (c) 2018, Sune Vuorela, <sune@kde.org> |
|
|
|
@ -12,30 +11,10 @@ |
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license. |
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license. |
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. |
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs) |
|
|
|
|
|
|
|
|
|
|
|
if (discount_INCLUDE_DIR AND discount_LIBRARIES) |
|
|
|
find_package(PkgConfig REQUIRED) |
|
|
|
|
|
|
|
|
|
|
|
# Already in cache |
|
|
|
pkg_check_modules(Discount IMPORTED_TARGET "libmarkdown") |
|
|
|
set (discount_FOUND TRUE) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else (discount_INCLUDE_DIR AND discount_LIBRARIES) |
|
|
|
find_package_handle_standard_args(Discount DEFAULT_MSG Discount_LIBRARIES) |
|
|
|
|
|
|
|
|
|
|
|
find_library (discount_LIBRARIES |
|
|
|
|
|
|
|
NAMES markdown libmarkdown |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
find_path (discount_INCLUDE_DIR |
|
|
|
|
|
|
|
NAMES mkdio.h |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include (FindPackageHandleStandardArgs) |
|
|
|
|
|
|
|
find_package_handle_standard_args (discount DEFAULT_MSG discount_LIBRARIES discount_INCLUDE_DIR) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
endif (discount_INCLUDE_DIR AND discount_LIBRARIES) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mark_as_advanced(discount_INCLUDE_DIR discount_LIBRARIES) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (discount_FOUND) |
|
|
|
|
|
|
|
add_library(discount::Lib UNKNOWN IMPORTED) |
|
|
|
|
|
|
|
set_target_properties(discount::Lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${discount_INCLUDE_DIR} IMPORTED_LOCATION ${discount_LIBRARIES}) |
|
|
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
|