From 1192dc5134dc0369853f72c6e07636e06d5da959 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Tue, 11 Sep 2018 19:02:36 +0300 Subject: Update CI with cmark --- cmake/Findcmark.cmake | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'cmake') diff --git a/cmake/Findcmark.cmake b/cmake/Findcmark.cmake index fd7d062a..29092bb0 100644 --- a/cmake/Findcmark.cmake +++ b/cmake/Findcmark.cmake @@ -2,23 +2,25 @@ # CMake module to search for the cmark library # -find_path(CMARK_INCLUDE_DIR - NAMES cmark.h - PATHS /usr/include - /usr/local/include - $ENV{LIB_DIR}/include - $ENV{LIB_DIR}/include/cmark) +include(FindPkgConfig) +pkg_check_modules(PC_CMARK QUIET cmark) -find_library(CMARK_LIBRARY - NAMES cmark - PATHS /usr/lib /usr/local/lib $ENV{LIB_DIR}/lib) - -if(OLM_FOUND) - set(OLM_INCLUDE_DIRS ${CMARK_INCLUDE_DIR}) +if(NOT CMARK_INCLUDE_DIR) + find_path(CMARK_INCLUDE_DIR + NAMES cmark.h + PATHS ${PC_CMARK_INCLUDEDIR} + ${PC_CMARK_INCLUDE_DIRS} + /usr/include + /usr/local/include) +endif() - if(NOT OLM_LIBRARIES) - set(OLM_LIBRARIES ${CMARK_LIBRARY}) - endif() +if(NOT CMARK_LIBRARY) + find_library(CMARK_LIBRARY + NAMES cmark + HINTS ${PC_CMARK_LIBDIR} + ${PC_CMARK_LIBRARY_DIRS} + /usr/lib + /usr/local/lib) endif() if(NOT TARGET cmark::cmark) @@ -37,3 +39,6 @@ find_package_handle_standard_args(cmark CMARK_LIBRARY) mark_as_advanced(CMARK_LIBRARY CMARK_INCLUDE_DIR) + +set(CMARK_LIBRARIES ${CMARK_LIBRARY}) +set(CMARK_INCLUDE_DIRS ${CMARK_INCLUDE_DIR}) -- cgit 1.4.1