Support to search for cmark-config.cmake

Tell Findcmark.cmake to first search for a `cmark-config.cmake` file
introduced with PR https://github.com/commonmark/cmark/pull/368

If no config file can be found (which provides `cmark::cmark` target use
pkg_config as fallback.
This commit is contained in:
Reinhold Gschweicher
2020-11-26 22:13:04 +01:00
committed by Carl Schwan
parent 408b9eb057
commit 0d0395fab1

View File

@@ -2,6 +2,14 @@
# CMake module to search for the cmark library
#
# first try to find cmark-config.cmake
# path to a file not in the search path can be set with 'cmake -Dcmark_DIR=some/path/'
find_package(cmark CONFIG)
if(cmark_FOUND AND TARGET cmark::cmark)
# found it!
return()
endif()
include(FindPkgConfig)
pkg_check_modules(PC_CMARK QUIET cmark)