diff options
Diffstat (limited to 'cmake')
29 files changed, 0 insertions, 1644 deletions
diff --git a/cmake b/cmake new file mode 160000 +Subproject a7b8a8e60fb4b4d35df628003f1d80438736603 diff --git a/cmake/Modules/BuildMacros.cmake b/cmake/Modules/BuildMacros.cmake deleted file mode 100644 index d360d26af..000000000 --- a/cmake/Modules/BuildMacros.cmake +++ /dev/null @@ -1,235 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -############################## -# Utils for building libraries and executables -# - -include(GNUInstallDirs) - -macro(build_executable exec) - cmake_parse_arguments(ARG - "NO_INSTALL" - "COMPONENT" - "SOURCES;LINK_LIBRARIES;DEPENDS;INCLUDE_DIRS;DEFINITIONS;LINK_FLAGS" - ${ARGN} - ) - - add_executable(${exec}-bin ${ARG_SOURCES}) - - set(BUILD_ROOT ${CMAKE_BINARY_DIR}/build-root) - - set_target_properties(${exec}-bin - PROPERTIES - OUTPUT_NAME ${exec} - INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" - INSTALL_RPATH_USE_LINK_PATH TRUE - ARCHIVE_OUTPUT_DIRECTORY "${BUILD_ROOT}/lib" - LIBRARY_OUTPUT_DIRECTORY "${BUILD_ROOT}/lib" - RUNTIME_OUTPUT_DIRECTORY "${BUILD_ROOT}/bin" - LINK_FLAGS "${ARG_LINK_FLAGS}" - ) - - if(ARG_LINK_LIBRARIES) - target_link_libraries(${exec}-bin ${ARG_LINK_LIBRARIES}) - endif() - - if(ARG_DEPENDS) - add_dependencies(${exec}-bin ${ARG_DEPENDS}) - endif() - - if(ARG_DEFINITIONS) - target_compile_definitions(${exec}-bin PRIVATE ${ARG_DEFINITIONS}) - endif() - - if(ARG_INCLUDE_DIRS) - target_include_directories(${exec}-bin BEFORE PUBLIC - ${ARG_INCLUDE_DIRS} - ${PROJECT_BINARY_DIR} - ) - endif() - - if(NOT ARG_NO_INSTALL) - install( - TARGETS ${exec}-bin - RUNTIME - DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT ${ARG_COMPONENT} - ) - endif() -endmacro() - -macro(build_library lib) - cmake_parse_arguments(ARG - "SHARED;STATIC;NO_DEV" - "COMPONENT;" - "SOURCES;LINK_LIBRARIES;INSTALL_HEADERS;DEPENDS;INCLUDE_DIRS;DEFINITIONS;INSTALL_ROOT_DIR;INSTALL_FULL_PATH_DIR;EMPTY_PREFIX;" - ${ARGN} - ) - - if (ARG_SHARED) - list(APPEND TARGET_LIBS - ${lib}.shared - ) - add_library(${lib}.shared SHARED ${ARG_SOURCES}) - endif() - - if(ARG_STATIC) - list(APPEND TARGET_LIBS - ${lib}.static - ) - add_library(${lib}.static STATIC ${ARG_SOURCES}) - endif() - - if(NOT ARG_COMPONENT) - set(ARG_COMPONENT hicn) - endif() - - set(BUILD_ROOT ${CMAKE_BINARY_DIR}/build-root) - - foreach(library ${TARGET_LIBS}) - - if(HICN_VERSION) - set_target_properties(${library} - PROPERTIES - SOVERSION ${HICN_VERSION} - ) - endif() - - if (${ARG_EMPTY_PREFIX}) - set_target_properties(${library} - PROPERTIES - INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" - INSTALL_RPATH_USE_LINK_PATH TRUE - PREFIX "" - ARCHIVE_OUTPUT_DIRECTORY "${BUILD_ROOT}/lib" - LIBRARY_OUTPUT_DIRECTORY "${BUILD_ROOT}/lib" - RUNTIME_OUTPUT_DIRECTORY "${BUILD_ROOT}/bin" - ) - else () - set_target_properties(${library} - PROPERTIES - INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" - INSTALL_RPATH_USE_LINK_PATH TRUE - ARCHIVE_OUTPUT_DIRECTORY "${BUILD_ROOT}/lib" - LIBRARY_OUTPUT_DIRECTORY "${BUILD_ROOT}/lib" - RUNTIME_OUTPUT_DIRECTORY "${BUILD_ROOT}/bin" - ) - endif() - - if (WIN32) - target_compile_options(${library} PRIVATE) - set_target_properties(${library} - PROPERTIES - WINDOWS_EXPORT_ALL_SYMBOLS TRUE - ) - else () - target_compile_options(${library} PRIVATE -Wall) - set_target_properties(${library} - PROPERTIES - OUTPUT_NAME ${lib} - ) - endif () - - # library deps - if(ARG_LINK_LIBRARIES) - target_link_libraries(${library} ${ARG_LINK_LIBRARIES}) - endif() - - if(ARG_DEFINITIONS) - target_compile_definitions(${library} PRIVATE ${ARG_DEFINITIONS}) - endif() - - if(ARG_INCLUDE_DIRS) - target_include_directories(${library} BEFORE PUBLIC - ${ARG_INCLUDE_DIRS} - ${PROJECT_BINARY_DIR} - ) - endif() - - set(INSTALL_LIB_PATH ${CMAKE_INSTALL_LIBDIR}) - - if (ARG_INSTALL_FULL_PATH_DIR) - set(INSTALL_LIB_PATH ${ARG_INSTALL_FULL_PATH_DIR}) - endif() - - install( - TARGETS ${library} - COMPONENT ${ARG_COMPONENT} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${INSTALL_LIB_PATH} - ) - - if(ARG_DEPENDS) - add_dependencies(${library} ${ARG_DEPENDS}) - endif() - endforeach() - - # install headers - if(ARG_INSTALL_HEADERS) - if (NOT ARG_INSTALL_ROOT_DIR) - set(ARG_INSTALL_ROOT_DIR "hicn") - endif() - - list(APPEND local_comps - ${ARG_COMPONENT}-dev - ) - - foreach(file ${ARG_INSTALL_HEADERS}) - get_filename_component(_dir ${file} DIRECTORY) - - if (_dir) - get_filename_component(dir ${_dir} NAME) - if ("${dir}" STREQUAL src) - set(dir "") - endif() - if ("${dir}" STREQUAL includes) - set(dir "") - endif() - if ("${dir}" STREQUAL ${ARG_INSTALL_ROOT_DIR}) - set(dir "") - endif() - else() - set(dir "") - endif() - - set(COMPONENT ${ARG_COMPONENT}) - if (NOT ARG_NO_DEV) - set(COMPONENT ${COMPONENT}-dev) - endif() - install( - FILES ${file} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${ARG_INSTALL_ROOT_DIR}/${dir} - COMPONENT ${COMPONENT} - ) - endforeach() - endif() -endmacro() - -add_custom_target(${PROJECT_NAME}_cleanup_profiling_data - "find" "." "-name" "*.gcda" "-delete" - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Cleanup previous profiling data." -) - -macro(AddTest testFile) - add_executable(${ARGV0} ${ARGV0}.cc) - target_link_libraries(${ARGV0} ${TARGET_TRANSPORT_STATIC} ${GTEST_LIBRARIES}) - add_test(${ARGV0} ${ARGV0}) - set_target_properties(${ARGV0} PROPERTIES FOLDER Test) - add_dependencies(${ARGV0} ${PROJECT_NAME}_cleanup_profiling_data) -endmacro(AddTest) - -include(IosMacros) -include(WindowsMacros) diff --git a/cmake/Modules/FindAsio.cmake b/cmake/Modules/FindAsio.cmake deleted file mode 100644 index 73888e519..000000000 --- a/cmake/Modules/FindAsio.cmake +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -######################################## -# -# Find the hcin libraries and includes -# This module sets: -# ASIO_FOUND: True if asio was found -# ASIO_INCLUDE_DIR: The asio include dir -# - -set(ASIO_SEARCH_PATH_LIST - ${ASIO_HOME} - $ENV{ASIO_HOME} - /usr/local - /opt - /usr -) - -find_path(ASIO_INCLUDE_DIR asio.hpp - HINTS ${ASIO_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the asio includes" -) - -set(ASIO_INCLUDE_DIRS ${ASIO_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Asio - REQUIRED_VARS ASIO_INCLUDE_DIRS -)
\ No newline at end of file diff --git a/cmake/Modules/FindCURL.cmake b/cmake/Modules/FindCURL.cmake deleted file mode 100644 index 239b0e505..000000000 --- a/cmake/Modules/FindCURL.cmake +++ /dev/null @@ -1,69 +0,0 @@ -#.rst: -# FindCURL -# -------- -# -# Find curl -# -# Find the native CURL headers and libraries. -# -# :: -# -# CURL_INCLUDE_DIRS - where to find curl_/curl_.h, etc. -# CURL_LIBRARIES - List of libraries when using curl. -# CURL_FOUND - True if curl found. -# CURL_VERSION_STRING - the version of curl found (since CMake 2.8.8) - -#============================================================================= -# Copyright 2006-2009 Kitware, Inc. -# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de> -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -# Look for the header file. -find_path(CURL_INCLUDE_DIR NAMES curl/curl.h) -mark_as_advanced(CURL_INCLUDE_DIR) - -# Look for the library (sorted from most current/relevant entry to least). -find_library(CURL_LIBRARY NAMES - curl - # Windows MSVC prebuilts: - curllib - libcurl_imp - curllib_static - # Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip): - libcurl - ) -mark_as_advanced(CURL_LIBRARY) - -if(CURL_INCLUDE_DIR) - foreach(_curl_version_header curlver.h curl.h) - if(EXISTS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}") - file(STRINGS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"") - - string(REGEX REPLACE "^#define[\t ]+LIBCURL_VERSION[\t ]+\"([^\"]*)\".*" "\\1" CURL_VERSION_STRING "${curl_version_str}") - unset(curl_version_str) - break() - endif() - endforeach() -endif() - -# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL - REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR - VERSION_VAR CURL_VERSION_STRING) - -if(CURL_FOUND) - set(CURL_LIBRARIES ${CURL_LIBRARY}) - set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) -endif() diff --git a/cmake/Modules/FindCollectd.cmake b/cmake/Modules/FindCollectd.cmake deleted file mode 100644 index 76d2df43f..000000000 --- a/cmake/Modules/FindCollectd.cmake +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set(COLLECTD_SEARCH_PATH_LIST - ${COLLECTD_HOME} - $ENV{COLLECTD_HOME} - /usr/local - /opt - /usr - ) - -find_path(COLLECTD_INCLUDE_DIR collectd.h - HINTS ${COLLECTD_SEARCH_PATH_LIST} - PATH_SUFFIXES include/collectd/core/daemon/ daemon/ - DOC "Find the collectd includes" -) - -find_path(COLLECTD_COMMON_INCLUDE_DIR common.h - HINTS ${COLLECTD_SEARCH_PATH_LIST} - PATH_SUFFIXES include/collectd/core/daemon/ utils/common/ - DOC "Find the collectd includes" -) - -find_path(COLLECTD_CONFIG_INCLUDE_DIR config.h - HINTS ${COLLECTD_SEARCH_PATH_LIST} - PATH_SUFFIXES include/collectd/core/ - DOC "Find the collectd includes" -) - -message(STATUS ${COLLECTD_INCLUDE_DIR} ${COLLECTD_COMMON_INCLUDE_DIR} ${COLLECTD_CONFIG_INCLUDE_DIR}) - -set(COLLECTD_INCLUDE_DIRS ${COLLECTD_INCLUDE_DIR} ${COLLECTD_COMMON_INCLUDE_DIR} ${COLLECTD_CONFIG_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Collectd DEFAULT_MSG COLLECTD_INCLUDE_DIRS) - -mark_as_advanced(COLLECTD_INCLUDE_DIRS) diff --git a/cmake/Modules/FindConfig.cmake b/cmake/Modules/FindConfig.cmake deleted file mode 100644 index 11e764d21..000000000 --- a/cmake/Modules/FindConfig.cmake +++ /dev/null @@ -1,56 +0,0 @@ -set(LIBCONFIG_SEARCH_PATH_LIST - ${LIBCONFIG_HOME} - $ENV{LIBCONFIG_HOME} - /usr/local - /opt - /usr -) - -find_path(CONFIG_INCLUDE_DIR libconfig.h - HINTS ${LIBCONFIG_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the libconfig include" -) - -if (WIN32) - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - find_library(CONFIG_LIBRARY NAMES libconfig.lib - HINTS ${LIBCONFIG_SEARCH_PATH_LIST} - PATH_SUFFIXES lib/x64 - DOC "Find the libconfig libraries" - ) - elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) - find_library(CONFIG_LIBRARY NAMES libconfig.lib - HINTS ${LIBCONFIG_SEARCH_PATH_LIST} - PATH_SUFFIXES lib/x32 - DOC "Find the libconfig libraries" - ) - endif() -else() - find_library(CONFIG_LIBRARY NAMES config - HINTS ${LIBCONFIG_SEARCH_PATH_LIST} - PATH_SUFFIXES lib - DOC "Find the libconfig libraries" - ) -endif() - - -IF (CONFIG_INCLUDE_DIR AND CONFIG_LIBRARY) - SET(CONFIG_FOUND TRUE) -ENDIF ( CONFIG_INCLUDE_DIR AND CONFIG_LIBRARY) - -IF (CONFIG_FOUND) - IF (NOT CONFIG_FIND_QUIETLY) - MESSAGE(STATUS "Found Config: ${CONFIG_LIBRARY}") - ENDIF (NOT CONFIG_FIND_QUIETLY) -ELSE(CONFIG_FOUND) - IF (Config_FIND_REQUIRED) - IF(NOT CONFIG_INCLUDE_DIR) - MESSAGE(FATAL_ERROR "Could not find LibConfig header file!") - ENDIF(NOT CONFIG_INCLUDE_DIR) - - IF(NOT CONFIG_LIBRARY) - MESSAGE(FATAL_ERROR "Could not find LibConfig library file!") - ENDIF(NOT CONFIG_LIBRARY) - ENDIF (Config_FIND_REQUIRED) -ENDIF (CONFIG_FOUND)
\ No newline at end of file diff --git a/cmake/Modules/FindGFlags.cmake b/cmake/Modules/FindGFlags.cmake deleted file mode 100644 index 804bfebdc..000000000 --- a/cmake/Modules/FindGFlags.cmake +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# Find libgflags -# -# LIBGFLAGS_INCLUDE_DIR - where to find gflags/gflags.h, etc. -# LIBGFLAGS_LIBRARY - List of libraries when using libgflags. -# LIBGFLAGS_FOUND - True if libgflags found. - - -IF (LIBGFLAGS_INCLUDE_DIR) - # Already in cache, be silent - SET(LIBGFLAGS_FIND_QUIETLY TRUE) -ENDIF () - -FIND_PATH(LIBGFLAGS_INCLUDE_DIR gflags/gflags.h) - -FIND_LIBRARY(LIBGFLAGS_LIBRARY NAMES gflags gflags_static) - -# handle the QUIETLY and REQUIRED arguments and set LIBGFLAGS_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGFLAGS DEFAULT_MSG LIBGFLAGS_LIBRARY LIBGFLAGS_INCLUDE_DIR) - -MARK_AS_ADVANCED(LIBGFLAGS_LIBRARY LIBGFLAGS_INCLUDE_DIR)
\ No newline at end of file diff --git a/cmake/Modules/FindGlog.cmake b/cmake/Modules/FindGlog.cmake deleted file mode 100644 index 10023a187..000000000 --- a/cmake/Modules/FindGlog.cmake +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# Find libglog -# -# LIBGLOG_INCLUDE_DIR - where to find glog/logging.h, etc. -# LIBGLOG_LIBRARY - List of libraries when using libglog. -# LIBGLOG_FOUND - True if libglog found. - - -IF (LIBGLOG_INCLUDE_DIR) - # Already in cache, be silent - SET(LIBGLOG_FIND_QUIETLY TRUE) -ENDIF () - -FIND_PATH(LIBGLOG_INCLUDE_DIR glog/logging.h) - -FIND_LIBRARY(LIBGLOG_LIBRARY glog) - -# handle the QUIETLY and REQUIRED arguments and set LIBGLOG_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGLOG DEFAULT_MSG LIBGLOG_LIBRARY LIBGLOG_INCLUDE_DIR) - -MARK_AS_ADVANCED(LIBGLOG_LIBRARY LIBGLOG_INCLUDE_DIR)
\ No newline at end of file diff --git a/cmake/Modules/FindHicnLight.cmake b/cmake/Modules/FindHicnLight.cmake deleted file mode 100644 index 6894415e7..000000000 --- a/cmake/Modules/FindHicnLight.cmake +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set(HICNLIGHT_SEARCH_PATH_LIST - ${HICNLIGHT_HOME} - $ENV{HICNLIGHT_HOME} - /usr/local - /opt - /usr -) - -find_path(HICNLIGHT_INCLUDE_DIR hicn/ctrl/api.h - HINTS ${HICNLIGHT_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the hicn plugin includes" -) - -find_library(HICNLIGHT_LIBRARY NAMES libhicnctrl.so - HINTS ${HICNLIGHT_SEARCH_PATH_LIST} - PATH_SUFFIXES lib/x86_64-linux-gnu/ - DOC "Find the hicn light lib" -) - -set(HICNLIGHT_LIBRARIES ${HICNLIGHT_LIBRARY}) -set(HICNLIGHT_INCLUDE_DIRS ${HICNLIGHT_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Hicnlight HICNLIGHT_LIBRARIES HICNLIGHT_INCLUDE_DIRS) - -mark_as_advanced(HICNLIGHT_LIBRARY HICNLIGHT_INCLUDE_DIR) diff --git a/cmake/Modules/FindHicnPlugin.cmake b/cmake/Modules/FindHicnPlugin.cmake deleted file mode 100644 index 07e5f9a8c..000000000 --- a/cmake/Modules/FindHicnPlugin.cmake +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set(HICNPLUGIN_SEARCH_PATH_LIST - ${VPP_SEARCH_PATH_LIST} - ${HICNPLUGIN_HOME} - $ENV{HICNPLUGIN_HOME} - /usr/local - /opt - /usr -) - -find_path(HICNPLUGIN_INCLUDE_DIR vapi/hicn.api.vapi.h - HINTS ${HICNPLUGIN_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the hicn plugin includes" -) - - -set(HICNPLUGIN_INCLUDE_DIRS ${HICNPLUGIN_INCLUDE_DIR} ${HICNPLUGIN_INCLUDE_DIR}/vpp_plugins) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(HicnPlugin DEFAULT_MSG HICNPLUGIN_INCLUDE_DIR) - -mark_as_advanced(HICNPLUGIN_INCLUDE_DIR)
\ No newline at end of file diff --git a/cmake/Modules/FindJsoncpp.cmake b/cmake/Modules/FindJsoncpp.cmake deleted file mode 100644 index acde7b95b..000000000 --- a/cmake/Modules/FindJsoncpp.cmake +++ /dev/null @@ -1,47 +0,0 @@ -# Find jsoncpp -# -# Find the jsoncpp includes and library -# -# if you nee to add a custom library search path, do it via via CMAKE_PREFIX_PATH -# -# This module defines -# JSONCPP_INCLUDE_DIRS, where to find header, etc. -# JSONCPP_LIBRARIES, the libraries needed to use jsoncpp. -# JSONCPP_FOUND, If false, do not try to use jsoncpp. -# JSONCPP_INCLUDE_PREFIX, include prefix for jsoncpp - -# only look in default directories -find_path( - JSONCPP_INCLUDE_DIR - NAMES jsoncpp/json/json.h json/json.h - DOC "jsoncpp include dir" -) - -find_library( - JSONCPP_LIBRARY - NAMES jsoncpp - DOC "jsoncpp library" -) - -set(JSONCPP_INCLUDE_DIRS ${JSONCPP_INCLUDE_DIR}) -set(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY}) - -# find JSONCPP_INCLUDE_PREFIX -find_path( - JSONCPP_INCLUDE_PREFIX - NAMES json.h - PATH_SUFFIXES jsoncpp/json json -) - -if (${JSONCPP_INCLUDE_PREFIX} MATCHES "jsoncpp") - set(JSONCPP_INCLUDE_PREFIX "jsoncpp/json") -else() - set(JSONCPP_INCLUDE_PREFIX "json") -endif() - -# handle the QUIETLY and REQUIRED arguments and set JSONCPP_FOUND to TRUE -# if all listed variables are TRUE, hide their existence from configuration view -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(jsoncpp DEFAULT_MSG - JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY) -mark_as_advanced (JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY)
\ No newline at end of file diff --git a/cmake/Modules/FindLibEvent.cmake b/cmake/Modules/FindLibEvent.cmake deleted file mode 100644 index 5e4113716..000000000 --- a/cmake/Modules/FindLibEvent.cmake +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -######################################## -# -# Find the LibEvent libraries and includes -# This module sets: -# LIBEVENT_FOUND: True if LibEvent was found -# LIBEVENT_LIBRARY: The LibEvent library -# LIBEVENT_LIBRARIES: The LibEvent library and dependencies -# LIBEVENT_INCLUDE_DIR: The LibEvent include dir -# -# This module will look for the libraries in various locations -# See the LIBEVENT_SEARCH_PATH_LIST for a full list. -# -# The caller can hint at locations using the following variables: -# -# LIBEVENT_HOME (passed as -D to cmake) -# LIBEVENT_HOME (in environment) -# - -set(LIBEVENT_SEARCH_PATH_LIST - ${LIBEVENT_HOME} - $ENV{DEPENDENCIES} - $ENV{LIBEVENT_HOME} - /usr/local - /opt - /usr - ) - -find_path(LIBEVENT_INCLUDE_DIR event2/event.h - HINTS ${LIBEVENT_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the LibEvent includes" ) - -find_library(LIBEVENT_LIBRARY NAMES event - HINTS ${LIBEVENT_SEARCH_PATH_LIST} - PATH_SUFFIXES lib - DOC "Find the LibEvent libraries" ) - -set(LIBEVENT_LIBRARIES ${LIBEVENT_LIBRARY}) -set(LIBEVENT_INCLUDE_DIRS ${LIBEVENT_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LibEvent DEFAULT_MSG LIBEVENT_LIBRARY LIBEVENT_INCLUDE_DIR) diff --git a/cmake/Modules/FindLibhicn.cmake b/cmake/Modules/FindLibhicn.cmake deleted file mode 100644 index 38775be6a..000000000 --- a/cmake/Modules/FindLibhicn.cmake +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -######################################## -# -# Find the hcin libraries and includes -# This module sets: -# HICN_FOUND: True if hicn was found -# HICN_LIBRARY: The hicn library -# HICN_LIBRARIES: The hicn library and dependencies -# HCIN_INCLUDE_DIR: The hicn include dir -# - -set(HICN_SEARCH_PATH_LIST - ${HICN_HOME} - $ENV{HICN_HOME} - $ENV{FOUNDATION_HOME} - /usr/local - /opt - /usr -) - -find_path(HICN_INCLUDE_DIR hicn/hicn.h - HINTS ${HICN_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the hicn includes" -) - -find_library(HICN_LIBRARY NAMES hicn - HINTS ${HICN_SEARCH_PATH_LIST} - PATH_SUFFIXES lib - DOC "Find the hicn libraries" -) - -set(HICN_LIBRARIES ${HICN_LIBRARY}) -if (${CMAKE_SYSTEM_NAME} STREQUAL "Android") -set(HICN_LIBRARIES ${HICN_LIBRARIES} log) -endif() -set(HICN_INCLUDE_DIRS ${HICN_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(hicn DEFAULT_MSG HICN_LIBRARY HICN_INCLUDE_DIR) diff --git a/cmake/Modules/FindLibhicnctrl.cmake b/cmake/Modules/FindLibhicnctrl.cmake deleted file mode 100755 index 7c20420b4..000000000 --- a/cmake/Modules/FindLibhicnctrl.cmake +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -######################################## -# -# Find the hICN control library and include files -# - -set(HICN_SEARCH_PATH_LIST - ${HICN_HOME} - $ENV{HICN_HOME} - $ENV{FOUNDATION_HOME} - /usr/local - /opt - /usr -) - -find_path(LIBHICNCTRL_INCLUDE_DIR hicn/ctrl.h - HINTS ${HICN_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the hICN control include" -) - -find_library(LIBHICNCTRL_LIBRARY NAMES hicnctrl - HINTS ${HICN_SEARCH_PATH_LIST} - PATH_SUFFIXES lib - DOC "Find the hicn control library" -) - -set(LIBHICNCTRL_LIBRARIES ${LIBHICNCTRL_LIBRARY}) -set(LIBHICNCTRL_INCLUDE_DIRS ${LIBHICNCTRL_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(hicnctrl DEFAULT_MSG - LIBHICNCTRL_LIBRARY LIBHICNCTRL_INCLUDE_DIR) diff --git a/cmake/Modules/FindLibmemif.cmake b/cmake/Modules/FindLibmemif.cmake deleted file mode 100644 index 48460eecd..000000000 --- a/cmake/Modules/FindLibmemif.cmake +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -######################################## -# -# Find the hcin libraries and includes -# This module sets: -# LIBMEMIF_FOUND: True if core was found -# LIBMEMIF_LIBRARY: The core library -# LIBMEMIF_INCLUDE_DIR: The core include dir -# - -set(LIBMEMIF_SEARCH_PATH_LIST - ${LIBMEMIF_HOME} - $ENV{LIBMEMIF_HOME} - /usr/local - /opt - /usr -) - -find_path(LIBMEMIF_INCLUDE_DIR memif/libmemif.h - HINTS ${LIBMEMIF_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the libmemif includes" -) - -find_library(LIBMEMIF_LIBRARY NAMES memif - HINTS ${LIBMEMIF_SEARCH_PATH_LIST} - PATH_SUFFIXES lib - DOC "Find the libmemif libraries" -) - -set(LIBMEMIF_LIBRARIES ${LIBMEMIF_LIBRARY}) -set(LIBMEMIF_INCLUDE_DIRS ${LIBMEMIF_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Libmemif DEFAULT_MSG LIBMEMIF_LIBRARY LIBMEMIF_INCLUDE_DIR) diff --git a/cmake/Modules/FindLibparc.cmake b/cmake/Modules/FindLibparc.cmake deleted file mode 100644 index c5c99af15..000000000 --- a/cmake/Modules/FindLibparc.cmake +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -######################################## -# -# Find the Libparc libraries and includes -# This module sets: -# LIBPARC_FOUND: True if Libparc was found -# LIBPARC_LIBRARY: The Libparc library -# LIBPARC_LIBRARIES: The Libparc library and dependencies -# LIBPARC_INCLUDE_DIR: The Libparc include dir -# - -set(LIBPARC_SEARCH_PATH_LIST - ${LIBPARC_HOME} - $ENV{LIBPARC_HOME} - /usr/local - /opt - /usr -) - -find_path(LIBPARC_INCLUDE_DIR parc/libparc_About.h - HINTS ${LIBPARC_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the Libparc includes" -) - -find_library(LIBPARC_LIBRARY NAMES parc - HINTS ${LIBPARC_SEARCH_PATH_LIST} - PATH_SUFFIXES lib - DOC "Find the Libparc libraries" -) - -set(LIBPARC_LIBRARIES ${LIBPARC_LIBRARY}) -set(LIBPARC_INCLUDE_DIRS ${LIBPARC_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Libparc DEFAULT_MSG LIBPARC_LIBRARY LIBPARC_INCLUDE_DIR) - -mark_as_advanced(LIBPARC_LIBRARY LIBPARC_INCLUDE_DIR) diff --git a/cmake/Modules/FindLibtransport.cmake b/cmake/Modules/FindLibtransport.cmake deleted file mode 100644 index 8a650b98c..000000000 --- a/cmake/Modules/FindLibtransport.cmake +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -######################################## -# -# Find the LibTRANSPORT libraries and includes -# This module sets: -# LIBTRANSPORT_FOUND: True if Libconsumer-producer was found -# LIBTRANSPORTR_LIBRARY: The Libconsumer-producer library -# LIBTRANSPORT_LIBRARIES: The Libconsumer-producer library and dependencies -# LIBTRANSPORT_INCLUDE_DIR: The Libconsumer-producer include dir -# - -set(LIBTRANSPORT_SEARCH_PATH_LIST - ${LIBTRANSPORT_HOME} - $ENV{LIBTRANSPORTHOME} - /usr/local - /opt - /usr -) - -find_path(LIBTRANSPORT_INCLUDE_DIR hicn/transport/config.h - HINTS ${LIBTRANSPORT_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the libtransport includes" -) - -find_library(LIBTRANSPORT_LIBRARY - NAMES hicntransport hicntransport-memif - HINTS ${LIBTRANSPORT_SEARCH_PATH_LIST} - PATH_SUFFIXES lib - DOC "Find the libtransport libraries" -) - -set(LIBTRANSPORT_LIBRARIES ${LIBTRANSPORT_LIBRARY}) -set(LIBTRANSPORT_INCLUDE_DIRS ${LIBTRANSPORT_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Libtransport DEFAULT_MSG LIBTRANSPORT_LIBRARIES LIBTRANSPORT_INCLUDE_DIRS)
\ No newline at end of file diff --git a/cmake/Modules/FindLongBow.cmake b/cmake/Modules/FindLongBow.cmake deleted file mode 100644 index 4a05d7fdf..000000000 --- a/cmake/Modules/FindLongBow.cmake +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -######################################## -# -# Find the LongBow libraries and includes -# This module sets: -# LONGBOW_FOUND: True if LongBow was found -# LONGBOW_LIBRARY: The LongBow library -# LONGBOW_LIBRARIES: The LongBow library and dependencies -# LONGBOW_INCLUDE_DIR: The LongBow include dir -# - -set(LONGBOW_SEARCH_PATH_LIST - ${LONGBOW_HOME} - $ENV{LONGBOW_HOME} - $ENV{PARC_HOME} - $ENV{FOUNDATION_HOME} - /usr/local/parc - /usr/local/ccn - /usr/local - /opt - /usr - ) - -find_path(LONGBOW_INCLUDE_DIR LongBow/longBow_About.h - HINTS ${LONGBOW_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the LongBow includes" ) - -find_library(LONGBOW_LIBRARY NAMES longbow - HINTS ${LONGBOW_SEARCH_PATH_LIST} - PATH_SUFFIXES lib - DOC "Find the LongBow libraries" ) - -find_library(LONGBOW_REPORT_LIBRARY NAMES longbow-textplain longbow-ansiterm - HINTS ${LONGBOW_SEARCH_PATH_LIST} - PATH_SUFFIXES lib - DOC "Find the LongBow report libraries" ) - -set(LONGBOW_LIBRARIES ${LONGBOW_LIBRARY} ${LONGBOW_REPORT_LIBRARY}) -set(LONGBOW_INCLUDE_DIRS ${LONGBOW_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LongBow DEFAULT_MSG LONGBOW_LIBRARY LONGBOW_INCLUDE_DIR) diff --git a/cmake/Modules/FindPThread.cmake b/cmake/Modules/FindPThread.cmake deleted file mode 100644 index 6f0eeb7c0..000000000 --- a/cmake/Modules/FindPThread.cmake +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) 2019 Cisco and/or its affiliates.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-########################################
-#
-# Find the PThread libraries and includes
-# This module sets:
-# PTHREAD_FOUND: True if pthread was found
-# PTHREADR_LIBRARY: The pthread library
-# PTHREAD_LIBRARIES: The pthread library and dependencies
-# PTHREAD_INCLUDE_DIR: The pthread include dir
-#
-
-
-set(PTHREAD_SEARCH_PATH_LIST
- ${PTHREAD_HOME}
- $ENV{PTHREAD_HOME}
- /usr/local
- /opt
- /usr
-)
-
-find_path(PTHREAD_INCLUDE_DIR pthread.h
- HINTS ${PTHREAD_SEARCH_PATH_LIST}
- PATH_SUFFIXES include
- DOC "Find the pthreadincludes"
-)
-
-if(CMAKE_SIZEOF_VOID_P EQUAL 8)
- find_library(PTHREAD_LIBRARY NAMES pthreadVC2.lib
- HINTS ${PTHREAD_SEARCH_PATH_LIST}
- PATH_SUFFIXES lib/x64
- DOC "Find the pthread libraries"
- )
-elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
- find_library(PTHREAD_LIBRARY NAMES pthreadVC2.lib
- HINTS ${PTHREAD_SEARCH_PATH_LIST}
- PATH_SUFFIXES lib/x32
- DOC "Find the pthread libraries"
- )
-endif()
-
-
-set(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY})
-set(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR})
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Pthread DEFAULT_MSG PTHREAD_LIBRARIES PTHREAD_INCLUDE_DIRS)
\ No newline at end of file diff --git a/cmake/Modules/FindSafeVapi.cmake b/cmake/Modules/FindSafeVapi.cmake deleted file mode 100644 index a9077ae14..000000000 --- a/cmake/Modules/FindSafeVapi.cmake +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set(SAFE_VAPI_SEARCH_PATH_LIST - ${SAFE_VAPI_HOME} - $ENV{SAFE_VAPI_HOME} - /usr/local - /opt - /usr -) - -find_path(SAFE_VAPI_INCLUDE_DIR vapi/vapi_safe.h - HINTS ${SAFE_VAPI_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the vapi_safe includes" -) - -find_library(SAFE_VAPI_LIBRARY NAMES libsafe_vapi.so - HINTS ${SAFE_VAPI_SEARCH_PATH_LIST} - PATH_SUFFIXES lib/x86_64-linux-gnu/ - DOC "Find the vapi safe lib" -) - -set(SAFE_VAPI_LIBRARIES ${SAFE_VAPI_LIBRARY}) -set(SAFE_VAPI_INCLUDE_DIRS ${SAFE_VAPI_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Hicnlight SAFE_VAPI_LIBRARIES SAFE_VAPI_INCLUDE_DIRS) - -mark_as_advanced(SAFE_VAPI_LIBRARY SAFE_VAPI_INCLUDE_DIR) diff --git a/cmake/Modules/FindSysrepo.cmake b/cmake/Modules/FindSysrepo.cmake deleted file mode 100644 index 1c389e480..000000000 --- a/cmake/Modules/FindSysrepo.cmake +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set(SYSREPO_SEARCH_PATH_LIST - ${SYSREPO_HOME} - $ENV{SYSREPO_HOME} - /usr/local - /opt - /usr -) - -find_path(SYSREPO_INCLUDE_DIR sysrepo/values.h - HINTS ${SYSREPO_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the sysrepo includes" -) - -find_path(SYSREPO_INCLUDE_MAIN_DIR sysrepo.h - HINTS ${SYSREPO_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the sysrepo includes" -) - -find_library(SYSREPO_LIBRARY NAMES libsysrepo.so - HINTS ${SYSREPO_SEARCH_PATH_LIST} - PATH_SUFFIXES lib - DOC "Find the sysrepo library" -) - -set(SYSREPO_LIBRARIES ${SYSREPO_LIBRARY}) -set(SYSREPO_INCLUDE_DIRS ${SYSREPO_INCLUDE_DIR} ${SYSREPO_INCLUDE_MAIN_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Sysrepo DEFAULT_MSG SYSREPO_LIBRARIES SYSREPO_INCLUDE_DIRS) - -mark_as_advanced(SYSREPO_LIBRARY SYSREPO_INCLUDE_DIR SYSREPO_INCLUDE_MAIN_DIR) diff --git a/cmake/Modules/FindUncrustify.cmake b/cmake/Modules/FindUncrustify.cmake deleted file mode 100644 index f8f6b00b8..000000000 --- a/cmake/Modules/FindUncrustify.cmake +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Find uncrustify program -# -find_program( UNCRUSTIFY_BIN uncrustify - PATHS - $ENV{UNCRUSTIFY_HOME} - ) - -message( "-- UNCRUSTIFY found in ${UNCRUSTIFY_BIN}" ) diff --git a/cmake/Modules/FindVapiSafe.cmake b/cmake/Modules/FindVapiSafe.cmake deleted file mode 100644 index c2c9fd762..000000000 --- a/cmake/Modules/FindVapiSafe.cmake +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set(SAFE_VAPI_SEARCH_PATH_LIST - ${SAFE_VAPI_HOME} - $ENV{SAFE_VAPI_HOME} - /usr/local - /opt - /usr -) - -find_path(SAFE_VAPI_INCLUDE_DIR vapi/vapi_safe.h - HINTS ${SAFE_VAPI_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the vapi_safe includes" -) - -find_library(SAFE_VAPI_LIBRARY NAMES libsafe_vapi.so - HINTS ${SAFE_VAPI_SEARCH_PATH_LIST} - PATH_SUFFIXES lib/x86_64-linux-gnu/ - DOC "Find the vapi safe lib" -) - -set(SAFE_VAPI_LIBRARIES ${SAFE_VAPI_LIBRARY}) -set(SAFE_VAPI_INCLUDE_DIRS ${SAFE_VAPI_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(VapiSafe DEFAULT_MSG SAFE_VAPI_LIBRARIES SAFE_VAPI_INCLUDE_DIRS) - -mark_as_advanced(SAFE_VAPI_LIBRARY SAFE_VAPI_INCLUDE_DIR) diff --git a/cmake/Modules/FindVpp.cmake b/cmake/Modules/FindVpp.cmake deleted file mode 100644 index 4f8dba17a..000000000 --- a/cmake/Modules/FindVpp.cmake +++ /dev/null @@ -1,95 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set(VPP_SEARCH_PATH_LIST - ${VPP_HOME} - $ENV{VPP_HOME} - /usr/local - /opt - /usr -) - -find_path(VPP_INCLUDE_DIR vnet/vnet.h - HINTS ${VPP_SEARCH_PATH_LIST} - PATH_SUFFIXES include - DOC "Find the VPP includes" -) - -find_library(VPP_LIBRARY_MEMORYCLIENT - NAMES vlibmemoryclient - HINTS ${VPP_SEARCH_PATH_LIST} - PATH_SUFFIXES lib lib64 - DOC "Find the Vpp Memoryclient library" -) - -find_library(VPP_LIBRARY_SVM - NAMES svm - HINTS ${VPP_SEARCH_PATH_LIST} - PATH_SUFFIXES lib lib64 - DOC "Find the Vpp svm library" -) - -find_library(VPP_LIBRARY_INFRA - NAMES vppinfra - HINTS ${VPP_SEARCH_PATH_LIST} - PATH_SUFFIXES lib lib64 - DOC "Find the Vpp infra library" -) - -find_library(VPP_LIBRARY_VNET - NAMES vnet - HINTS ${VPP_SEARCH_PATH_LIST} - PATH_SUFFIXES lib lib64 - DOC "Find the Vpp vnet library" -) - -find_library(VPP_LIBRARY_VATPLUGIN - NAMES vatplugin - HINTS ${VPP_SEARCH_PATH_LIST} - PATH_SUFFIXES lib lib64 - DOC "Find the Vpp vatplugin library" -) - -find_library(VPP_LIBRARY_VLIB - NAMES vlib - HINTS ${VPP_SEARCH_PATH_LIST} - PATH_SUFFIXES lib lib64 - DOC "Find the Vpp vlib library" -) - -find_library(VPP_LIBRARY_VPPAPICLIENT - NAMES vppapiclient - HINTS ${VPP_SEARCH_PATH_LIST} - PATH_SUFFIXES lib lib64 - DOC "Find the Vpp api library" -) - -find_library(VPP_LIBRARY_VAPICLIENT - NAMES vapiclient - HINTS ${VPP_SEARCH_PATH_LIST} - PATH_SUFFIXES lib lib64 - DOC "Find the Vpp vapi library" -) - -find_library(VPP_LIBRARY_VLIBMEMORY - NAMES vlibmemory - HINTS ${VPP_SEARCH_PATH_LIST} - PATH_SUFFIXES lib lib64 - DOC "Find the Vpp vlibmemory library" -) - -set(VPP_LIBRARIES ${VPP_LIBRARY_MEMORYCLIENT} ${VPP_LIBRARY_SVM} ${VPP_LIBRARY_INFRA} ${VPP_LIBRARY_VATPLUGIN} ${VPP_LIBRARY_VLIB} ${VPP_LIBRARY_VNET} ${VPP_LIBRARY_VAPICLIENT} ${VPP_LIBRARY_VLIBMEMORY}) -set(VPP_INCLUDE_DIRS ${VPP_INCLUDE_DIR} ${VPP_INCLUDE_DIR}/vpp_plugins) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Vpp DEFAULT_MSG VPP_LIBRARIES VPP_INCLUDE_DIRS) diff --git a/cmake/Modules/IosMacros.cmake b/cmake/Modules/IosMacros.cmake deleted file mode 100644 index b1e5cc438..000000000 --- a/cmake/Modules/IosMacros.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if(COMPILE_FOR_IOS) - include_directories(iOS) -endif() - -macro(find_package_wrapper) - if(COMPILE_FOR_IOS) - find_host_package(${ARGN}) - else() - find_package(${ARGN}) - endif() -endmacro()
\ No newline at end of file diff --git a/cmake/Modules/Packager.cmake b/cmake/Modules/Packager.cmake deleted file mode 100644 index 7aad1d7b0..000000000 --- a/cmake/Modules/Packager.cmake +++ /dev/null @@ -1,229 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -############# -# RPM/DEB/TGZ Packaging utils -# - -set(CONTACT "hicn-dev@lists.fd.io" CACHE STRING "Contact") -set(PACKAGE_MAINTAINER "ICN Team" CACHE STRING "Maintainer") -set(PACKAGE_VENDOR "fd.io" CACHE STRING "Vendor") - -function(get_next_version VERSION NEXT_VERSION) - string(REGEX REPLACE "([0-9]+).([0-9]+)" "\\1;\\2" VER_NUMBERS ${VERSION}) - - # Increment version for getting next version value - list(GET VER_NUMBERS 0 major) - list(GET VER_NUMBERS 1 minor) - - math(EXPR minor "${minor} + 4") - - if (minor GREATER 12) - math(EXPR minor "${minor} % 12") - math(EXPR major "${major} + 1") - endif() - - if (minor LESS 10) - set(minor "0${minor}") - endif() - - set(${NEXT_VERSION} "${major}.${minor}" PARENT_SCOPE) -endfunction() - -macro(extract_version) - # Extract version from git - execute_process( - COMMAND git describe --long --match v* - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - OUTPUT_VARIABLE VER - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - if (NOT VER) - set(VER "v1.2-0-gcafe") - endif() - - message(STATUS "Git describe output: ${VER}") - - string(REGEX REPLACE "v([0-9]+).([0-9]+)-?(.*)?-([0-9]+)-(g[0-9a-f]+)" "\\1;\\2;\\3;\\4;\\5;" VER ${VER}) - list(GET VER 0 VERSION_MAJOR) - list(GET VER 1 VERSION_MINOR) - list(GET VER 2 RELEASE_CANDIDATE) - list(GET VER 3 VERSION_REVISION) - list(GET VER 4 COMMIT_NAME) -endmacro(extract_version) - -function(make_packages) - if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") - # parse /etc/os-release - file(READ "/etc/os-release" os_version) - string(REPLACE "\n" ";" os_version ${os_version}) - foreach(_ver ${os_version}) - string(REPLACE "=" ";" _ver ${_ver}) - list(GET _ver 0 _name) - list(GET _ver 1 _value) - set(OS_${_name} ${_value}) - endforeach() - - extract_version() - - message(STATUS "Version major: ${VERSION_MAJOR}") - message(STATUS "Version minor: ${VERSION_MINOR}") - message(STATUS "Release: ${RELEASE_CANDIDATE}") - message(STATUS "Revision: ${VERSION_REVISION}") - message(STATUS "Commit hash: ${COMMIT_NAME}") - - set(tag "${VERSION_MAJOR}.${VERSION_MINOR}") - string(REPLACE "-" "~" tag ${tag}) - set(commit_num ${VERSION_REVISION}) - set(commit_name ${COMMIT_NAME}) - - if (NOT DEFINED ENV{BUILD_NUMBER}) - set(bld "b1") - else() - set(bld "b$ENV{BUILD_NUMBER}") - endif() - - message(STATUS "Build number is: ${bld}") - - #define DEB and RPM version numbers - if(NOT RELEASE_CANDIDATE) - if (commit_num) - set(deb_ver "${tag}.${commit_num}-release") - set(rpm_ver "${tag}.${commit_num}") - else() - set(deb_ver "${tag}-release") - set(rpm_ver "${tag}") - endif() - set(rpm_release "release") - else() - # TODO To be changed for next release with - # set(deb_ver "${tag}${RELEASE_CANDIDATE}~${commit_num}") - # set(rpm_ver "${tag}") - # set(rpm_release "${RELEASE_CANDIDATE}~${commit_num}") - set(deb_ver "${tag}-${commit_num}") - set(rpm_ver "${tag}-${commit_num}") - set(rpm_release "1") - endif() - - message(STATUS "Version: ${deb_ver}") - - get_next_version(${tag} next_version) - message(STATUS "Next version: ${next_version}") - - get_cmake_property(components COMPONENTS) - list(REMOVE_ITEM components "Unspecified") - set(CPACK_COMPONENTS_ALL ${components}) - - list(LENGTH components N_COMPONENTS) - - if (NOT N_COMPONENTS) - return() - endif() - - if(OS_ID MATCHES "debian" OR OS_ID_LIKE MATCHES "debian") - set(CPACK_GENERATOR "DEB") - set(type "DEBIAN") - - execute_process( - COMMAND dpkg --print-architecture - OUTPUT_VARIABLE arch - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - set(CPACK_${type}_PACKAGE_VERSION "${deb_ver}") - foreach(lc ${components}) - if (${lc} MATCHES ".*Unspecified.*") - continue() - endif() - - string(TOUPPER ${lc} uc) - set(CPACK_${type}_${uc}_FILE_NAME "${lc}_${deb_ver}_${arch}.deb") - - set(DEB_DEPS) - if (NOT ${${lc}_DEB_DEPENDENCIES} STREQUAL "") - string(REPLACE "stable_version" ${tag} DEB_DEPS ${${lc}_DEB_DEPENDENCIES}) - string(REPLACE "next_version" ${next_version} DEB_DEPS ${DEB_DEPS}) - endif() - - set(CPACK_${type}_${uc}_PACKAGE_DEPENDS "${DEB_DEPS}") - set(CPACK_${type}_${uc}_PACKAGE_NAME "${lc}") - set(CPACK_COMPONENT_${uc}_DESCRIPTION "${${lc}_DESCRIPTION}") - - if (${lc}_DEB_PACKAGE_CONTROL_EXTRA) - set(CPACK_DEBIAN_${uc}_PACKAGE_CONTROL_EXTRA "${${lc}_DEB_PACKAGE_CONTROL_EXTRA}") - endif() - endforeach() - elseif(OS_ID_LIKE MATCHES "rhel") - set(CPACK_GENERATOR "RPM") - set(type "RPM") - - execute_process( - COMMAND uname -m - OUTPUT_VARIABLE arch - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - set(CPACK_${type}_PACKAGE_VERSION "${rpm_ver}") - set(CPACK_${type}_PACKAGE_RELEASE "${rpm_release}") - foreach(lc ${components}) - if (${lc} MATCHES ".*Unspecified.*") - continue() - endif() - - string(TOUPPER ${lc} uc) - set(CPACK_${type}_${uc}_DESCRIPTION "${${lc}_DESCRIPTION}") - - set(RPM_DEPS) - if (NOT ${${lc}_RPM_DEPENDENCIES} STREQUAL "") - string(REPLACE "stable_version" ${tag} RPM_DEPS ${${lc}_RPM_DEPENDENCIES}) - string(REPLACE "next_version" ${next_version} RPM_DEPS ${RPM_DEPS}) - endif() - - set(CPACK_${type}_${uc}_PACKAGE_REQUIRES "${RPM_DEPS}") - - if(${lc} MATCHES ".*-dev") - set(package_name ${lc}el) - else() - set(package_name ${lc}) - endif() - - set(CPACK_RPM_${uc}_PACKAGE_NAME "${package_name}") - set(CPACK_${type}_${uc}_FILE_NAME "${package_name}-${rpm_ver}-${rpm_release}.${arch}.rpm") - - if (NOT ${${lc}_RPM_POST_INSTALL_SCRIPT_FILE} STREQUAL "") - set(CPACK_RPM_${uc}_POST_INSTALL_SCRIPT_FILE "${${lc}_RPM_POST_INSTALL_SCRIPT_FILE}") - endif() - - if (NOT ${${lc}_RPM_POST_UNINSTALL_SCRIPT_FILE} STREQUAL "") - set(CPACK_RPM_${uc}_POST_UNINSTALL_SCRIPT_FILE "${${lc}_RPM_POST_UNINSTALL_SCRIPT_FILE}") - endif() - - if (NOT ${${lc}_RPM_PRE_UNINSTALL_SCRIPT_FILE} STREQUAL "") - set(CPACK_RPM_${uc}_PRE_UNINSTALL_SCRIPT_FILE "${${lc}_RPM_PRE_UNINSTALL_SCRIPT_FILE}") - endif() - endforeach() - endif() - - if(CPACK_GENERATOR) - set(CPACK_PACKAGE_NAME ${ARG_NAME}) - set(CPACK_STRIP_FILES OFF) - set(CPACK_PACKAGE_VENDOR "${PACKAGE_VENDOR}") - set(CPACK_COMPONENTS_IGNORE_GROUPS 1) - set(CPACK_${CPACK_GENERATOR}_COMPONENT_INSTALL ON) - set(CPACK_${type}_PACKAGE_MAINTAINER "HICN Team") - set(CPACK_PACKAGE_CONTACT ${CONTACT}) - include(CPack) - endif() - endif() -endfunction() diff --git a/cmake/Modules/ServiceScript.cmake b/cmake/Modules/ServiceScript.cmake deleted file mode 100644 index 110aa816b..000000000 --- a/cmake/Modules/ServiceScript.cmake +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -######################################## -# -# Find the LongBow libraries and includes -# This module sets: -# SYSTEMD_FOUND: True if Systemd was found -# SYSTEMD_SERVICES_INSTALL_DIR: The Systemd install directory - -set(SYSTEMD_SERVICE_FOLDER "/lib/systemd/system") - -macro(install_service_script script) -cmake_parse_arguments(ARG - "" - "COMPONENT" - "" - ${ARGN} -) - - # Install service file only if - # 1) We are on a linux system - # 2) The installation prefix is /usr - - if (NOT ARG_COMPONENT) - set(ARG_COMPONENT hicn) - endif() - - if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr") - install (FILES ${script} DESTINATION ${SYSTEMD_SERVICE_FOLDER} COMPONENT ${ARG_COMPONENT}) - endif() -endmacro(install_service_script)
\ No newline at end of file diff --git a/cmake/Modules/WindowsMacros.cmake b/cmake/Modules/WindowsMacros.cmake deleted file mode 100644 index 0b34cde19..000000000 --- a/cmake/Modules/WindowsMacros.cmake +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if(WIN32) - find_package(LibEvent REQUIRED) - find_package(OpenSSL REQUIRED) - find_package(PThread REQUIRED) - find_library(WSOCK32_LIBRARY wsock32 required) - find_library(WS2_32_LIBRARY ws2_32 required) - list(APPEND WINDOWS_LIBRARIES - ${LIBEVENT_LIBRARIES} - ${OPENSSL_LIBRARIES} - ${PTHREAD_LIBRARIES} - ${WSOCK32_LIBRARY} - ${WS2_32_LIBRARY} - ) - - list(APPEND WINDOWS_INCLUDE_DIRS - ${LIBEVENT_INCLUDE_DIRS} - ${OPENSSL_INCLUDE_DIR} - ${PTHREAD_INCLUDE_DIRS} - ) -endif()
\ No newline at end of file diff --git a/cmake/Modules/detectCacheSize.cmake b/cmake/Modules/detectCacheSize.cmake deleted file mode 100644 index a8209bb27..000000000 --- a/cmake/Modules/detectCacheSize.cmake +++ /dev/null @@ -1,21 +0,0 @@ -# Detect the cache size -# -# XXX: TODO: This is a bug when cross compiling. We are detecting the local -# Cache Line size and not the target cache line size. We should provide some -# way to define this - -set(LEVEL1_DCACHE_LINESIZE 32) - -if( APPLE ) - execute_process(COMMAND sysctl -n hw.cachelinesize - OUTPUT_VARIABLE LEVEL1_DCACHE_LINESIZE - OUTPUT_STRIP_TRAILING_WHITESPACE) -endif( APPLE ) - -if( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" ) - execute_process(COMMAND getconf LEVEL1_DCACHE_LINESIZE - OUTPUT_VARIABLE LEVEL1_DCACHE_LINESIZE - OUTPUT_STRIP_TRAILING_WHITESPACE) -endif() - -message(STATUS "Cache line size: ${LEVEL1_DCACHE_LINESIZE}") |