diff options
author | Mauro <you@example.com> | 2021-06-30 07:57:22 +0000 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2021-07-06 16:16:04 +0000 |
commit | 08233d44a6cfde878d7e10bca38ae935ed1c8fd5 (patch) | |
tree | 7ecc534d55bdc7e8dd15ecab084720910bcdf4d9 /libtransport/CMakeLists.txt | |
parent | 147ba39bed26887f5eba84757e2463ab8e370a9a (diff) |
[HICN-713] Transport Library Major Refactoring 2
Co-authored-by: Luca Muscariello <muscariello@ieee.org>
Co-authored-by: Michele Papalini <micpapal@cisco.com>
Co-authored-by: Olivier Roques <oroques+fdio@cisco.com>
Co-authored-by: Giulio Grassi <gigrassi@cisco.com>
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: I5b2c667bad66feb45abdb5effe22ed0f6c85d1c2
Diffstat (limited to 'libtransport/CMakeLists.txt')
-rw-r--r-- | libtransport/CMakeLists.txt | 57 |
1 files changed, 20 insertions, 37 deletions
diff --git a/libtransport/CMakeLists.txt b/libtransport/CMakeLists.txt index d94f2859b..a5009f353 100644 --- a/libtransport/CMakeLists.txt +++ b/libtransport/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2019 Cisco and/or its affiliates. +# Copyright (c) 2017-2021 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: @@ -11,7 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +# CMake 3.11 required to use FetchContent +cmake_minimum_required(VERSION 3.11 FATAL_ERROR) project(libtransport) @@ -29,37 +30,23 @@ if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") endif () -######################################### -# LOG LEVELS AVAILABLE -# VERBOSE -# DEBUG -# INFO -# WARN -# ERROR -# FATAL -# NONE -# -# Default: INFO -set(TRANSPORT_LOG_LEVEL "INFO" CACHE STRING "Set log level") - set(TRANSPORT_ROOT_PATH "src") set(LIBTRANSPORT hicntransport) +set(LIBTRANSPORT_COMPONENT libhicntransport) + if ((BUILD_HICNPLUGIN OR BUILD_MEMIF_CONNECTOR) AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") set(__vpp__ 1) endif () set(LIBTRANSPORT ${LIBTRANSPORT} CACHE INTERNAL "" FORCE) -if (NOT WIN32) set(LIBTRANSPORT_SHARED ${LIBTRANSPORT}.shared CACHE INTERNAL "" FORCE) -endif () set(LIBTRANSPORT_STATIC ${LIBTRANSPORT}.static CACHE INTERNAL "" FORCE) set(LIBTRANSPORT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/src CACHE INTERNAL "" FORCE) include(WindowsMacros) include(IosMacros) -find_package_wrapper(Libparc REQUIRED) find_package_wrapper(Asio REQUIRED) find_package(OpenSSL REQUIRED) find_package(Threads REQUIRED) @@ -81,42 +68,38 @@ else() else() set(HICN_LIBRARIES ${LIBHICN_SHARED}) list(APPEND DEPENDENCIES - ${LIBHICN_SHARED} ) endif() endif() -if (WIN32) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4275 /wd4996 /wd4311 /wd4302") - if (CMAKE_BUILD_TYPE EQUAL "RELEASE") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:\"MSVCRTD\"" ) - endif () -endif () + include(Packaging) -list(APPEND LIBRARIES - ${HICN_LIBRARIES} - ${LIBPARC_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT} - ${VPP_LIBRARIES} - ${ANDROID_LIBRARIES} - ${OPENSSL_LIBRARIES} - ${WINDOWS_LIBRARIES} - ${LIBCONFIG_CPP_LIBRARIES} -) +add_subdirectory(third-party) -set(LIBTRANSPORT_LIBRARIES_LIST "${LIBPARC_LIBRARIES};${CMAKE_THREAD_LIBS_INIT};${VPP_LIBRARIES};${ANDROID_LIBRARIES};${OPENSSL_LIBRARIES};${WINDOWS_LIBRARIES};${LIBCONFIG_CPP_LIBRARIES}" CACHE INTERNAL "LIBTRANSPORT_LIBRARIES_LIST") +set(LIBRARIES + PRIVATE ${HICN_LIBRARIES} + PRIVATE ${CMAKE_THREAD_LIBS_INIT} + PRIVATE ${CMAKE_DL_LIBS} + PRIVATE ${OPENSSL_LIBRARIES} + PRIVATE ${LIBCONFIG_CPP_LIBRARIES} + PRIVATE ${THIRD_PARTY_LIBRARIES} +) # Include dirs -- Order does matter! list(APPEND LIBTRANSPORT_INTERNAL_INCLUDE_DIRS ${HICN_INCLUDE_DIRS} ${HICNPLUGIN_INCLUDE_DIRS} - ${LIBPARC_INCLUDE_DIRS} ${CMAKE_THREADS_INCLUDE_DIRS} ${ASIO_INCLUDE_DIRS} ${WINDOWS_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${CONFIG_INCLUDE_DIRS} + ${THIRD_PARTY_INCLUDE_DIRS} +) + +list(APPEND DEPENDENCIES + ${THIRD_PARTY_DEPENDENCIES} ) add_subdirectory(includes/hicn/transport) |