From 0b64e8a9ee48aad6824357719380ac4b607f4d0a Mon Sep 17 00:00:00 2001 From: Paul Sutton Date: Fri, 2 Jun 2017 15:59:03 +0100 Subject: [PATCH] Minor cleanup of security library handling in cmake --- CMakeLists.txt | 12 +++++------- lib/src/common/CMakeLists.txt | 2 +- lib/test/common/CMakeLists.txt | 4 ++-- srsenb/CMakeLists.txt | 4 ++-- srsenb/src/CMakeLists.txt | 2 +- srsenb/test/upper/CMakeLists.txt | 2 +- srsue/CMakeLists.txt | 4 ++-- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9998e1f9e..4a567ef5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,17 +74,15 @@ find_package(Threads REQUIRED) find_package(Polarssl) if (POLARSSL_FOUND) - set(POLAR_INCLUDE_DIRS "${POLARSSL_INCLUDE_DIRS}") - set(POLAR_LIBRARIES "${POLARSSL_LIBRARIES}") + set(SEC_INCLUDE_DIRS "${POLARSSL_INCLUDE_DIRS}") + set(SEC_LIBRARIES "${POLARSSL_LIBRARIES}") add_definitions(-DHAVE_POLARSSL) else(POLARSSL_FOUND) - find_package(MbedTLS) + find_package(MbedTLS REQUIRED) if (MBEDTLS_FOUND) - set(POLAR_INCLUDE_DIRS "${MBEDTLS_INCLUDE_DIRS}") - set(POLAR_LIBRARIES "${MBEDTLS_LIBRARIES}") + set(SEC_INCLUDE_DIRS "${MBEDTLS_INCLUDE_DIRS}") + set(SEC_LIBRARIES "${MBEDTLS_LIBRARIES}") add_definitions(-DHAVE_MBEDTLS) - else(MBEDTLS_FOUND) - message(FATAL_ERROR "Either polarssl or mbedtls is required to compile srsLTE") endif (MBEDTLS_FOUND) endif(POLARSSL_FOUND) diff --git a/lib/src/common/CMakeLists.txt b/lib/src/common/CMakeLists.txt index 43a3aef0f..e460900a1 100644 --- a/lib/src/common/CMakeLists.txt +++ b/lib/src/common/CMakeLists.txt @@ -21,6 +21,6 @@ file(GLOB CXX_SOURCES "*.cc") file(GLOB C_SOURCES "*.c") add_library(srslte_common SHARED ${C_SOURCES} ${CXX_SOURCES}) -target_link_libraries(srslte_common ${POLAR_LIBRARIES}) +target_link_libraries(srslte_common ${SEC_LIBRARIES}) install(TARGETS srslte_common DESTINATION ${LIBRARY_DIR}) SRSLTE_SET_PIC(srslte_common) diff --git a/lib/test/common/CMakeLists.txt b/lib/test/common/CMakeLists.txt index 4fc924038..3faa2ff59 100644 --- a/lib/test/common/CMakeLists.txt +++ b/lib/test/common/CMakeLists.txt @@ -22,7 +22,7 @@ # LOGGER TEST ####################################################################### add_executable(logger_test logger_test.cc) -target_link_libraries(logger_test srslte_phy srslte_common srslte_phy ${POLAR_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) +target_link_libraries(logger_test srslte_phy srslte_common srslte_phy ${SEC_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) add_test(logger_test logger_test) add_executable(msg_queue_test msg_queue_test.cc) @@ -30,7 +30,7 @@ target_link_libraries(msg_queue_test srslte_phy srslte_common ${CMAKE_THREAD_LIB add_test(msg_queue_test msg_queue_test) add_executable(log_filter_test log_filter_test.cc) -target_link_libraries(log_filter_test srslte_phy srslte_common srslte_phy ${POLAR_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) +target_link_libraries(log_filter_test srslte_phy srslte_common srslte_phy ${SEC_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) add_executable(timeout_test timeout_test.cc) target_link_libraries(timeout_test srslte_phy ${CMAKE_THREAD_LIBS_INIT}) diff --git a/srsenb/CMakeLists.txt b/srsenb/CMakeLists.txt index f95ad191c..7fa60301a 100644 --- a/srsenb/CMakeLists.txt +++ b/srsenb/CMakeLists.txt @@ -34,13 +34,13 @@ endif() ######################################################################## include_directories( ${Boost_INCLUDE_DIRS} - ${POLAR_INCLUDE_DIRS} + ${SEC_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/srsenb/hdr ) link_directories( ${Boost_LIBRARY_DIRS} - ${POLAR_LIBRARY_DIRS} + ${SEC_LIBRARY_DIRS} ) ######################################################################## diff --git a/srsenb/src/CMakeLists.txt b/srsenb/src/CMakeLists.txt index 34fb66eef..199650fac 100644 --- a/srsenb/src/CMakeLists.txt +++ b/srsenb/src/CMakeLists.txt @@ -25,7 +25,7 @@ target_link_libraries(srsenb srsenb_upper srslte_radio ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES} - ${POLAR_LIBRARIES} + ${SEC_LIBRARIES} ${LIBCONFIGPP_LIBRARIES} ${SCTP_LIBRARIES}) diff --git a/srsenb/test/upper/CMakeLists.txt b/srsenb/test/upper/CMakeLists.txt index 7d11679e7..243da5cdf 100644 --- a/srsenb/test/upper/CMakeLists.txt +++ b/srsenb/test/upper/CMakeLists.txt @@ -9,7 +9,7 @@ target_link_libraries(ip_test_enb srsenb_upper srslte_radio ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES} - ${POLAR_LIBRARIES}) + ${SEC_LIBRARIES}) # Simple PLMN -> MCC/MNC test add_executable(plmn_test plmn_test.cc) diff --git a/srsue/CMakeLists.txt b/srsue/CMakeLists.txt index 6d257cde0..85f391d6b 100644 --- a/srsue/CMakeLists.txt +++ b/srsue/CMakeLists.txt @@ -30,13 +30,13 @@ endif() ######################################################################## include_directories( ${Boost_INCLUDE_DIRS} - ${POLAR_INCLUDE_DIRS} + ${SEC_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/srsue/hdr ) link_directories( ${Boost_LIBRARY_DIRS} - ${POLAR_LIBRARY_DIRS} + ${SEC_LIBRARY_DIRS} ) ########################################################################