diff options
author | Hongjun Ni <hongjun.ni@intel.com> | 2019-03-08 07:09:35 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2019-03-08 07:09:35 +0000 |
commit | d7b6abb9e9e7a1e8eed4374f97374b7175126488 (patch) | |
tree | f1295b3ff2f5e2c35dad31fd5b3037153ee4a714 /src/cmake/FindJSONCPP.cmake | |
parent | a0320530463b442448e9ec9b054cc08e9bff082f (diff) | |
parent | 1b1eb0d115f5f3c047dc78862c17d39fb29beba5 (diff) |
Merge "Init gNMI server."
Diffstat (limited to 'src/cmake/FindJSONCPP.cmake')
-rw-r--r-- | src/cmake/FindJSONCPP.cmake | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/cmake/FindJSONCPP.cmake b/src/cmake/FindJSONCPP.cmake new file mode 100644 index 0000000..a342f08 --- /dev/null +++ b/src/cmake/FindJSONCPP.cmake @@ -0,0 +1,56 @@ +# - Try to find LibJSONCPP +# Once done this will define +# +# LIBJSONCPP_FOUND - system has LibJSONCPP +# LIBJSONCPP_INCLUDE_DIRS - the LibJSONCPP include directory +# LIBJSONCPP_LIBRARIES - Link these to use LIBJSONCPP + + +if (LIBJSONCPP_LIBRARIES AND LIBJSONCPP_INCLUDE_DIRS) + # in cache already + set(LIBJSONCPP_FOUND TRUE) +else (LIBJSONCPP_LIBRARIES AND LIBJSONCPP_INCLUDE_DIRS) + + find_path(LIBJSONCPP_INCLUDE_DIR + NAMES + json/json.h + PATHS + /usr/include + /usr/local/include + /usr/include/jsoncpp + /opt/local/include + ${CMAKE_INCLUDE_PATH} + ${CMAKE_INSTALL_PREFIX}/include + ) + + find_library(LIBJSONCPP_LIBRARY + NAMES + jsoncpp + PATHS + /usr/lib + /usr/lib64 + /usr/lib/x86_64-linux-gnu + /usr/local/lib + /usr/local/lib64 + /opt/local/lib + ${CMAKE_LIBRARY_PATH} + ${CMAKE_INSTALL_PREFIX}/lib + ) + + if (LIBJSONCPP_INCLUDE_DIR AND LIBJSONCPP_LIBRARY) + set(LIBJSONCPP_FOUND TRUE) + else (LIBJSONCPP_INCLUDE_DIR AND LIBJSONCPP_LIBRARY) + set(LIBJSONCPP_FOUND FALSE) + endif (LIBJSONCPP_INCLUDE_DIR AND LIBJSONCPP_LIBRARY) + + set(LIBJSONCPP_INCLUDE_DIRS ${LIBJSONCPP_INCLUDE_DIR}) + set(LIBJSONCPP_LIBRARIES ${LIBJSONCPP_LIBRARY}) + + # show the LIBJSONCPP_INCLUDE_DIRS and LIBJSONCPP_LIBRARIES variables only in the advanced view + mark_as_advanced(LIBJSONCPP_INCLUDE_DIRS LIBJSONCPP_LIBRARIES) + +endif (LIBJSONCPP_LIBRARIES AND LIBJSONCPP_INCLUDE_DIRS) + + + + |