lgogdownloader/cmake/FindJsoncpp.cmake
James Le Cuirot ff353126ec
Fix find_path for newer jsoncpp release
features.h was renamed but allocator.h wasn't so the latter works with
both old and new versions.
2019-11-20 22:24:10 +00:00

35 lines
772 B
CMake

# - Try to find Jsoncpp
#
# Once done, this will define
# Jsoncpp_FOUND - system has Jsoncpp
# Jsoncpp_INCLUDE_DIRS - the Jsoncpp include directories
# Jsoncpp_LIBRARIES - link these to use Jsoncpp
find_package(PkgConfig)
pkg_check_modules(PC_JSONCPP REQUIRED jsoncpp)
find_path(JSONCPP_INCLUDE_DIR
NAMES
json/allocator.h
HINTS
${PC_JSONCPP_INCLUDEDIR}
${PC_JSONCPP_INCLUDEDIRS}
PATH_SUFFIXES
jsoncpp
PATHS
${PC_JSONCPP_INCLUDE_DIRS}
)
find_library(JSONCPP_LIBRARY jsoncpp
PATHS
${PC_JSONCPP_LIBRARY_DIRS}
)
mark_as_advanced(JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY)
if(PC_JSONCPP_FOUND)
set(Jsoncpp_FOUND ON)
set(Jsoncpp_INCLUDE_DIRS ${JSONCPP_INCLUDE_DIR})
set(Jsoncpp_LIBRARIES ${JSONCPP_LIBRARY})
endif(PC_JSONCPP_FOUND)