Minor cleanup of security library handling in cmake

This commit is contained in:
Paul Sutton 2017-06-02 15:59:03 +01:00
parent 919ff78e35
commit 0b64e8a9ee
7 changed files with 14 additions and 16 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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})

View File

@ -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}
)
########################################################################

View File

@ -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})

View File

@ -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)

View File

@ -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}
)
########################################################################