diff --git a/srslte/CMakeLists.txt b/srslte/CMakeLists.txt index 354e88281..87779de46 100644 --- a/srslte/CMakeLists.txt +++ b/srslte/CMakeLists.txt @@ -42,14 +42,19 @@ add_custom_target (add_srslte_headers SOURCES ${HEADERS_ALL}) ######################################################################## # Find Dependencies ######################################################################## -find_package(UHD) -find_package(bladeRF) +find_package(FFTW3F REQUIRED) +if(FFTW3F_FOUND) + include_directories(${FFTW3F_INCLUDE_DIRS}) + link_directories(${FFTW3F_LIBRARY_DIRS}) +endif(FFTW3F_FOUND) +find_package(UHD) if(UHD_FOUND) include_directories(${UHD_INCLUDE_DIRS}) link_directories(${UHD_LIBRARY_DIRS}) endif(UHD_FOUND) +find_package(bladeRF) if(BLADERF_FOUND) include_directories(${BLADERF_INCLUDE_DIRS}) link_directories(${BLADERF_LIBRARY_DIRS}) diff --git a/srslte/examples/CMakeLists.txt b/srslte/examples/CMakeLists.txt index 557083fd5..b8357fd05 100644 --- a/srslte/examples/CMakeLists.txt +++ b/srslte/examples/CMakeLists.txt @@ -37,8 +37,7 @@ add_executable(pdsch_enodeb pdsch_enodeb.c) target_link_libraries(pdsch_enodeb srslte pthread) if(RF_FOUND) - target_link_libraries(pdsch_ue srslte_rf) - target_link_libraries(pdsch_enodeb srslte_rf) + else(RF_FOUND) add_definitions(-DDISABLE_RF) endif(RF_FOUND) @@ -60,19 +59,19 @@ endif(SRSGUI_FOUND) if(RF_FOUND) add_executable(cell_search cell_search.c) - target_link_libraries(cell_search srslte srslte_rf) + target_link_libraries(cell_search srslte) add_executable(cell_measurement cell_measurement.c) - target_link_libraries(cell_measurement srslte srslte_rf) + target_link_libraries(cell_measurement srslte) add_executable(usrp_capture usrp_capture.c) - target_link_libraries(usrp_capture srslte srslte_rf) + target_link_libraries(usrp_capture srslte) add_executable(usrp_capture_sync usrp_capture_sync.c) - target_link_libraries(usrp_capture_sync srslte srslte_rf) + target_link_libraries(usrp_capture_sync srslte) add_executable(usrp_txrx usrp_txrx.c) - target_link_libraries(usrp_txrx srslte srslte_rf) + target_link_libraries(usrp_txrx srslte) message(STATUS " examples will be installed.") diff --git a/srslte/examples/tutorial_examples/CMakeLists.txt b/srslte/examples/tutorial_examples/CMakeLists.txt index a6b92f1f9..04248ef9c 100644 --- a/srslte/examples/tutorial_examples/CMakeLists.txt +++ b/srslte/examples/tutorial_examples/CMakeLists.txt @@ -26,10 +26,10 @@ if(SRSGUI_FOUND AND UHD_FOUND) add_executable(pss pss.c) - target_link_libraries(pss srslte ${SRSGUI_LIBRARIES} srslte_rf) + target_link_libraries(pss srslte ${SRSGUI_LIBRARIES}) add_executable(simple_tx simple_tx.c) - target_link_libraries(simple_tx srslte srslte_rf) + target_link_libraries(simple_tx srslte) endif(SRSGUI_FOUND AND UHD_FOUND) diff --git a/srslte/lib/CMakeLists.txt b/srslte/lib/CMakeLists.txt index 1c61c34d7..fddbd45ba 100644 --- a/srslte/lib/CMakeLists.txt +++ b/srslte/lib/CMakeLists.txt @@ -35,27 +35,38 @@ add_subdirectory(resampling) add_subdirectory(scrambling) add_subdirectory(ue) -add_library(srslte SHARED version.c) -target_link_libraries(srslte srslte_agc - srslte_ch_estimation - srslte_common - srslte_fec - srslte_mimo - srslte_phch - srslte_sync - srslte_utils - srslte_channel - srslte_dft - srslte_io - srslte_modem - srslte_resampling - srslte_scrambling - srslte_ue - srslte_rf - pthread) +add_library(srslte SHARED version.c + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ +) +target_link_libraries(srslte pthread m ${FFTW3F_LIBRARIES}) set_target_properties(srslte PROPERTIES VERSION ${SRSLTE_VERSION_MAJOR}.${SRSLTE_VERSION_MINOR}) +if(RF_FOUND) + if(UHD_FOUND) + target_link_libraries(srslte ${UHD_LIBRARIES}) + endif(UHD_FOUND) + + if(BLADERF_FOUND) + target_link_libraries(srslte ${BLADERF_LIBRARIES}) + endif(BLADERF_FOUND) +endif(RF_FOUND) + if(VOLK_FOUND) set_target_properties(srslte PROPERTIES COMPILE_DEFINITIONS "${VOLK_DEFINITIONS}") target_link_libraries(srslte ${VOLK_LIBRARIES}) diff --git a/srslte/lib/agc/CMakeLists.txt b/srslte/lib/agc/CMakeLists.txt index cef47f1ba..c97f5d5d2 100644 --- a/srslte/lib/agc/CMakeLists.txt +++ b/srslte/lib/agc/CMakeLists.txt @@ -19,4 +19,5 @@ # file(GLOB SOURCES "*.c") -add_library(srslte_agc ${SOURCES}) +add_library(srslte_agc OBJECT ${SOURCES}) +SRSLTE_SET_PIC(srslte_agc) diff --git a/srslte/lib/ch_estimation/CMakeLists.txt b/srslte/lib/ch_estimation/CMakeLists.txt index 9991720ff..24dbeed36 100644 --- a/srslte/lib/ch_estimation/CMakeLists.txt +++ b/srslte/lib/ch_estimation/CMakeLists.txt @@ -19,9 +19,6 @@ # file(GLOB SOURCES "*.c") -add_library(srslte_ch_estimation ${SOURCES}) -target_link_libraries(srslte_ch_estimation srslte_common - srslte_resampling - srslte_utils - srslte_phch) +add_library(srslte_ch_estimation OBJECT ${SOURCES}) +SRSLTE_SET_PIC(srslte_ch_estimation) add_subdirectory(test) diff --git a/srslte/lib/channel/CMakeLists.txt b/srslte/lib/channel/CMakeLists.txt index f876f524b..a14a67c89 100644 --- a/srslte/lib/channel/CMakeLists.txt +++ b/srslte/lib/channel/CMakeLists.txt @@ -19,4 +19,5 @@ # file(GLOB SOURCES "*.c") -add_library(srslte_channel ${SOURCES}) +add_library(srslte_channel OBJECT ${SOURCES}) +SRSLTE_SET_PIC(srslte_channel) diff --git a/srslte/lib/common/CMakeLists.txt b/srslte/lib/common/CMakeLists.txt index fa6b96450..db4e6f49b 100644 --- a/srslte/lib/common/CMakeLists.txt +++ b/srslte/lib/common/CMakeLists.txt @@ -19,4 +19,5 @@ # file(GLOB SOURCES "*.c") -add_library(srslte_common ${SOURCES}) +add_library(srslte_common OBJECT ${SOURCES}) +SRSLTE_SET_PIC(srslte_common) diff --git a/srslte/lib/dft/CMakeLists.txt b/srslte/lib/dft/CMakeLists.txt index 7eb2f0ea8..036e802ee 100644 --- a/srslte/lib/dft/CMakeLists.txt +++ b/srslte/lib/dft/CMakeLists.txt @@ -18,18 +18,7 @@ # and at http://www.gnu.org/licenses/. # - - -find_package(FFTW3F REQUIRED) -if(FFTW3F_FOUND) - include_directories(${FFTW3F_INCLUDE_DIRS}) - link_directories(${FFTW3F_LIBRARY_DIRS}) -endif(FFTW3F_FOUND) - set(SRCS dft_fftw.c dft_precoding.c ofdm.c) -add_library(srslte_dft ${SRCS}) -target_link_libraries(srslte_dft srslte_utils - m - ${FFTW3F_LIBRARIES}) - +add_library(srslte_dft OBJECT ${SRCS}) +SRSLTE_SET_PIC(srslte_dft) add_subdirectory(test) diff --git a/srslte/lib/fec/CMakeLists.txt b/srslte/lib/fec/CMakeLists.txt index 7d73d6938..2543881e0 100644 --- a/srslte/lib/fec/CMakeLists.txt +++ b/srslte/lib/fec/CMakeLists.txt @@ -19,6 +19,6 @@ # file(GLOB SOURCES "*.c") -add_library(srslte_fec ${SOURCES}) -target_link_libraries(srslte_fec srslte_utils) +add_library(srslte_fec OBJECT ${SOURCES}) +SRSLTE_SET_PIC(srslte_fec) add_subdirectory(test) diff --git a/srslte/lib/io/CMakeLists.txt b/srslte/lib/io/CMakeLists.txt index 03dadbe50..b913ef941 100644 --- a/srslte/lib/io/CMakeLists.txt +++ b/srslte/lib/io/CMakeLists.txt @@ -19,4 +19,5 @@ # file(GLOB SOURCES "*.c") -add_library(srslte_io ${SOURCES}) +add_library(srslte_io OBJECT ${SOURCES}) +SRSLTE_SET_PIC(srslte_io) diff --git a/srslte/lib/mimo/CMakeLists.txt b/srslte/lib/mimo/CMakeLists.txt index 261f47964..92ea2470d 100644 --- a/srslte/lib/mimo/CMakeLists.txt +++ b/srslte/lib/mimo/CMakeLists.txt @@ -19,5 +19,6 @@ # file(GLOB SOURCES "*.c") -add_library(srslte_mimo ${SOURCES}) +add_library(srslte_mimo OBJECT ${SOURCES}) +SRSLTE_SET_PIC(srslte_mimo) add_subdirectory(test) diff --git a/srslte/lib/modem/CMakeLists.txt b/srslte/lib/modem/CMakeLists.txt index 94ec0754e..01d609913 100644 --- a/srslte/lib/modem/CMakeLists.txt +++ b/srslte/lib/modem/CMakeLists.txt @@ -19,5 +19,6 @@ # file(GLOB SOURCES "*.c") -add_library(srslte_modem ${SOURCES}) +add_library(srslte_modem OBJECT ${SOURCES}) +SRSLTE_SET_PIC(srslte_modem) add_subdirectory(test) diff --git a/srslte/lib/phch/CMakeLists.txt b/srslte/lib/phch/CMakeLists.txt index e203ee7ea..bc07d53d2 100644 --- a/srslte/lib/phch/CMakeLists.txt +++ b/srslte/lib/phch/CMakeLists.txt @@ -19,11 +19,6 @@ # file(GLOB SOURCES "*.c") -add_library(srslte_phch ${SOURCES}) -target_link_libraries(srslte_phch srslte_common - srslte_mimo - srslte_fec - srslte_modem - srslte_scrambling - srslte_ch_estimation) +add_library(srslte_phch OBJECT ${SOURCES}) +SRSLTE_SET_PIC(srslte_phch) add_subdirectory(test) diff --git a/srslte/lib/phch/test/CMakeLists.txt b/srslte/lib/phch/test/CMakeLists.txt index c9a7d140b..052373291 100644 --- a/srslte/lib/phch/test/CMakeLists.txt +++ b/srslte/lib/phch/test/CMakeLists.txt @@ -195,5 +195,5 @@ BuildMex(MEXNAME prach SOURCES prach_test_mex.c LIBRARIES srslte srslte_mex) if(UHD_FOUND) add_executable(prach_test_usrp prach_test_usrp.c) - target_link_libraries(prach_test_usrp srslte_rf srslte pthread) + target_link_libraries(prach_test_usrp srslte pthread) endif(UHD_FOUND) diff --git a/srslte/lib/resampling/CMakeLists.txt b/srslte/lib/resampling/CMakeLists.txt index bc99d620e..75b1b1e3c 100644 --- a/srslte/lib/resampling/CMakeLists.txt +++ b/srslte/lib/resampling/CMakeLists.txt @@ -19,5 +19,6 @@ # file(GLOB SOURCES "*.c") -add_library(srslte_resampling ${SOURCES}) +add_library(srslte_resampling OBJECT ${SOURCES}) +SRSLTE_SET_PIC(srslte_resampling) add_subdirectory(test) diff --git a/srslte/lib/rf/CMakeLists.txt b/srslte/lib/rf/CMakeLists.txt index 8c88918be..3b97dfecf 100644 --- a/srslte/lib/rf/CMakeLists.txt +++ b/srslte/lib/rf/CMakeLists.txt @@ -33,15 +33,6 @@ if(RF_FOUND) list(APPEND SOURCES_RF rf_blade_imp.c) endif (BLADERF_FOUND) - add_library(srslte_rf ${SOURCES_RF}) - target_link_libraries(srslte_rf pthread) - - if (UHD_FOUND) - target_link_libraries(srslte_rf ${UHD_LIBRARIES}) - endif (UHD_FOUND) - - if (BLADERF_FOUND) - target_link_libraries(srslte_rf ${BLADERF_LIBRARIES}) - endif (BLADERF_FOUND) - + add_library(srslte_rf OBJECT ${SOURCES_RF}) + SRSLTE_SET_PIC(srslte_rf) endif(RF_FOUND) diff --git a/srslte/lib/scrambling/CMakeLists.txt b/srslte/lib/scrambling/CMakeLists.txt index ff04a7dba..b0dc7452a 100644 --- a/srslte/lib/scrambling/CMakeLists.txt +++ b/srslte/lib/scrambling/CMakeLists.txt @@ -19,5 +19,6 @@ # file(GLOB SOURCES "*.c") -add_library(srslte_scrambling ${SOURCES}) +add_library(srslte_scrambling OBJECT ${SOURCES}) +SRSLTE_SET_PIC(srslte_scrambling) add_subdirectory(test) diff --git a/srslte/lib/sync/CMakeLists.txt b/srslte/lib/sync/CMakeLists.txt index a380ff651..2aff1e93e 100644 --- a/srslte/lib/sync/CMakeLists.txt +++ b/srslte/lib/sync/CMakeLists.txt @@ -19,6 +19,6 @@ # file(GLOB SOURCES "*.c") -add_library(srslte_sync ${SOURCES}) -target_link_libraries(srslte_sync srslte_common) +add_library(srslte_sync OBJECT ${SOURCES}) +SRSLTE_SET_PIC(srslte_sync) add_subdirectory(test) diff --git a/srslte/lib/sync/test/CMakeLists.txt b/srslte/lib/sync/test/CMakeLists.txt index a38c9c60b..c80cd8b84 100644 --- a/srslte/lib/sync/test/CMakeLists.txt +++ b/srslte/lib/sync/test/CMakeLists.txt @@ -33,7 +33,7 @@ endif(SRSGUI_FOUND) if(UHD_FOUND) add_executable(pss_usrp pss_usrp.c) - target_link_libraries(pss_usrp srslte srslte_rf) + target_link_libraries(pss_usrp srslte) if(SRSGUI_FOUND) target_link_libraries(pss_usrp ${SRSGUI_LIBRARIES}) else(SRSGUI_FOUND) diff --git a/srslte/lib/ue/CMakeLists.txt b/srslte/lib/ue/CMakeLists.txt index c3c535cae..fba91255d 100644 --- a/srslte/lib/ue/CMakeLists.txt +++ b/srslte/lib/ue/CMakeLists.txt @@ -19,9 +19,5 @@ # file(GLOB SOURCES "*.c") -add_library(srslte_ue ${SOURCES}) -target_link_libraries(srslte_ue srslte_io - srslte_sync - srslte_dft - srslte_ch_estimation - srslte_agc) +add_library(srslte_ue OBJECT ${SOURCES}) +SRSLTE_SET_PIC(srslte_ue) diff --git a/srslte/lib/utils/CMakeLists.txt b/srslte/lib/utils/CMakeLists.txt index b6fd05bdd..f6edf3661 100644 --- a/srslte/lib/utils/CMakeLists.txt +++ b/srslte/lib/utils/CMakeLists.txt @@ -19,6 +19,6 @@ # file(GLOB SOURCES "*.c") -add_library(srslte_utils ${SOURCES}) -target_link_libraries(srslte_utils srslte_dft) +add_library(srslte_utils OBJECT ${SOURCES}) +SRSLTE_SET_PIC(srslte_utils) add_subdirectory(test)