File: FindJsonCpp.cmake

package info (click to toggle)
odil 0.12.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 5,092 kB
  • sloc: cpp: 54,080; python: 3,896; xml: 182; makefile: 94
file content (24 lines) | stat: -rw-r--r-- 950 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# - Try to find JsonCpp
# Once done this will define
#  JsonCpp_FOUND - System has JsonCpp
#  JsonCpp_INCLUDE_DIRS - The JsonCpp include directories
#  JsonCpp_LIBRARIES - The libraries needed to use JsonCpp
#  JsonCpp_DEFINITIONS - Compiler switches required for using JsonCpp

find_package(PkgConfig)
pkg_check_modules(PC_JsonCpp QUIET jsoncpp)
set(JsonCpp_DEFINITIONS ${PC_JsonCpp_CFLAGS_OTHER})

find_path(JsonCpp_INCLUDE_DIR "json/json.h" HINTS ${PC_JsonCpp_INCLUDE_DIRS})
find_library(JsonCpp_LIBRARY NAMES jsoncpp HINTS ${PC_JsonCpp_LIBRARY_DIRS} )

set(JsonCpp_LIBRARIES ${JsonCpp_LIBRARY} )
set(JsonCpp_INCLUDE_DIRS ${JsonCpp_INCLUDE_DIR} )

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set JsonCpp_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(
    JsonCpp DEFAULT_MSG JsonCpp_LIBRARY JsonCpp_INCLUDE_DIR)

mark_as_advanced(JsonCpp_INCLUDE_DIR JsonCpp_LIBRARY)