Warning, /network/neochat/cmake/Findcmark.cmake is written in an unsupported language. File is not indexed.
0001 # SPDX-FileCopyrightText: 2019 Black Hat <bhat@encom.eu.org> 0002 # SPDX-License-Identifier: GPL-3.0-only 0003 0004 # 0005 # CMake module to search for the cmark library 0006 # 0007 0008 # first try to find cmark-config.cmake 0009 # path to a file not in the search path can be set with 'cmake -Dcmark_DIR=some/path/' 0010 find_package(cmark CONFIG QUIET) 0011 if(cmark_FOUND AND TARGET cmark::cmark) 0012 # found it! 0013 return() 0014 endif() 0015 0016 find_package(PkgConfig QUIET) 0017 if(PKG_CONFIG_FOUND) 0018 pkg_check_modules(PC_CMARK QUIET cmark) 0019 endif() 0020 0021 if(NOT CMARK_INCLUDE_DIR) 0022 find_path(CMARK_INCLUDE_DIR 0023 NAMES cmark.h 0024 PATHS 0025 ${PC_CMARK_INCLUDEDIR} 0026 ${PC_CMARK_INCLUDE_DIRS} 0027 /usr/include 0028 /usr/local/include) 0029 endif() 0030 0031 if(NOT CMARK_LIBRARY) 0032 find_library(CMARK_LIBRARY 0033 NAMES cmark 0034 HINTS 0035 ${PC_CMARK_LIBDIR} 0036 ${PC_CMARK_LIBRARY_DIRS} 0037 /usr/lib 0038 /usr/local/lib) 0039 endif() 0040 0041 if(NOT TARGET cmark::cmark) 0042 add_library(cmark::cmark UNKNOWN IMPORTED) 0043 set_target_properties(cmark::cmark 0044 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES 0045 ${CMARK_INCLUDE_DIR}) 0046 set_property(TARGET cmark::cmark APPEND 0047 PROPERTY IMPORTED_LOCATION ${CMARK_LIBRARY}) 0048 endif() 0049 0050 include(FindPackageHandleStandardArgs) 0051 find_package_handle_standard_args(cmark 0052 DEFAULT_MSG 0053 CMARK_INCLUDE_DIR 0054 CMARK_LIBRARY) 0055 0056 mark_as_advanced(CMARK_LIBRARY CMARK_INCLUDE_DIR) 0057 0058 set(CMARK_LIBRARIES ${CMARK_LIBRARY}) 0059 set(CMARK_INCLUDE_DIRS ${CMARK_INCLUDE_DIR})