mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-02-22 14:00:13 +00:00
Clean CMake scripts
This commit is contained in:
parent
d50d7d7b57
commit
d40094e6e2
@ -22,62 +22,42 @@ list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS)
|
||||
# Optional drivers
|
||||
|
||||
if(ENABLE_RAW_UDP)
|
||||
# - Try to find libpcap include dirs and libraries
|
||||
#
|
||||
# Usage of this module as follows:
|
||||
#
|
||||
# find_package(PCAP)
|
||||
#
|
||||
# Variables used by this module, they can change the default behaviour and need
|
||||
# to be set before calling find_package:
|
||||
#
|
||||
# PCAP_ROOT_DIR Set this variable to the root installation of
|
||||
# libpcap if the module has problems finding the
|
||||
# proper installation path.
|
||||
#
|
||||
# Variables defined by this module:
|
||||
#
|
||||
# PCAP_FOUND System has libpcap, include and library dirs found
|
||||
# PCAP_INCLUDE_DIR The libpcap include directories.
|
||||
# PCAP_LIBRARY The libpcap library (possibly includes a thread
|
||||
# library e.g. required by pf_ring's libpcap)
|
||||
# HAVE_PF_RING If a found version of libpcap supports PF_RING
|
||||
find_package(PCAP)
|
||||
if(NOT PCAP_FOUND)
|
||||
message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)")
|
||||
endif()
|
||||
get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS})
|
||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc)
|
||||
find_package(PCAP)
|
||||
if(NOT PCAP_FOUND)
|
||||
message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)")
|
||||
endif(NOT PCAP_FOUND)
|
||||
get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS})
|
||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc)
|
||||
endif(ENABLE_RAW_UDP)
|
||||
|
||||
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
||||
find_package(Griio REQUIRED)
|
||||
if(NOT IIO_FOUND)
|
||||
message(STATUS "gnuradio-iio not found, its installation is required.")
|
||||
message(STATUS "Please build and install the following projects:")
|
||||
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
|
||||
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
|
||||
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
|
||||
message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.")
|
||||
endif(NOT IIO_FOUND)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS})
|
||||
find_package(Griio REQUIRED)
|
||||
if(NOT IIO_FOUND)
|
||||
message(STATUS "gnuradio-iio not found, its installation is required.")
|
||||
message(STATUS "Please build and install the following projects:")
|
||||
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
|
||||
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
|
||||
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
|
||||
message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.")
|
||||
endif(NOT IIO_FOUND)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS})
|
||||
endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
||||
|
||||
if(ENABLE_AD9361)
|
||||
find_package(libiio REQUIRED)
|
||||
if(NOT LIBIIO_FOUND)
|
||||
message(STATUS "libiio not found, its installation is required.")
|
||||
message(STATUS "Please build and install the following projects:")
|
||||
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
|
||||
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
|
||||
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
|
||||
message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled.")
|
||||
endif(NOT LIBIIO_FOUND)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS})
|
||||
find_package(libiio REQUIRED)
|
||||
if(NOT LIBIIO_FOUND)
|
||||
message(STATUS "libiio not found, its installation is required.")
|
||||
message(STATUS "Please build and install the following projects:")
|
||||
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
|
||||
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
|
||||
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
|
||||
message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled.")
|
||||
endif(NOT LIBIIO_FOUND)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS})
|
||||
endif(ENABLE_AD9361)
|
||||
|
||||
|
||||
|
@ -18,34 +18,14 @@
|
||||
|
||||
|
||||
if(ENABLE_RAW_UDP)
|
||||
# - Try to find libpcap include dirs and libraries
|
||||
#
|
||||
# Usage of this module as follows:
|
||||
#
|
||||
# find_package(PCAP)
|
||||
#
|
||||
# Variables used by this module, they can change the default behaviour and need
|
||||
# to be set before calling find_package:
|
||||
#
|
||||
# PCAP_ROOT_DIR Set this variable to the root installation of
|
||||
# libpcap if the module has problems finding the
|
||||
# proper installation path.
|
||||
#
|
||||
# Variables defined by this module:
|
||||
#
|
||||
# PCAP_FOUND System has libpcap, include and library dirs found
|
||||
# PCAP_INCLUDE_DIR The libpcap include directories.
|
||||
# PCAP_LIBRARY The libpcap library (possibly includes a thread
|
||||
# library e.g. required by pf_ring's libpcap)
|
||||
# HAVE_PF_RING If a found version of libpcap supports PF_RING
|
||||
find_package(PCAP)
|
||||
if(NOT PCAP_FOUND)
|
||||
message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)")
|
||||
endif()
|
||||
get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS})
|
||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gr_complex_ip_packet_source.cc)
|
||||
find_package(PCAP)
|
||||
if(NOT PCAP_FOUND)
|
||||
message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)")
|
||||
endif(NOT PCAP_FOUND)
|
||||
get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS})
|
||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gr_complex_ip_packet_source.cc)
|
||||
endif(ENABLE_RAW_UDP)
|
||||
|
||||
set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES
|
||||
|
@ -20,29 +20,29 @@ set(SYSTEM_PARAMETERS_SOURCES
|
||||
gnss_satellite.cc
|
||||
gnss_signal.cc
|
||||
gps_navigation_message.cc
|
||||
gps_ephemeris.cc
|
||||
gps_iono.cc
|
||||
gps_almanac.cc
|
||||
gps_utc_model.cc
|
||||
gps_acq_assist.cc
|
||||
gps_ref_time.cc
|
||||
gps_ref_location.cc
|
||||
galileo_utc_model.cc
|
||||
galileo_ephemeris.cc
|
||||
galileo_almanac.cc
|
||||
galileo_iono.cc
|
||||
galileo_navigation_message.cc
|
||||
sbas_ephemeris.cc
|
||||
galileo_fnav_message.cc
|
||||
gps_cnav_ephemeris.cc
|
||||
gps_cnav_navigation_message.cc
|
||||
gps_cnav_iono.cc
|
||||
gps_cnav_utc_model.cc
|
||||
rtcm.cc
|
||||
glonass_gnav_ephemeris.cc
|
||||
glonass_gnav_almanac.cc
|
||||
glonass_gnav_utc_model.cc
|
||||
glonass_gnav_navigation_message.cc
|
||||
gps_ephemeris.cc
|
||||
gps_iono.cc
|
||||
gps_almanac.cc
|
||||
gps_utc_model.cc
|
||||
gps_acq_assist.cc
|
||||
gps_ref_time.cc
|
||||
gps_ref_location.cc
|
||||
galileo_utc_model.cc
|
||||
galileo_ephemeris.cc
|
||||
galileo_almanac.cc
|
||||
galileo_iono.cc
|
||||
galileo_navigation_message.cc
|
||||
sbas_ephemeris.cc
|
||||
galileo_fnav_message.cc
|
||||
gps_cnav_ephemeris.cc
|
||||
gps_cnav_navigation_message.cc
|
||||
gps_cnav_iono.cc
|
||||
gps_cnav_utc_model.cc
|
||||
rtcm.cc
|
||||
glonass_gnav_ephemeris.cc
|
||||
glonass_gnav_almanac.cc
|
||||
glonass_gnav_utc_model.cc
|
||||
glonass_gnav_navigation_message.cc
|
||||
)
|
||||
|
||||
|
||||
|
@ -16,13 +16,11 @@
|
||||
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
set(GNSS_SDR_OPTIONAL_LIBS "")
|
||||
set(GNSS_SDR_OPTIONAL_HEADERS "")
|
||||
|
||||
if(ENABLE_GPERFTOOLS)
|
||||
if(GPERFTOOLS_FOUND)
|
||||
#set(GNSS_SDR_OPTIONAL_LIBS "${GNSS_SDR_OPTIONAL_LIBS};${GPERFTOOLS_LIBRARIES}")
|
||||
set(GNSS_SDR_OPTIONAL_LIBS "${GNSS_SDR_OPTIONAL_LIBS};${GPERFTOOLS_PROFILER};${GPERFTOOLS_TCMALLOC}")
|
||||
set(GNSS_SDR_OPTIONAL_HEADERS "${GNSS_SDR_OPTIONAL_HEADERS};${GPERFTOOLS_INCLUDE_DIR}")
|
||||
endif(GPERFTOOLS_FOUND)
|
||||
@ -48,7 +46,6 @@ if(ORC_FOUND)
|
||||
set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${ORC_INCLUDE_DIRS})
|
||||
endif(ORC_FOUND)
|
||||
|
||||
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
@ -76,13 +73,11 @@ if(OS_IS_MACOSX)
|
||||
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
endif(OS_IS_MACOSX)
|
||||
|
||||
|
||||
add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
|
||||
|
||||
add_custom_command(TARGET gnss-sdr POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:gnss-sdr>
|
||||
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:gnss-sdr>
|
||||
)
|
||||
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:gnss-sdr> )
|
||||
|
||||
target_link_libraries(gnss-sdr ${MAC_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
@ -97,18 +92,14 @@ target_link_libraries(gnss-sdr ${MAC_LIBRARIES}
|
||||
${GNSS_SDR_OPTIONAL_LIBS}
|
||||
gnss_sp_libs
|
||||
gnss_sdr_flags
|
||||
gnss_rx
|
||||
)
|
||||
|
||||
gnss_rx )
|
||||
|
||||
install(TARGETS gnss-sdr
|
||||
RUNTIME DESTINATION bin
|
||||
COMPONENT "gnss-sdr"
|
||||
)
|
||||
COMPONENT "gnss-sdr" )
|
||||
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/conf DESTINATION share/gnss-sdr
|
||||
FILES_MATCHING PATTERN "*.conf"
|
||||
)
|
||||
FILES_MATCHING PATTERN "*.conf" )
|
||||
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/conf/gnss-sdr.conf DESTINATION share/gnss-sdr/conf
|
||||
RENAME default.conf)
|
||||
@ -118,7 +109,6 @@ if(NOT VOLK_GNSSSDR_FOUND)
|
||||
install(PROGRAMS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr-config-info DESTINATION bin COMPONENT "volk_gnsssdr")
|
||||
endif(NOT VOLK_GNSSSDR_FOUND)
|
||||
|
||||
|
||||
find_program(GZIP
|
||||
gzip
|
||||
/bin
|
||||
@ -127,6 +117,7 @@ find_program(GZIP
|
||||
/opt/local/bin
|
||||
/sbin
|
||||
)
|
||||
|
||||
if(NOT GZIP_NOTFOUND)
|
||||
execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/manpage/gnss-sdr-manpage
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/gnss-sdr.1.gz")
|
||||
|
Loading…
x
Reference in New Issue
Block a user