cmake: install individual libraries (common, phy, etc)

this seems to be important for package maintainers
or people who use srslte components in other projects
thar require to link against static libs

so besides installing headers, the apps and the RF lib, we also
install all individual libraries

this fixes https://github.com/srsLTE/srsLTE/issues/500#
and https://github.com/softwareradiosystems/srsLTE/issues/1754
master
Andre Puschmann 4 years ago
parent 8376111419
commit 5e7de0a95b

@ -28,6 +28,7 @@ add_library(srslte_asn1 STATIC
# ASN1 utils
add_library(asn1_utils STATIC asn1_utils.cc)
target_link_libraries(asn1_utils srslte_common)
INSTALL(TARGETS asn1_utils DESTINATION ${LIBRARY_DIR})
add_library(rrc_asn1 STATIC
rrc_asn1.cc
@ -38,22 +39,26 @@ add_library(rrc_asn1 STATIC
# Compile RRC ASN1 optimized for size
target_compile_options(rrc_asn1 PRIVATE "-Os")
target_link_libraries(rrc_asn1 asn1_utils srslte_common)
INSTALL(TARGETS rrc_asn1 DESTINATION ${LIBRARY_DIR})
add_library(s1ap_asn1 STATIC
s1ap_asn1.cc)
target_compile_options(s1ap_asn1 PRIVATE "-Os")
target_link_libraries(s1ap_asn1 asn1_utils srslte_common)
INSTALL(TARGETS s1ap_asn1 DESTINATION ${LIBRARY_DIR})
if (ENABLE_5GNR)
# RRC NR ASN1
add_library(rrc_nr_asn1 STATIC rrc_nr_asn1.cc rrc_nr_asn1_utils.cc)
target_compile_options(rrc_nr_asn1 PRIVATE "-Os")
target_link_libraries(rrc_nr_asn1 asn1_utils srslte_common)
INSTALL(TARGETS rrc_nr_asn1 DESTINATION ${LIBRARY_DIR})
# NGAP ASN1
add_library(ngap_nr_asn1 STATIC ngap_nr_asn1.cc)
target_compile_options(ngap_nr_asn1 PRIVATE "-Os")
target_link_libraries(ngap_nr_asn1 asn1_utils srslte_common)
INSTALL(TARGETS ngap_nr_asn1 DESTINATION ${LIBRARY_DIR})
endif(ENABLE_5GNR)

@ -60,4 +60,6 @@ add_executable(arch_select arch_select.cc)
target_include_directories(srslte_common PUBLIC ${SEC_INCLUDE_DIRS})
target_link_libraries(srslte_common srslte_phy srslog ${SEC_LIBRARIES})
INSTALL(TARGETS srslte_common DESTINATION ${LIBRARY_DIR})
add_subdirectory(test)

@ -26,3 +26,4 @@ endif(ENABLE_5GNR)
add_library(srslte_mac STATIC ${SOURCES})
target_link_libraries(srslte_mac srslte_common)
INSTALL(TARGETS srslte_mac DESTINATION ${LIBRARY_DIR})

@ -55,3 +55,4 @@ set(srslte_srcs $<TARGET_OBJECTS:srslte_agc>
add_library(srslte_phy STATIC ${srslte_srcs})
target_link_libraries(srslte_phy pthread m ${FFT_LIBRARIES})
INSTALL(TARGETS srslte_phy DESTINATION ${LIBRARY_DIR})

@ -21,6 +21,7 @@
if(RF_FOUND)
add_library(srslte_radio STATIC radio.cc radio_null.cc channel_mapping.cc)
target_link_libraries(srslte_radio srslte_rf srslte_common)
INSTALL(TARGETS srslte_radio DESTINATION ${LIBRARY_DIR})
endif(RF_FOUND)
add_subdirectory(test)

@ -30,3 +30,4 @@ find_package(Threads REQUIRED)
add_library(srslog STATIC ${SOURCES})
target_link_libraries(srslog fmt "${CMAKE_THREAD_LIBS_INIT}")
INSTALL(TARGETS srslog DESTINATION ${LIBRARY_DIR})

@ -35,3 +35,4 @@ endif(ENABLE_5GNR)
add_library(srslte_upper STATIC ${SOURCES})
target_link_libraries(srslte_upper srslte_common srslte_asn1)
INSTALL(TARGETS srslte_upper DESTINATION ${LIBRARY_DIR})
Loading…
Cancel
Save