Browse Source

provided my own FindJsonRCP.cmake

cl-refactor
sveneh 10 years ago
parent
commit
69c499e01f
  1. 46
      cmake/FindJsonRcpCpp.cmake
  2. 11
      extdep/json-rpc-cpp.cmake

46
cmake/FindJsonRcpCpp.cmake

@ -0,0 +1,46 @@
# Find json-rcp-cpp
#
# Find the JSONCpp includes and library
#
# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH
#
# This module defines
# JSON_RCP_CPP_INCLUDE_DIRS, where to find json.h, etc.
# JSON_RCP_CPP_LIBRARIES, the libraries needed to use jsoncpp.
# JSON_RCP_CPP_FOUND, If false, do not try to use jsoncpp.
if (JSON_RPC_CPP_LIBRARIES AND JSON_RPC_CPP_INCLUDE_DIRS)
# in cache already
set(JSON_RPC_CPP_FOUND TRUE)
endif()
# only look in default directories
find_path(
JSON_RPC_CPP_INCLUDE_DIR
NAMES jsonrpc/rpc.h
PATH_SUFFIXES jsonrpc
DOC "json-rpc-cpp include dir"
)
find_library(
JSON_RPC_CPP_LIBRARY
NAMES jsonrpc
DOC "json-rpc-cpp library"
)
set (JSON_RPC_CPP_INCLUDE_DIRS ${JSON_RPC_CPP_INCLUDE_DIR})
set (JSON_RPC_CPP_LIBRARIES ${JSON_RPC_CPP_LIBRARY})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set JSON_RPC_CPP_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(json-rpc-cpp DEFAULT_MSG
JSON_RPC_CPP_LIBRARY JSON_RPC_CPP_INCLUDE_DIR)
# include(FindPackageMessage)
# find_package_message ("json-rpc-cpp" "found" "bla")
mark_as_advanced (JSON_RPC_CPP_INCLUDE_DIR JSON_RPC_CPP_LIBRARY)

11
extdep/json-rpc-cpp.cmake

@ -1,11 +0,0 @@
ExternalProject_Add(json-rpc-cpp
DEPENDS curl
GIT_REPOSITORY https://github.com/cinemast/libjson-rpc-cpp.git
GIT_TAG eaca2481e2889d5a5b748383fb02b1d395969cd4
BINARY_DIR json-rpc-cpp-prefix/src/json-rpc-cpp
CONFIGURE_COMMAND cmake -DCMAKE_INSTALL_PREFIX=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_MODULE_PATH:PATH=${CMAKE_CURRENT_SOURCE_DIR} -DETH_DEPENDENCY_INSTALL_DIR:PATH=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev .
BUILD_COMMAND make jsonrpc -j 3
INSTALL_COMMAND make install
)
Loading…
Cancel
Save