From 00a8007dc3ea26f6a553f038df12c9cbe684d836 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 27 Jan 2013 20:50:38 +0000 Subject: [PATCH] Adding Mac OS X support. Tested in Mountain Lion. git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@333 64b25241-fba3-4117-9849-534c7e92360d --- CMakeLists.txt | 49 ++++++++++++++++++- conf/gnss-sdr.conf | 2 +- .../acquisition/adapters/CMakeLists.txt | 2 +- .../gnuradio_blocks/CMakeLists.txt | 2 +- .../data_type_adapter/adapters/CMakeLists.txt | 2 +- .../input_filter/adapters/CMakeLists.txt | 2 +- .../signal_source/adapters/CMakeLists.txt | 2 +- .../tracking/gnuradio_blocks/CMakeLists.txt | 2 +- src/algorithms/tracking/libs/CMakeLists.txt | 2 +- src/core/receiver/CMakeLists.txt | 2 +- 10 files changed, 56 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c60be8b45..b685a1073 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,12 +55,16 @@ file(RELATIVE_PATH RELATIVE_CMAKE_CALL ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRE ######################################################################## include(ExternalProject) +set(OS_IS_MACOSX "") +set(OS_IS_LINUX "") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(OperatingSystem "Linux") + set(OS_IS_LINUX TRUE) endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(OperatingSystem "Mac OS X") + set(OS_IS_MACOSX TRUE) endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") @@ -119,11 +123,45 @@ if(NOT GNURADIO_CORE_FOUND) message(FATAL_ERROR "Please install GNU Radio and all its dependencies. Visit http://gnuradio.org") endif(NOT GNURADIO_CORE_FOUND) +find_library( + GNURADIO_CORE_LIBRARIES + NAMES gnuradio-core + PATHS usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 +) + +find_library( + GR_FILTER_LIBRARIES + NAMES gnuradio-filter + PATHS usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 +) +find_library( + GR_FFT_LIBRARIES + NAMES gnuradio-fft + PATHS usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 +) +find_library( + GR_BLOCKS_LIBRARIES + NAMES gnuradio-blocks + PATHS usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 +) + find_package(Gruel) if(NOT GRUEL_FOUND) message(FATAL_ERROR "Gruel required to build gnss-sdr") endif() -link_libraries(gruel) +link_libraries(${GRUEL_LIBRARIES}) include_directories(${GRUEL_INCLUDE_DIRS}) find_package(UHD) @@ -140,7 +178,14 @@ find_package(Volk) if(NOT VOLK_FOUND) message(FATAL_ERROR "Volk required to build gnss-sdr") endif() - +find_library( + VOLK_LIBRARIES + NAMES volk + PATHS usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 +) ################################################################################ # Boost - http://www.boost.org diff --git a/conf/gnss-sdr.conf b/conf/gnss-sdr.conf index a1c23c334..88d060476 100644 --- a/conf/gnss-sdr.conf +++ b/conf/gnss-sdr.conf @@ -17,7 +17,7 @@ ControlThread.wait_for_flowgraph=false SignalSource.implementation=File_Signal_Source ;#filename: path to file with the captured GNSS signal samples to be processed -SignalSource.filename=/media/DATALOGGER_/signals/Agilent GPS Generator/cap2/agilent_cap2.dat +SignalSource.filename=/Users/carlesfernandez/Desktop/captures/cap2/agilent_cap2.dat ;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version. SignalSource.item_type=gr_complex diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index 5d4919902..10839b0ac 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -33,4 +33,4 @@ include_directories( ) add_library(acq_adapters ${ACQ_ADAPTER_SOURCES}) -target_link_libraries(acq_adapters gnss_sp_libs acq_gr_blocks) \ No newline at end of file +target_link_libraries(acq_adapters gnss_sp_libs acq_gr_blocks ${GR_BLOCKS_LIBRARIES}) \ No newline at end of file diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index 083bb3c3c..ea056b773 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -31,4 +31,4 @@ include_directories( ) add_library(acq_gr_blocks ${ACQ_GR_BLOCKS_SOURCES}) -target_link_libraries(acq_gr_blocks gnuradio-fft volk) +target_link_libraries(acq_gr_blocks ${GR_FFT_LIBRARIES} ${VOLK_LIBRARIES}) diff --git a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt index 52472f13f..154bfbeb9 100644 --- a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt @@ -29,4 +29,4 @@ include_directories( ) add_library(datatype_adapters ${DATATYPE_ADAPTER_SOURCES}) -target_link_libraries(datatype_adapters gnuradio-blocks) \ No newline at end of file +target_link_libraries(datatype_adapters ${GR_FILTER_LIBRARIES} ${GR_BLOCKS_LIBRARIES}) \ No newline at end of file diff --git a/src/algorithms/input_filter/adapters/CMakeLists.txt b/src/algorithms/input_filter/adapters/CMakeLists.txt index b70d9806a..0616a2405 100644 --- a/src/algorithms/input_filter/adapters/CMakeLists.txt +++ b/src/algorithms/input_filter/adapters/CMakeLists.txt @@ -31,4 +31,4 @@ include_directories( ) add_library(input_filter_adapters ${INPUT_FILTER_ADAPTER_SOURCES}) -target_link_libraries(input_filter_adapters gnuradio-filter) \ No newline at end of file +target_link_libraries(input_filter_adapters ${GR_FILTER_LIBRARIES}) \ No newline at end of file diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 0573a5963..b5cea3757 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -87,4 +87,4 @@ include_directories( ) add_library(signal_source_adapters ${SIGNAL_SOURCE_ADAPTER_SOURCES}) -target_link_libraries(signal_source_adapters gnss_sp_libs ${Boost_LIBRARIES} uhd gnuradio-uhd ${OPT_LIBRARIES}) +target_link_libraries(signal_source_adapters gnss_sp_libs ${Boost_LIBRARIES} uhd ${GNURADIO_UHD_LIBRARIES} ${OPT_LIBRARIES}) diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index 6d3b1611d..6b2b0c7ea 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -37,4 +37,4 @@ include_directories( ) add_library(tracking_gr_blocks ${TRACKING_GR_BLOCKS_SOURCES}) -target_link_libraries(tracking_gr_blocks tracking_lib gnuradio-core gnss_sp_libs ${Boost_LINK_LIBRARIES} ) \ No newline at end of file +target_link_libraries(tracking_gr_blocks tracking_lib ${GNURADIO_CORE_LIBRARIES} gnss_sp_libs ${Boost_LINK_LIBRARIES} ) \ No newline at end of file diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index eacc5f603..d0940789d 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -39,4 +39,4 @@ include_directories( ) add_library(tracking_lib ${TRACKING_LIB_SOURCES}) -target_link_libraries(tracking_lib ${VOLK_LIBRARIES} gnuradio-core) \ No newline at end of file +target_link_libraries(tracking_lib ${VOLK_LIBRARIES} ${GNURADIO_CORE_LIBRARIES}) \ No newline at end of file diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 4ad3f311f..4f5ef90f4 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -57,4 +57,4 @@ include_directories( link_directories(${Boost_LIBRARY_DIR}) add_library(gnss_rx ${GNSS_RECEIVER_SOURCES}) -target_link_libraries(gnss_rx ${Boost_LIBRARIES} ${ARMADILLO_LIBRARIES} gnuradio-core gnss_system_parameters gnss_sp_libs signal_source_adapters datatype_adapters input_filter_adapters conditioner_adapters resampler_adapters acq_adapters tracking_lib tracking_adapters channel_adapters telemetry_decoder_adapters obs_adapters pvt_adapters pvt_lib out_adapters rx_core_lib) \ No newline at end of file +target_link_libraries(gnss_rx ${Boost_LIBRARIES} ${ARMADILLO_LIBRARIES} ${GNURADIO_CORE_LIBRARIES} gnss_system_parameters gnss_sp_libs signal_source_adapters datatype_adapters input_filter_adapters conditioner_adapters resampler_adapters acq_adapters tracking_lib tracking_adapters channel_adapters telemetry_decoder_adapters obs_adapters pvt_adapters pvt_lib out_adapters rx_core_lib) \ No newline at end of file