Minor cleanup of security library handling in cmake

master
Paul Sutton 8 years ago
parent 919ff78e35
commit 0b64e8a9ee

@ -74,17 +74,15 @@ find_package(Threads REQUIRED)
find_package(Polarssl) find_package(Polarssl)
if (POLARSSL_FOUND) if (POLARSSL_FOUND)
set(POLAR_INCLUDE_DIRS "${POLARSSL_INCLUDE_DIRS}") set(SEC_INCLUDE_DIRS "${POLARSSL_INCLUDE_DIRS}")
set(POLAR_LIBRARIES "${POLARSSL_LIBRARIES}") set(SEC_LIBRARIES "${POLARSSL_LIBRARIES}")
add_definitions(-DHAVE_POLARSSL) add_definitions(-DHAVE_POLARSSL)
else(POLARSSL_FOUND) else(POLARSSL_FOUND)
find_package(MbedTLS) find_package(MbedTLS REQUIRED)
if (MBEDTLS_FOUND) if (MBEDTLS_FOUND)
set(POLAR_INCLUDE_DIRS "${MBEDTLS_INCLUDE_DIRS}") set(SEC_INCLUDE_DIRS "${MBEDTLS_INCLUDE_DIRS}")
set(POLAR_LIBRARIES "${MBEDTLS_LIBRARIES}") set(SEC_LIBRARIES "${MBEDTLS_LIBRARIES}")
add_definitions(-DHAVE_MBEDTLS) add_definitions(-DHAVE_MBEDTLS)
else(MBEDTLS_FOUND)
message(FATAL_ERROR "Either polarssl or mbedtls is required to compile srsLTE")
endif (MBEDTLS_FOUND) endif (MBEDTLS_FOUND)
endif(POLARSSL_FOUND) endif(POLARSSL_FOUND)

@ -21,6 +21,6 @@
file(GLOB CXX_SOURCES "*.cc") file(GLOB CXX_SOURCES "*.cc")
file(GLOB C_SOURCES "*.c") file(GLOB C_SOURCES "*.c")
add_library(srslte_common SHARED ${C_SOURCES} ${CXX_SOURCES}) 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}) install(TARGETS srslte_common DESTINATION ${LIBRARY_DIR})
SRSLTE_SET_PIC(srslte_common) SRSLTE_SET_PIC(srslte_common)

@ -22,7 +22,7 @@
# LOGGER TEST # LOGGER TEST
####################################################################### #######################################################################
add_executable(logger_test logger_test.cc) 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_test(logger_test logger_test)
add_executable(msg_queue_test msg_queue_test.cc) 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_test(msg_queue_test msg_queue_test)
add_executable(log_filter_test log_filter_test.cc) 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) add_executable(timeout_test timeout_test.cc)
target_link_libraries(timeout_test srslte_phy ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(timeout_test srslte_phy ${CMAKE_THREAD_LIBS_INIT})

@ -34,13 +34,13 @@ endif()
######################################################################## ########################################################################
include_directories( include_directories(
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${POLAR_INCLUDE_DIRS} ${SEC_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/srsenb/hdr ${PROJECT_SOURCE_DIR}/srsenb/hdr
) )
link_directories( link_directories(
${Boost_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS}
${POLAR_LIBRARY_DIRS} ${SEC_LIBRARY_DIRS}
) )
######################################################################## ########################################################################

@ -25,7 +25,7 @@ target_link_libraries(srsenb srsenb_upper
srslte_radio srslte_radio
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${Boost_LIBRARIES} ${Boost_LIBRARIES}
${POLAR_LIBRARIES} ${SEC_LIBRARIES}
${LIBCONFIGPP_LIBRARIES} ${LIBCONFIGPP_LIBRARIES}
${SCTP_LIBRARIES}) ${SCTP_LIBRARIES})

@ -9,7 +9,7 @@ target_link_libraries(ip_test_enb srsenb_upper
srslte_radio srslte_radio
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${Boost_LIBRARIES} ${Boost_LIBRARIES}
${POLAR_LIBRARIES}) ${SEC_LIBRARIES})
# Simple PLMN -> MCC/MNC test # Simple PLMN -> MCC/MNC test
add_executable(plmn_test plmn_test.cc) add_executable(plmn_test plmn_test.cc)

@ -30,13 +30,13 @@ endif()
######################################################################## ########################################################################
include_directories( include_directories(
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${POLAR_INCLUDE_DIRS} ${SEC_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/srsue/hdr ${PROJECT_SOURCE_DIR}/srsue/hdr
) )
link_directories( link_directories(
${Boost_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS}
${POLAR_LIBRARY_DIRS} ${SEC_LIBRARY_DIRS}
) )
######################################################################## ########################################################################

Loading…
Cancel
Save