ss412g | 1a79bdf | 2019-10-24 12:03:05 +0300 | [diff] [blame] | 1 | # Copyright 2019 AT&T Intellectual Property |
| 2 | # Copyright 2019 Nokia |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
nm755n | 2e26814 | 2019-11-28 16:40:23 +0000 | [diff] [blame] | 16 | # This source code is part of the near-RT RIC (RAN Intelligent Controller) |
| 17 | # platform project (RICP). |
| 18 | |
ss412g | 1a79bdf | 2019-10-24 12:03:05 +0300 | [diff] [blame] | 19 | cmake_minimum_required(VERSION 3.13) |
| 20 | project(e2) |
| 21 | |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 22 | set(CMAKE_VERBOSE_MAKEFILE off) |
ss412g | 1a79bdf | 2019-10-24 12:03:05 +0300 | [diff] [blame] | 23 | |
| 24 | set(CMAKE_CXX_STANDARD 17) |
| 25 | |
| 26 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEV_PKG=1") |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 27 | set(PROJECT_NAME "e2") |
| 28 | set(PROJECT_TEST_NAME "e2") |
ss412g | 1a79bdf | 2019-10-24 12:03:05 +0300 | [diff] [blame] | 29 | |
ss412g | 1a79bdf | 2019-10-24 12:03:05 +0300 | [diff] [blame] | 30 | |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 31 | if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") |
| 32 | #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DASN_DISABLE_OER_SUPPORT -DASN_PDU_COLLECTION -L. -LRIC-E2-TERMINATION/tracelibcpp/build -ggdb3 -Wall -W -Wpedantic") |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 33 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DASN_DISABLE_OER_SUPPORT -DASN_PDU_COLLECTION -L. -g -ggdb3 -O3 -L/usr/lib -L/usr/local/lib -Wall -Wpedantic") |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 34 | #only c code with -O3 |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 35 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DASN_DISABLE_OER_SUPPORT -DASN_PDU_COLLECTION -L. -O3 -L/usr/lib -L/usr/local/lib -Wall -W -Wpedantic") |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 36 | else () |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 37 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DASN_DISABLE_OER_SUPPORT -DASN_PDU_COLLECTION -L. -ggdb3 --coverage -L/usr/lib -L/usr/local/lib -Wall -Wpedantic") |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 38 | #only c code with -O3 |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 39 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DASN_DISABLE_OER_SUPPORT -DASN_PDU_COLLECTION -L. -ggdb3 -L/usr/lib -L/usr/local/lib -Wall -W -Wpedantic") |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 40 | |
| 41 | endif () |
aa7133@att.com | 7b437f7 | 2020-03-30 13:25:54 +0300 | [diff] [blame^] | 42 | |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 43 | include_directories(RIC-E2-TERMINATION |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 44 | RIC-E2-TERMINATION/3rdparty/oranE2 |
aa7133@att.com | 7b437f7 | 2020-03-30 13:25:54 +0300 | [diff] [blame^] | 45 | RIC-E2-TERMINATION/3rdparty/oranE2SM |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 46 | RIC-E2-TERMINATION/3rdparty |
| 47 | cmake-modules) |
ss412g | 1a79bdf | 2019-10-24 12:03:05 +0300 | [diff] [blame] | 48 | |
aa7133@att.com | 7b437f7 | 2020-03-30 13:25:54 +0300 | [diff] [blame^] | 49 | #E2AP library |
| 50 | file(GLOB E2AP_ASN_MODULE_SRCS "RIC-E2-TERMINATION/3rdparty/oranE2/*.c") |
| 51 | file(GLOB E2AP_ASN_MODULE_HDRS "RIC-E2-TERMINATION/3rdparty/oranE2/*.h") |
ss412g | 1a79bdf | 2019-10-24 12:03:05 +0300 | [diff] [blame] | 52 | |
aa7133@att.com | 7b437f7 | 2020-03-30 13:25:54 +0300 | [diff] [blame^] | 53 | add_library(asn1codec ${E2AP_ASN_MODULE_SRCS} ${E2AP_ASN_MODULE_HDRS}) |
ss412g | 1a79bdf | 2019-10-24 12:03:05 +0300 | [diff] [blame] | 54 | install(TARGETS asn1codec DESTINATION /usr/lib) |
aa7133@att.com | 7b437f7 | 2020-03-30 13:25:54 +0300 | [diff] [blame^] | 55 | install(FILES ${E2AP_E2AP_ASN_MODULE_HDRS} DESTINATION /usr/include/asn1c) |
| 56 | |
| 57 | |
| 58 | #E2SM library |
| 59 | file(GLOB E2SM_ASN_MODULE_SRCS "RIC-E2-TERMINATION/3rdparty/oranE2SM/*.c") |
| 60 | file(GLOB E2SM_ASN_MODULE_HDRS "RIC-E2-TERMINATION/3rdparty/oranE2SM/*.h") |
| 61 | |
| 62 | add_library(asn1ce2smcodec ${E2SM_ASN_MODULE_SRCS} ${E2SM_ASN_MODULE_HDRS}) |
| 63 | #add_custom_command( |
| 64 | # TARGET asn1ce2smcodec |
| 65 | # POST_BUILD |
| 66 | # COMMAND objcopy |
| 67 | # ARGS --prefix-symbols=e2sm_ libasn1ce2smcodec.a |
| 68 | #) |
| 69 | |
| 70 | install(TARGETS asn1ce2smcodec DESTINATION /usr/lib) |
| 71 | install(FILES ${E2SM_ASN_MODULE_HDRS} DESTINATION /usr/include/asn1c) |
ss412g | 1a79bdf | 2019-10-24 12:03:05 +0300 | [diff] [blame] | 72 | |
ss412g | 1a79bdf | 2019-10-24 12:03:05 +0300 | [diff] [blame] | 73 | include_directories(RIC-E2-TERMINATION/TEST) |
| 74 | include_directories(RIC-E2-TERMINATION/TEST/e2smTest) |
| 75 | include_directories(RIC-E2-TERMINATION/TEST/T1) |
| 76 | include_directories(RIC-E2-TERMINATION/TEST/T2) |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 77 | |
ss412g | 1a79bdf | 2019-10-24 12:03:05 +0300 | [diff] [blame] | 78 | |
ss412g | 1a79bdf | 2019-10-24 12:03:05 +0300 | [diff] [blame] | 79 | add_definitions(-DBOOST_LOG_DYN_LINK) |
| 80 | |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 81 | link_libraries(nsl |
| 82 | sctp |
| 83 | gcov |
| 84 | c |
| 85 | m |
| 86 | dl |
| 87 | mdclog |
aa7133@att.com | 7ed3d13 | 2020-03-23 15:50:03 +0200 | [diff] [blame] | 88 | rmr_si |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 89 | asn1codec |
aa7133@att.com | 7b437f7 | 2020-03-30 13:25:54 +0300 | [diff] [blame^] | 90 | asn1ce2smcodec |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 91 | boost_system |
| 92 | boost_log_setup |
| 93 | boost_log |
| 94 | boost_date_time |
| 95 | boost_thread |
| 96 | boost_system |
| 97 | rt |
| 98 | boost_filesystem |
| 99 | cgreen |
| 100 | pthread) |
ss412g | 1a79bdf | 2019-10-24 12:03:05 +0300 | [diff] [blame] | 101 | |
| 102 | add_executable(e2 RIC-E2-TERMINATION/sctpThread.cpp |
| 103 | RIC-E2-TERMINATION/sctpThread.h |
| 104 | RIC-E2-TERMINATION/openTracing.h |
| 105 | RIC-E2-TERMINATION/mapWrapper.h |
| 106 | RIC-E2-TERMINATION/base64.h |
| 107 | RIC-E2-TERMINATION/base64.cpp |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 108 | RIC-E2-TERMINATION/ReadConfigFile.h |
aa7133@att.com | 7b437f7 | 2020-03-30 13:25:54 +0300 | [diff] [blame^] | 109 | RIC-E2-TERMINATION/BuildRunName.h |
| 110 | RIC-E2-TERMINATION/statCollector.h) |
| 111 | target_link_libraries(e2 libasn1ce2smcodec.a) |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 112 | target_link_libraries(e2 librmr_nng.a) |
| 113 | target_link_libraries(e2 librmr_si.a) |
| 114 | target_link_libraries(e2 libicui18n.a) |
| 115 | target_link_libraries(e2 libicuuc.a) |
| 116 | target_link_libraries(e2 libicudata.a) |
ss412g | 1a79bdf | 2019-10-24 12:03:05 +0300 | [diff] [blame] | 117 | |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 118 | #target_link_libraries(e2 libnng.a) |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 119 | |
| 120 | add_executable(testConfigFile |
| 121 | RIC-E2-TERMINATION/ReadConfigFile.h |
| 122 | RIC-E2-TERMINATION/TEST/ConfigurationFileTest/testConfigFile.cpp) |
| 123 | |
| 124 | add_executable(b64Test |
| 125 | RIC-E2-TERMINATION/base64.cpp |
| 126 | RIC-E2-TERMINATION/base64.h |
| 127 | RIC-E2-TERMINATION/TEST/base64/testBase64.cpp) |
| 128 | |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 129 | |
| 130 | add_executable(sctpClient |
aa7133@att.com | bc6da78 | 2020-03-16 18:22:09 +0200 | [diff] [blame] | 131 | RIC-E2-TERMINATION/TEST/testAsn/sctpClient/sctpClient.cpp |
| 132 | RIC-E2-TERMINATION/TEST/testAsn/sctpClient/sctpClient.h |
| 133 | RIC-E2-TERMINATION/TEST/testAsn/rmrClient/rmrClient.h |
| 134 | RIC-E2-TERMINATION/TEST/testAsn/httpServer/HttpServer.cpp |
| 135 | RIC-E2-TERMINATION/TEST/testAsn/httpServer/HttpServer.h |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 136 | RIC-E2-TERMINATION/base64.h |
| 137 | RIC-E2-TERMINATION/base64.cpp |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 138 | RIC-E2-TERMINATION/TEST/T1/E2Builder.h |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 139 | |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 140 | #RIC-E2-TERMINATION/TEST/T1/Test1.cpp |
| 141 | #RIC-E2-TERMINATION/TEST/T1/ |
| 142 | ) |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 143 | target_link_libraries(sctpClient libpistache.a) |
| 144 | target_link_libraries(sctpClient librmr_nng.a) |
| 145 | target_link_libraries(sctpClient librmr_si.a) |
| 146 | #target_link_libraries(sctpClient libnng.a) |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 147 | |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 148 | add_executable(setUpMessages |
aa7133@att.com | bc6da78 | 2020-03-16 18:22:09 +0200 | [diff] [blame] | 149 | RIC-E2-TERMINATION/TEST/testAsn/setUpMessages/SetUpMessages.cpp |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 150 | RIC-E2-TERMINATION/BuildRunName.h |
| 151 | ) |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 152 | |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 153 | #find_package(RapidJSON) |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 154 | |
| 155 | add_executable(teste2 |
| 156 | RIC-E2-TERMINATION/TEST/e2test.h |
| 157 | RIC-E2-TERMINATION/TEST/e2test.cpp |
| 158 | ) |
| 159 | |
| 160 | if (CMAKE_BUILD_TYPE STREQUAL "Debug") |
| 161 | LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules") |
| 162 | set(CMAKE_BUILD_TYPE "Debug") |
| 163 | include(cmake-modules/CodeCoverage.cmake) |
| 164 | target_link_libraries(${PROJECT_TEST_NAME} gcov) |
| 165 | |
| 166 | set(LDFLAGS "--coverage -fprofile-arcs") |
| 167 | |
| 168 | # setup_target_for_coverage_lcov(${PROJECT_NAME}_coverage ${PROJECT_TEST_NAME} coverage) |
| 169 | set(COVERAGE_LCOV_EXCLUDES ${PROJECT_SOURCE_DIR}/config' |
| 170 | ${PROJECT_SOURCE_DIR}/log' |
| 171 | '${PROJECT_SOURCE_DIR}/docs' |
| 172 | '${PROJECT_SOURCE_DIR}/RIC-E2-TERMINATION/3rdparty' |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 173 | '${PROJECT_SOURCE_DIR}/RIC-E2-TERMINATION/oranE2' |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 174 | '${PROJECT_SOURCE_DIR}/RIC-E2-TERMINATION/TEST' |
| 175 | '${PROJECT_SOURCE_DIR}/RIC-E2-TERMINATION/config') |
| 176 | |
| 177 | set(COVERAGE_EXCLUDES '${PROJECT_SOURCE_DIR}/config' |
| 178 | ${PROJECT_SOURCE_DIR}/log' |
| 179 | '${PROJECT_SOURCE_DIR}/docs' |
| 180 | '${PROJECT_SOURCE_DIR}/RIC-E2-TERMINATION/3rdparty' |
aa7133@att.com | a8a819f | 2020-03-16 12:04:24 +0200 | [diff] [blame] | 181 | '${PROJECT_SOURCE_DIR}/RIC-E2-TERMINATION/oranE2' |
ss412g | 3bac2da | 2020-01-05 11:52:19 +0200 | [diff] [blame] | 182 | '${PROJECT_SOURCE_DIR}/RIC-E2-TERMINATION/TEST' |
| 183 | '${PROJECT_SOURCE_DIR}/RIC-E2-TERMINATION/config') |
| 184 | append_coverage_compiler_flags() |
| 185 | SETUP_TARGET_FOR_COVERAGE_LCOV(NAME e2_coverage |
| 186 | EXECUTABLE e2 |
| 187 | DEPENDENCIES e2) |
| 188 | endif () |