-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathFindJSONRPCCPP.cmake
68 lines (57 loc) · 1.76 KB
/
FindJSONRPCCPP.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Finds the JSON-RPC-CPP includes and library
#
# This module defines
# - JSONCPP_INCLUDE_DIRS, where to find json.h, etc.
# - JSONCPP_LIBRARIES, the libraries needed to use jsoncpp.
# - JSONCPP_FOUND, If false, do not try to use jsoncpp.
# - JSONCPP_LIBRARIES, where to find the jsoncpp library.
FIND_PATH(JSONRPCCPP_INCLUDE_DIRS client.h server.h
/usr/include
/usr/local/include
PATH_SUFFIXES jsonrpccpp
)
FIND_LIBRARY(JSONRPCCPP_COMMON_LIBRARIES
NAMES
jsonrpccpp-common
PATHS
/usr/lib
/usr/local/lib
)
FIND_LIBRARY(JSONRPCCPP_CLIENT_LIBRARIES
NAMES
jsonrpccpp-client
PATHS
/usr/lib
/usr/local/lib
)
FIND_LIBRARY(JSONRPCCPP_SERVER_LIBRARIES
NAMES
jsonrpccpp-server
PATHS
/usr/lib
/usr/local/lib
)
IF(NOT JSONRPCCPP_INCLUDE_DIRS)
MESSAGE("Could not find include dirs")
ENDIF(NOT JSONRPCCPP_INCLUDE_DIRS)
IF(NOT JSONRPCCPP_COMMON_LIBRARIES)
MESSAGE("Could not find libraries")
ENDIF(NOT JSONRPCCPP_COMMON_LIBRARIES)
IF(JSONRPCCPP_INCLUDE_DIRS AND JSONRPCCPP_COMMON_LIBRARIES)
SET(JSONRPCCPP_FOUND TRUE)
ENDIF(JSONRPCCPP_INCLUDE_DIRS AND JSONRPCCPP_COMMON_LIBRARIES)
IF(JSONRPCCPP_FOUND)
IF(NOT JSONRPCCPP_FIND_QUIETLY)
MESSAGE(STATUS "Found JSON-RPC-CPP: ${JSONRPCCPP_COMMON_LIBRARIES}")
ENDIF(NOT JSONRPCCPP_FIND_QUIETLY)
ELSE(JSONRPCCPP_FOUND)
IF(JSONRPCCPP_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find JSON-RPC-CPP library include: ${JSONRPCCPP_INCLUDE_DIRS}, lib: ${JSONRPCCPP_COMMON_LIBRARIES}")
ENDIF(JSONRPCCPP_FIND_REQUIRED)
ENDIF(JSONRPCCPP_FOUND)
MARK_AS_ADVANCED(
JSONRPCCPP_INCLUDE_DIRS
JSONRPCCPP_COMMON_LIBRARIES
JSONRPCCPP_CLIENT_LIBRARIES
JSONRPCCPP_SERVER_LIBRARIES
)