diff options
author | 2021-06-30 07:57:22 +0000 | |
---|---|---|
committer | 2021-07-06 16:16:04 +0000 | |
commit | 08233d44a6cfde878d7e10bca38ae935ed1c8fd5 (patch) | |
tree | 7ecc534d55bdc7e8dd15ecab084720910bcdf4d9 /libtransport/src/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/src/CMakeLists.txt')
-rw-r--r-- | libtransport/src/CMakeLists.txt | 59 |
1 files changed, 23 insertions, 36 deletions
diff --git a/libtransport/src/CMakeLists.txt b/libtransport/src/CMakeLists.txt index 079427fea..5e0cd38e7 100644 --- a/libtransport/src/CMakeLists.txt +++ b/libtransport/src/CMakeLists.txt @@ -11,8 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) - include(GNUInstallDirs) set(ASIO_STANDALONE 1) @@ -31,17 +29,16 @@ configure_file("config.h.in" "hicn/transport/config.h" @ONLY) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/hicn/transport/config.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hicn/transport - COMPONENT lib${LIBTRANSPORT}-dev + COMPONENT ${LIBTRANSPORT_COMPONENT}-dev ) install( FILES "transport.config" DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/hicn - COMPONENT lib${LIBTRANSPORT} + COMPONENT ${LIBTRANSPORT_COMPONENT} ) list(APPEND COMPILER_DEFINITIONS - "-DTRANSPORT_LOG_DEF_LEVEL=TRANSPORT_LOG_${TRANSPORT_LOG_LEVEL}" "-DASIO_STANDALONE" ) @@ -67,42 +64,32 @@ endif () if (${CMAKE_SYSTEM_NAME} MATCHES "Android") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -isystem -lm") - add_subdirectory(io_modules) endif() -if (DISABLE_SHARED_LIBRARIES) - build_library(${LIBTRANSPORT} - STATIC - SOURCES ${SOURCE_FILES} ${HEADER_FILES} - INSTALL_HEADERS ${LIBHICNTRANSPORT_TO_INSTALL_HEADER_FILES} - LINK_LIBRARIES ${LIBRARIES} - DEPENDS ${DEPENDENCIES} - COMPONENT lib${LIBTRANSPORT} - INCLUDE_DIRS ${LIBTRANSPORT_INCLUDE_DIRS} ${LIBTRANSPORT_INTERNAL_INCLUDE_DIRS} - HEADER_ROOT_DIR hicn/transport - DEFINITIONS ${COMPILER_DEFINITIONS} - VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION} - ) -else () - build_library(${LIBTRANSPORT} - STATIC SHARED - SOURCES ${SOURCE_FILES} ${HEADER_FILES} - INSTALL_HEADERS ${LIBHICNTRANSPORT_TO_INSTALL_HEADER_FILES} - LINK_LIBRARIES ${LIBRARIES} - DEPENDS ${DEPENDENCIES} - COMPONENT lib${LIBTRANSPORT} - INCLUDE_DIRS ${LIBTRANSPORT_INCLUDE_DIRS} ${LIBTRANSPORT_INTERNAL_INCLUDE_DIRS} - HEADER_ROOT_DIR hicn/transport - DEFINITIONS ${COMPILER_DEFINITIONS} - VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION} - ) -endif () +set (BUILD_TYPES "STATIC") -# io modules -if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Android") - add_subdirectory(io_modules) +if (NOT DISABLE_SHARED_LIBRARIES) + list(APPEND BUILD_TYPES + "SHARED" + ) endif() +add_subdirectory(io_modules) + +build_library(${LIBTRANSPORT} + ${BUILD_TYPES} + SOURCES ${SOURCE_FILES} ${HEADER_FILES} + INSTALL_HEADERS ${LIBHICNTRANSPORT_TO_INSTALL_HEADER_FILES} + LINK_LIBRARIES ${LIBRARIES} + OBJECT_LIBRARIES ${THIRD_PARTY_OBJECT_LIBRARIES} + DEPENDS ${DEPENDENCIES} + COMPONENT ${LIBTRANSPORT_COMPONENT} + INCLUDE_DIRS ${LIBTRANSPORT_INCLUDE_DIRS} ${LIBTRANSPORT_INTERNAL_INCLUDE_DIRS} + HEADER_ROOT_DIR hicn/transport + DEFINITIONS ${COMPILER_DEFINITIONS} + VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION} +) + if (${BUILD_TESTS}) add_subdirectory(test) endif() |