1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 20:50:33 +00:00
This commit is contained in:
Carles Fernandez 2019-02-07 20:53:04 +01:00
commit e86884bba4
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
6 changed files with 101 additions and 52 deletions

View File

@ -442,7 +442,15 @@ if(CMAKE_VERSION VERSION_LESS 3.1)
set_property(TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
set_property(TARGET Threads::Threads PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
include(GNUInstallDirs)
set_property(TARGET Threads::Threads PROPERTY IMPORTED_LOCATION /usr/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}pthread${CMAKE_SHARED_LIBRARY_SUFFIX})
# Fix bug in Debian 8.11
if(${LINUX_DISTRIBUTION} MATCHES "Debian")
if(${LINUX_VER} VERSION_LESS 8.12)
if(ARCH_64BITS)
set(FIX_PTHREADS_LOCATION "x86_64-linux-gnu/")
endif()
endif()
endif()
set_property(TARGET Threads::Threads PROPERTY IMPORTED_LOCATION /usr/${CMAKE_INSTALL_LIBDIR}/${FIX_PTHREADS_LOCATION}${CMAKE_FIND_LIBRARY_PREFIXES}pthread${CMAKE_SHARED_LIBRARY_SUFFIX})
else()
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
if(CMAKE_CROSSCOMPILING)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@ -33,6 +33,12 @@
# GPERFTOOLS_FOUND System has Gperftools libs/headers
# GPERFTOOLS_LIBRARIES The Gperftools libraries (tcmalloc & profiler)
# GPERFTOOLS_INCLUDE_DIR The location of Gperftools headers
#
# Provides the following imported targets:
# Gperftools::tcmalloc
# Gperftools::profiler
# Gperftools::gperftools
#
find_library(GPERFTOOLS_TCMALLOC
NAMES tcmalloc
@ -41,6 +47,8 @@ find_library(GPERFTOOLS_TCMALLOC
$ENV{GPERFTOOLS_ROOT}/lib
${GPERFTOOLS_ROOT}/lib64
$ENV{GPERFTOOLS_ROOT}/lib64
/usr/lib
/usr/lib64
)
find_library(GPERFTOOLS_PROFILER
@ -50,6 +58,8 @@ find_library(GPERFTOOLS_PROFILER
$ENV{GPERFTOOLS_ROOT}/lib
${GPERFTOOLS_ROOT}/lib64
$ENV{GPERFTOOLS_ROOT}/lib64
/usr/lib
/usr/lib64
)
find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER
@ -59,6 +69,8 @@ find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER
$ENV{GPERFTOOLS_ROOT}/lib
${GPERFTOOLS_ROOT}/lib64
$ENV{GPERFTOOLS_ROOT}/lib64
/usr/lib
/usr/lib64
)
find_path(GPERFTOOLS_INCLUDE_DIR
@ -66,6 +78,7 @@ find_path(GPERFTOOLS_INCLUDE_DIR
HINTS ${Gperftools_ROOT_DIR}/include
${GPERFTOOLS_ROOT}/include
$ENV{GPERFTOOLS_ROOT}/include
/usr/include
)
set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER})
@ -76,10 +89,42 @@ find_package_handle_standard_args(
DEFAULT_MSG
GPERFTOOLS_LIBRARIES
GPERFTOOLS_INCLUDE_DIR
GPERFTOOLS_TCMALLOC
GPERFTOOLS_PROFILER
)
if(GPERFTOOLS_FOUND AND NOT TARGET Gperftools::tcmalloc)
add_library(Gperftools::tcmalloc SHARED IMPORTED)
set_target_properties(Gperftools::tcmalloc PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GPERFTOOLS_TCMALLOC}"
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${GPERFTOOLS_TCMALLOC}"
)
endif()
if(GPERFTOOLS_FOUND AND NOT TARGET Gperftools::profiler)
add_library(Gperftools::profiler SHARED IMPORTED)
set_target_properties(Gperftools::profiler PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GPERFTOOLS_PROFILER}"
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${GPERFTOOLS_PROFILER}"
)
endif()
if(GPERFTOOLS_FOUND AND NOT TARGET Gperftools::gperftools)
add_library(Gperftools::gperftools SHARED IMPORTED)
set_target_properties(Gperftools::gperftools PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GPERFTOOLS_TCMALLOC_AND_PROFILER}"
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${GPERFTOOLS_TCMALLOC_AND_PROFILER}"
)
endif()
mark_as_advanced(
Gperftools_ROOT_DIR
GPERFTOOLS_TCMALLOC
GPERFTOOLS_PROFILER
GPERFTOOLS_TCMALLOC_AND_PROFILER

View File

@ -26,10 +26,6 @@ if(ENABLE_CUDA)
${OPT_TRACKING_ADAPTERS_HEADERS}
gps_l1_ca_dll_pll_tracking_gpu.h
)
set(OPT_TRACKING_INCLUDE_DIRS
${OPT_TRACKING_INCLUDE_DIRS}
${CUDA_INCLUDE_DIRS}
)
endif()
if(ENABLE_FPGA)
@ -104,10 +100,16 @@ target_link_libraries(tracking_adapters
gnss_sdr_flags
)
target_include_directories(tracking_adapters
if(ENABLE_CUDA)
target_link_libraries(tracking_adapters
PUBLIC
${OPT_TRACKING_INCLUDE_DIRS}
)
${CUDA_LIBRARIES}
)
target_include_directories(tracking_adapters
PUBLIC
${CUDA_INCLUDE_DIRS}
)
endif()
set_property(TARGET tracking_adapters
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES

View File

@ -25,14 +25,6 @@ if(ENABLE_CUDA)
${OPT_TRACKING_BLOCKS_HEADERS}
gps_l1_ca_dll_pll_tracking_gpu_cc.h
)
set(OPT_TRACKING_INCLUDES
${OPT_TRACKING_INCLUDES}
${CUDA_INCLUDE_DIRS}
)
set(OPT_TRACKING_LIBRARIES
${OPT_TRACKING_LIBRARIES}
${CUDA_LIBRARIES}
)
endif()
if(ENABLE_FPGA)
@ -91,20 +83,25 @@ add_library(tracking_gr_blocks
target_link_libraries(tracking_gr_blocks
PUBLIC
Boost::boost
tracking_lib
Gnuradio::blocks
Matio::matio
Volkgnsssdr::volkgnsssdr
gnss_sdr_flags
gnss_sp_libs
gnss_rx
Matio::matio
${OPT_TRACKING_LIBRARIES}
tracking_lib
)
target_include_directories(tracking_gr_blocks
if(ENABLE_CUDA)
target_link_libraries(tracking_gr_blocks
PUBLIC
${OPT_TRACKING_INCLUDES}
)
${CUDA_LIBRARIES}
)
target_include_directories(tracking_gr_blocks
PUBLIC
${CUDA_INCLUDE_DIRS}
)
endif()
set_property(TARGET tracking_gr_blocks
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES

View File

@ -30,13 +30,13 @@ target_link_libraries(gnss-sdr
gnss_sdr_flags
)
target_compile_definitions(gnss-sdr PRIVATE -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
PUBLIC
@ -53,12 +53,8 @@ if(ENABLE_GPERFTOOLS)
if(GPERFTOOLS_FOUND)
target_link_libraries(gnss-sdr
PUBLIC
${GPERFTOOLS_PROFILER}
${GPERFTOOLS_TCMALLOC}
)
target_include_directories(gnss-sdr
PRIVATE
${GPERFTOOLS_INCLUDE_DIR}
Gperftools::profiler
Gperftools::tcmalloc
)
endif()
endif()

View File

@ -151,23 +151,8 @@ endif()
################################################################################
# Optional libraries
# Definitions
################################################################################
set(GNSS_SDR_TEST_OPTIONAL_LIBS "")
set(GNSS_SDR_TEST_OPTIONAL_HEADERS "")
if(ENABLE_CUDA)
set(GNSS_SDR_TEST_OPTIONAL_HEADERS ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ${CUDA_INCLUDE_DIRS})
set(GNSS_SDR_TEST_OPTIONAL_LIBS ${GNSS_SDR_TEST_OPTIONAL_LIBS} ${CUDA_LIBRARIES})
endif()
if(ENABLE_GPERFTOOLS)
if(GPERFTOOLS_FOUND)
set(GNSS_SDR_TEST_OPTIONAL_LIBS "${GNSS_SDR_TEST_OPTIONAL_LIBS};${GPERFTOOLS_LIBRARIES}")
set(GNSS_SDR_TEST_OPTIONAL_HEADERS "${GNSS_SDR_TEST_OPTIONAL_HEADERS};${GPERFTOOLS_INCLUDE_DIR}")
endif()
endif()
if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4")
add_definitions(-DGR_GREATER_38=1)
@ -348,7 +333,6 @@ endif()
set(LIST_INCLUDE_DIRS
${CMAKE_SOURCE_DIR}/src/tests/common-files
${GNSS_SDR_TEST_OPTIONAL_HEADERS}
)
include_directories(${LIST_INCLUDE_DIRS})
@ -395,7 +379,6 @@ if(ENABLE_UNIT_TESTING)
pvt_adapters
signal_processing_testing_lib
system_testing_lib
${GNSS_SDR_TEST_OPTIONAL_LIBS}
)
if(ENABLE_UNIT_TESTING_EXTRA)
target_link_libraries(run_tests PUBLIC Gpstk::gpstk)
@ -410,6 +393,24 @@ if(ENABLE_UNIT_TESTING)
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:run_tests>
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:run_tests>)
endif()
if(ENABLE_GPERFTOOLS)
if(GPERFTOOLS_FOUND)
target_link_libraries(run_tests
PUBLIC
Gperftools::gperftools
)
endif()
endif()
if(ENABLE_CUDA)
target_link_libraries(run_tests
PUBLIC
${CUDA_LIBRARIES}
)
target_include_directories(run_tests
PUBLIC
${CUDA_INCLUDE_DIRS}
)
endif()
endif()
if(ENABLE_FPGA)