|
@ -10,6 +10,11 @@ |
|
|
# JSON_RPC_CPP_SERVER_LIBRARIES, the libraries needed to use json-rpc-cpp-server |
|
|
# JSON_RPC_CPP_SERVER_LIBRARIES, the libraries needed to use json-rpc-cpp-server |
|
|
# JSON_RPC_CPP_CLIENT_LIBRARIES, the libraries needed to use json-rpc-cpp-client |
|
|
# JSON_RPC_CPP_CLIENT_LIBRARIES, the libraries needed to use json-rpc-cpp-client |
|
|
# JSON_RCP_CPP_FOUND, If false, do not try to use json-rpc-cpp. |
|
|
# JSON_RCP_CPP_FOUND, If false, do not try to use json-rpc-cpp. |
|
|
|
|
|
# JSON_RPC_CPP_VERSION, version of library |
|
|
|
|
|
# JSON_RPC_CPP_VERSION_MAJOR |
|
|
|
|
|
# JSON_RPC_CPP_VERSION_MINOR |
|
|
|
|
|
# JSON_RPC_CPP_VERSION_PATCH |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# only look in default directories |
|
|
# only look in default directories |
|
|
find_path( |
|
|
find_path( |
|
@ -90,10 +95,28 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") |
|
|
|
|
|
|
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
if (JSON_RPC_CPP_INCLUDE_DIR) |
|
|
|
|
|
set (JSON_RPC_CPP_VERSION_HEADER "${JSON_RPC_CPP_INCLUDE_DIR}/jsonrpccpp/version.h") |
|
|
|
|
|
if (EXISTS ${JSON_RPC_CPP_VERSION_HEADER}) |
|
|
|
|
|
file (STRINGS ${JSON_RPC_CPP_VERSION_HEADER} JSON_RPC_CPP_VERSION_MAJOR REGEX "^#define JSONRPC_CPP_MAJOR_VERSION[ \t]+[0-9]+$") |
|
|
|
|
|
file (STRINGS ${JSON_RPC_CPP_VERSION_HEADER} JSON_RPC_CPP_VERSION_MINOR REGEX "^#define JSONRPC_CPP_MINOR_VERSION[ \t]+[0-9]+$") |
|
|
|
|
|
file (STRINGS ${JSON_RPC_CPP_VERSION_HEADER} JSON_RPC_CPP_VERSION_PATCH REGEX "^#define JSONRPC_CPP_PATCH_VERSION[ \t]+[0-9]+$") |
|
|
|
|
|
string (REGEX REPLACE "^#define JSONRPC_CPP_MAJOR_VERSION[ \t]+([0-9]+)" "\\1" JSON_RPC_CPP_VERSION_MAJOR ${JSON_RPC_CPP_VERSION_MAJOR}) |
|
|
|
|
|
string (REGEX REPLACE "^#define JSONRPC_CPP_MINOR_VERSION[ \t]+([0-9]+)" "\\1" JSON_RPC_CPP_VERSION_MINOR ${JSON_RPC_CPP_VERSION_MINOR}) |
|
|
|
|
|
string (REGEX REPLACE "^#define JSONRPC_CPP_PATCH_VERSION[ \t]+([0-9]+)" "\\1" JSON_RPC_CPP_VERSION_PATCH ${JSON_RPC_CPP_VERSION_PATCH}) |
|
|
|
|
|
set (JSON_RPC_CPP_VERSION ${JSON_RPC_CPP_VERSION_MAJOR}.${JSON_RPC_CPP_VERSION_MINOR}.${JSON_RPC_CPP_VERSION_PATCH}) |
|
|
|
|
|
endif() |
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
# handle the QUIETLY and REQUIRED arguments and set JSON_RPC_CPP_FOUND to TRUE |
|
|
# handle the QUIETLY and REQUIRED arguments and set JSON_RPC_CPP_FOUND to TRUE |
|
|
# if all listed variables are TRUE, hide their existence from configuration view |
|
|
# if all listed variables are TRUE, hide their existence from configuration view |
|
|
include(FindPackageHandleStandardArgs) |
|
|
include(FindPackageHandleStandardArgs) |
|
|
find_package_handle_standard_args(json_rpc_cpp DEFAULT_MSG |
|
|
|
|
|
JSON_RPC_CPP_COMMON_LIBRARY JSON_RPC_CPP_SERVER_LIBRARY JSON_RPC_CPP_CLIENT_LIBRARY JSON_RPC_CPP_INCLUDE_DIR) |
|
|
find_package_handle_standard_args( |
|
|
mark_as_advanced (JSON_RPC_CPP_COMMON_LIBRARY JSON_RPC_CPP_SERVER_LIBRARY JSON_RPC_CPP_CLIENT_LIBRARY JSON_RPC_CPP_INCLUDE_DIR) |
|
|
json_rpc_cpp |
|
|
|
|
|
REQUIRED_VARS JSON_RPC_CPP_INCLUDE_DIR JSON_RPC_CPP_COMMON_LIBRARY JSON_RPC_CPP_SERVER_LIBRARY JSON_RPC_CPP_CLIENT_LIBRARY |
|
|
|
|
|
VERSION_VAR JSON_RPC_CPP_VERSION |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
mark_as_advanced (JSON_RPC_CPP_INCLUDE_DIR JSON_RPC_CPP_COMMON_LIBRARY JSON_RPC_CPP_SERVER_LIBRARY JSON_RPC_CPP_CLIENT_LIBRARY) |
|
|
|
|
|
|