diff options
author | Mauro Sardara <msardara@cisco.com> | 2019-12-06 18:25:28 +0100 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2019-12-10 17:50:49 +0100 |
commit | 3f21100e1d2ec47b64670a8b08d0c9d067bf9ef3 (patch) | |
tree | 6774ce7f2bc020b646366503eaa6acf2f0af13eb /libtransport | |
parent | e8eda2c819b36555d9d6b080eaf8b4b1109d7646 (diff) |
[HICN-430] Rework on CMake
Change way targets are defined: each project defines targets.
Fix project BUILD flags
Add build-extras bash script
Rework build tree of extras folder, using ExternalProject_Add
Change-Id: I82fa29896e54c8a033490eba013c3f0431bec9d0
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport')
-rw-r--r-- | libtransport/CMakeLists.txt | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libtransport/CMakeLists.txt b/libtransport/CMakeLists.txt index 690b86cd8..cc302d09a 100644 --- a/libtransport/CMakeLists.txt +++ b/libtransport/CMakeLists.txt @@ -55,8 +55,10 @@ set(TRANSPORT_INTERFACES ${TRANSPORT_ROOT_PATH}/interfaces) # Install includes set(INSTALL_INCLUDE_DIR include/hicn/transport) +set(LIBTRANSPORT hicntransport) if ((BUILD_HICNPLUGIN OR BUILD_MEMIF_CONNECTOR) AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") set(__vpp__ 1) + set(LIBTRANSPORT ${LIBTRANSPORT}-memif) find_package(Vpp REQUIRED) list(APPEND LIBTRANSPORT_INTERNAL_INCLUDE_DIRS @@ -64,18 +66,24 @@ if ((BUILD_HICNPLUGIN OR BUILD_MEMIF_CONNECTOR) AND "${CMAKE_SYSTEM_NAME}" STREQ ) endif () +set(LIBTRANSPORT ${LIBTRANSPORT} CACHE INTERNAL "" FORCE) +set(LIBTRANSPORT_SHARED ${LIBTRANSPORT}.shared CACHE INTERNAL "" FORCE) +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) +if (__vpp__) + find_package(Libmemif REQUIRED) +endif() + if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) - set(LIBTRANSPORT hicntransport) if (__vpp__) find_package(HicnPlugin REQUIRED) - find_package(Libmemif REQUIRED) find_package(Libhicnctrl REQUIRED) - set(LIBTRANSPORT ${LIBTRANSPORT}-memif) list(APPEND LIBRARIES ${LIBMEMIF_LIBRARIES} @@ -84,9 +92,6 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) endif() find_package_wrapper(Libhicn REQUIRED) - - set(LIBTRANSPORT_SHARED ${LIBTRANSPORT}.shared) - set(LIBTRANSPORT_STATIC ${LIBTRANSPORT}.static) else() if (${CMAKE_SYSTEM_NAME} STREQUAL "Android") set(HICN_LIBRARIES ${LIBHICN_STATIC} log) @@ -105,12 +110,6 @@ else() ${LIBHICNCTRL_SHARED} ) - if (NOT Libmemif_FOUND) - list(APPEND DEPENDENCIES - ${LIBMEMIF_SHARED} - ) - endif() - set(LIBHICNCTRL_LIBRARIES ${LIBHICNCTRL_SHARED}) list(APPEND LIBRARIES ${LIBMEMIF_LIBRARIES} @@ -121,6 +120,7 @@ endif() list(APPEND LIBTRANSPORT_INTERNAL_INCLUDE_DIRS ${LIBMEMIF_INCLUDE_DIRS} + ${LIBHICNCTRL_INCLUSE_DIRS} ) include(Packaging) |