diff --git a/CMakeLists.txt b/CMakeLists.txt index 47b78e114..2e5cdfeab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -437,7 +437,7 @@ endif() ################################################################################ if(CMAKE_VERSION VERSION_LESS 3.1) find_package(Threads REQUIRED) - set(THREAD_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) + add_library(Threads::Threads ALIAS ${CMAKE_THREAD_LIBS_INIT}) else() set(CMAKE_THREAD_PREFER_PTHREAD TRUE) if(CMAKE_CROSSCOMPILING) @@ -446,7 +446,6 @@ else() set(THREADS_PREFER_PTHREAD_FLAG TRUE) endif() find_package(Threads REQUIRED) - set(THREAD_LIBRARIES Threads::Threads) endif() @@ -1101,7 +1100,6 @@ endif() if(NOT ENABLE_LOG) message(STATUS "Logging is not enabled") - target_compile_definitions(Glog::glog PUBLIC -DGOOGLE_STRIP_LOG=1) endif() diff --git a/README.md b/README.md index 4b5645a2c..7398372ba 100644 --- a/README.md +++ b/README.md @@ -573,7 +573,7 @@ First, install [Homebrew](https://brew.sh/). Paste this in a terminal prompt: $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ~~~~~~ -The script explains what it will do and then pauses before it does it. There are more installation options [here](https://docs.brew.sh/Installation.html). +The script explains what it will do, and then it pauses before doing it. There are more installation options [here](https://docs.brew.sh/Installation.html). Install pip: @@ -584,17 +584,26 @@ $ sudo easy_install pip Install the required dependencies: ~~~~~~ -$ brew tap homebrew/science -$ brew install cmake hdf5 arpack superlu -$ brew install armadillo -$ brew install glog gflags gnutls +$ brew install cmake +$ brew install hdf5 arpack superlu armadillo +$ brew install glog gflags $ brew install gnuradio $ brew install libmatio +$ brew install log4cpp $ brew install pugixml $ pip install mako $ pip install six +$ brew install openssl ~~~~~~ +In the last step, Homebrew installs OpenSSL but it does not link it into `/usr/local`. Thus, you must manually link it instead: + +~~~~~~ +$ ln -s /usr/local/opt/openssl/include/openssl /usr/local/include +$ ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/ +~~~~~~ + + #### Build GNSS-SDR Finally, you are ready to clone the GNSS-SDR repository, configure and build the software: diff --git a/cmake/Modules/FindPUGIXML.cmake b/cmake/Modules/FindPUGIXML.cmake index 3232285c3..3d8ce2bdc 100644 --- a/cmake/Modules/FindPUGIXML.cmake +++ b/cmake/Modules/FindPUGIXML.cmake @@ -32,9 +32,12 @@ find_path(PUGIXML_INCLUDE_DIR PATHS ${PUGIXML_HOME}/include /usr/include /usr/local/include + /usr/local/include/pugixml-1.9 /opt/local/include ${PUGIXML_ROOT}/include $ENV{PUGIXML_ROOT}/include + ${PUGIXML_ROOT}/include/pugixml-1.9 + $ENV{PUGIXML_ROOT}/include/pugixml-1.9 ) find_library(PUGIXML_LIBRARY @@ -51,6 +54,7 @@ find_library(PUGIXML_LIBRARY /usr/lib/powerpc64le-linux-gnu /usr/lib/s390x-linux-gnu /usr/local/lib + /usr/local/lib/pugixml-1.9 /opt/local/lib /usr/lib /usr/lib64 @@ -59,6 +63,10 @@ find_library(PUGIXML_LIBRARY $ENV{PUGIXML_ROOT}/lib ${PUGIXML_ROOT}/lib64 $ENV{PUGIXML_ROOT}/lib64 + ${PUGIXML_ROOT}/lib/pugixml-1.9 + $ENV{PUGIXML_ROOT}/lib/pugixml-1.9 + ${PUGIXML_ROOT}/lib64/pugixml-1.9 + $ENV{PUGIXML_ROOT}/lib64/pugixml-1.9 ) # Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. diff --git a/cmake/Modules/FindTELEORBIT.cmake b/cmake/Modules/FindTELEORBIT.cmake index b71473b02..bdb3d861c 100644 --- a/cmake/Modules/FindTELEORBIT.cmake +++ b/cmake/Modules/FindTELEORBIT.cmake @@ -48,12 +48,12 @@ find_library(TELEORBIT_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) -if(TELEORBIT_FOUND AND NOT TARGET Gnuradio:teleorbit) - add_library(Gnuradio:teleorbit SHARED IMPORTED) - set_target_properties(Gnuradio:teleorbit PROPERTIES +if(TELEORBIT_FOUND AND NOT TARGET Gnuradio::teleorbit) + add_library(Gnuradio::teleorbit SHARED IMPORTED) + set_target_properties(Gnuradio::teleorbit PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" IMPORTED_LOCATION "${TELEORBIT_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${TELEORBIT_INCLUDE_DIRS};${TELEORBIT_INCLUDE_DIR}/teleorbit" + INTERFACE_INCLUDE_DIRECTORIES "${TELEORBIT_INCLUDE_DIRS};${TELEORBIT_INCLUDE_DIRS}/teleorbit" INTERFACE_LINK_LIBRARIES "${TELEORBIT_LIBRARIES}" ) endif() diff --git a/docs/doxygen/images/GeneralBlockDiagram.png b/docs/doxygen/images/GeneralBlockDiagram.png index b208624ef..51e433ec0 100644 Binary files a/docs/doxygen/images/GeneralBlockDiagram.png and b/docs/doxygen/images/GeneralBlockDiagram.png differ diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index b154cb855..603890a73 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -17,12 +17,6 @@ # -if(OS_IS_MACOSX) - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(MAC_LIBRARIES "-lc++") - endif() -endif() - add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) target_link_libraries(gnss-sdr @@ -33,11 +27,15 @@ target_link_libraries(gnss-sdr Glog::glog gnss_rx gnss_sdr_flags - ${THREAD_LIBRARIES} - ${MAC_LIBRARIES} + Threads::Threads ) -target_compile_definitions(gnss-sdr PUBLIC -DGNSS_SDR_VERSION="${VERSION}") +# Disable internal logging +if(NOT ENABLE_LOG) + target_compile_definitions(gnss-sdr PRIVATE -DGOOGLE_STRIP_LOG=1) +endif() + +target_compile_definitions(gnss-sdr PRIVATE -DGNSS_SDR_VERSION="${VERSION}") if(ENABLE_CUDA) target_link_libraries(gnss-sdr @@ -65,6 +63,15 @@ if(ENABLE_GPERFTOOLS) endif() endif() +if(OS_IS_MACOSX) + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_link_libraries(gnss-sdr + PUBLIC + "-lc++" + ) + endif() +endif() + add_custom_command(TARGET gnss-sdr POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$ diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index b22ee1314..eaff83884 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -96,7 +96,7 @@ if(NOT ${GTEST_DIR_LOCAL}) set(GTEST_LIBRARIES ${binary_dir}/googletest/${ADD_DEBUG}${CMAKE_FIND_LIBRARY_PREFIXES}gtest${FINAL_D}${CMAKE_STATIC_LIBRARY_SUFFIX} ${binary_dir}/googletest/${ADD_DEBUG}${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${FINAL_D}${CMAKE_STATIC_LIBRARY_SUFFIX} - ${THREAD_LIBRARIES}) + Threads::Threads) set(GTEST_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest") else() if(GTEST_INCLUDE_DIRS) @@ -110,7 +110,7 @@ else() add_library(gtest ${GTEST_DIR}/src/gtest-all.cc ${GTEST_DIR}/src/gtest_main.cc) set(GTEST_LIBRARIES gtest) endif() - target_link_libraries(gtest PUBLIC ${THREAD_LIBRARIES}) + target_link_libraries(gtest PUBLIC Threads::Threads) endif() @@ -459,7 +459,7 @@ if(ENABLE_SYSTEM_TESTING) add_definitions(-DHOST_SYSTEM="${HOST_SYSTEM}") #### TTFF - set(OPT_LIBS_ ${Boost_LIBRARIES} ${THREAD_LIBRARIES} Gflags::gflags Glog::glog + set(OPT_LIBS_ ${Boost_LIBRARIES} Threads::Threads Gflags::gflags Glog::glog Gnuradio::runtime ${GTEST_LIBRARIES} Gnuradio::blocks Gnuradio::filter Gnuradio::analog gnss_sp_libs @@ -468,7 +468,7 @@ if(ENABLE_SYSTEM_TESTING) if(ENABLE_SYSTEM_TESTING_EXTRA) #### POSITION_TEST - set(OPT_LIBS_ ${Boost_LIBRARIES} ${THREAD_LIBRARIES} Gflags::gflags Glog::glog + set(OPT_LIBS_ ${Boost_LIBRARIES} Threads::Threads Gflags::gflags Glog::glog ${GTEST_LIBRARIES} Gnuradio::runtime Gnuradio::blocks Gnuradio::filter Gnuradio::analog Matio::matio Volkgnsssdr::volkgnsssdr diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index f96f0158c..2b39b6837 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -26,7 +26,7 @@ source_group(Headers FILES ${FRONT_END_CAL_HEADERS}) target_link_libraries(front_end_cal_lib PUBLIC Armadillo::armadillo - ${THREAD_LIBRARIES} + Threads::Threads acq_adapters Volkgnsssdr::volkgnsssdr ${ORC_LIBRARIES} rx_core_lib @@ -35,6 +35,7 @@ target_link_libraries(front_end_cal_lib channel_fsm gnss_sp_libs PRIVATE + Gflags::gflags Glog::glog Gnuradio::blocks Gnuradio::runtime