aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmake
diff options
context:
space:
mode:
authorAndrej Kozemcak <andrej.kozemcak@pantheon.tech>2019-02-21 16:23:03 +0100
committerHongjun Ni <hongjun.ni@intel.com>2019-03-07 00:55:12 +0000
commit1b1eb0d115f5f3c047dc78862c17d39fb29beba5 (patch)
tree9fccaebab80def6f257f2dc6299fa265b858adaa /src/cmake
parent3430b042873f2eac94acd323125eaaa4a5f7f3e9 (diff)
Init gNMI server.
Change-Id: Ie898b5385096e735bf947775e0278c3c8f4797a8 Signed-off-by: Andrej Kozemcak <andrej.kozemcak@pantheon.tech>
Diffstat (limited to 'src/cmake')
-rw-r--r--src/cmake/FindJSONCPP.cmake56
-rw-r--r--src/cmake/FindPUGIXML.cmake52
2 files changed, 108 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)
+
+
+
+
diff --git a/src/cmake/FindPUGIXML.cmake b/src/cmake/FindPUGIXML.cmake
new file mode 100644
index 0000000..dc7c86b
--- /dev/null
+++ b/src/cmake/FindPUGIXML.cmake
@@ -0,0 +1,52 @@
+# - Try to find LibPUGIXML
+# Once done this will define
+#
+# LIBPUGIXML_FOUND - system has LibPUGIXML
+# LIBPUGIXML_INCLUDE_DIRS - the LibPUGIXML include directory
+# LIBPUGIXML_LIBRARIES - Link these to use LIBPUGIXML
+
+if (LIBPUGIXML_LIBRARIES AND LIBPUGIXML_INCLUDE_DIRS)
+ # in cache already
+ set(LIBPUGIXML_FOUND TRUE)
+else (LIBPUGIXML_LIBRARIES AND LIBPUGIXML_INCLUDE_DIRS)
+
+ find_path(LIBPUGIXML_INCLUDE_DIR
+ NAMES
+ pugixml.hpp
+ PATHS
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ ${CMAKE_INCLUDE_PATH}
+ ${CMAKE_INSTALL_PREFIX}/include
+ )
+
+ find_library(LIBPUGIXML_LIBRARY
+ NAMES
+ pugixml
+ PATHS
+ /usr/lib
+ /usr/lib64
+ /usr/local/lib
+ /usr/local/lib64
+ /opt/local/lib
+ ${CMAKE_LIBRARY_PATH}
+ ${CMAKE_INSTALL_PREFIX}/lib
+ )
+
+ if (LIBPUGIXML_INCLUDE_DIR AND LIBPUGIXML_LIBRARY)
+ set(LIBPUGIXML_FOUND TRUE)
+ else (LIBPUGIXML_INCLUDE_DIR AND LIBPUGIXML_LIBRARY)
+ set(LIBPUGIXML_FOUND FALSE)
+ endif (LIBPUGIXML_INCLUDE_DIR AND LIBPUGIXML_LIBRARY)
+
+ set(LIBPUGIXML_INCLUDE_DIRS ${LIBPUGIXML_INCLUDE_DIR})
+ set(LIBPUGIXML_LIBRARIES ${LIBPUGIXML_LIBRARY})
+
+ # show the LIBPUGIXML_INCLUDE_DIRS and LIBPUGIXML_LIBRARIES variables only in the advanced view
+ mark_as_advanced(LIBPUGIXML_INCLUDE_DIRS LIBPUGIXML_LIBRARIES)
+
+endif (LIBPUGIXML_LIBRARIES AND LIBPUGIXML_INCLUDE_DIRS)
+
+
+