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:
committed by
Carl Schwan
parent
408b9eb057
commit
0d0395fab1
@@ -2,6 +2,14 @@
|
|||||||
# CMake module to search for the cmark library
|
# 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)
|
include(FindPkgConfig)
|
||||||
pkg_check_modules(PC_CMARK QUIET cmark)
|
pkg_check_modules(PC_CMARK QUIET cmark)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user