Skip to content

Instantly share code, notes, and snippets.

@stefanofiorentino
Created March 6, 2020 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanofiorentino/8706c892ad9905ceaadaad4a1a999409 to your computer and use it in GitHub Desktop.
Save stefanofiorentino/8706c892ad9905ceaadaad4a1a999409 to your computer and use it in GitHub Desktop.
# - Find libjsoncpp
# Find the native libjsoncpp includes and libraries
#
# JSONCPP_INCLUDE_DIR - where to find json.h, etc.
# JSONCPP_LIBRARIES - List of libraries when using libjsoncpp.
# JSONCPP_FOUND - True if libjsoncpp found.
if (NOT JSONCPP_INCLUDE_DIR)
find_path(JSONCPP_INCLUDE_DIR json/value.h HINTS /usr/include/jsoncpp)
endif()
if (NOT JSONCPP_LIBRARY)
find_library(
JSONCPP_LIBRARY
NAMES jsoncpp)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
JSONCPP DEFAULT_MSG
JSONCPP_LIBRARY JSONCPP_INCLUDE_DIR)
message(STATUS "libjsoncpp include dir: ${JSONCPP_INCLUDE_DIR}")
message(STATUS "libjsoncpp: ${JSONCPP_LIBRARY}")
set(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY})
mark_as_advanced(JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment