diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-09-11 19:02:36 +0300 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-09-11 19:02:36 +0300 |
commit | 1192dc5134dc0369853f72c6e07636e06d5da959 (patch) | |
tree | 5e781ca1f9dd241ed05bf5d9b8ba9dfb9ea98e02 /cmake | |
parent | Switch to libcmark (diff) | |
download | nheko-1192dc5134dc0369853f72c6e07636e06d5da959.tar.xz |
Update CI with cmark
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Findcmark.cmake | 35 |
1 files changed, 20 insertions, 15 deletions
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}) |