2020-02-22 13:23:53 +00:00
|
|
|
# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
|
2020-02-11 23:04:29 +00:00
|
|
|
#
|
2020-02-22 13:23:53 +00:00
|
|
|
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
2018-10-16 15:25:42 +00:00
|
|
|
#
|
2020-02-22 13:23:53 +00:00
|
|
|
# This file is part of GNSS-SDR.
|
2018-10-16 15:25:42 +00:00
|
|
|
#
|
2020-02-22 13:23:53 +00:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2018-10-16 15:25:42 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
find_package(GPSTK QUIET)
|
|
|
|
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
|
2018-11-18 19:46:38 +00:00
|
|
|
include(GNUInstallDirs)
|
2019-02-03 18:24:44 +00:00
|
|
|
set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX})
|
2018-11-21 23:35:21 +00:00
|
|
|
set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include)
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
2018-10-16 15:25:42 +00:00
|
|
|
|
|
|
|
|
2018-11-25 13:20:19 +00:00
|
|
|
find_package(Boost COMPONENTS iostreams serialization QUIET)
|
2019-02-03 18:24:44 +00:00
|
|
|
if(CMAKE_VERSION VERSION_LESS 3.5)
|
|
|
|
if(NOT TARGET Boost::iostreams)
|
|
|
|
add_library(Boost::iostreams IMPORTED SHARED)
|
|
|
|
set_property(TARGET Boost::iostreams PROPERTY
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR})
|
|
|
|
set_property(TARGET Boost::iostreams PROPERTY
|
|
|
|
INTERFACE_LINK_LIBRARIES ${Boost_IOSTREAMS_LIBRARIES})
|
|
|
|
set_property(TARGET Boost::iostreams PROPERTY
|
|
|
|
IMPORTED_LOCATION ${Boost_IOSTREAMS_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
if(NOT TARGET Boost::serialization)
|
|
|
|
add_library(Boost::serialization IMPORTED SHARED)
|
|
|
|
set_property(TARGET Boost::serialization PROPERTY
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR})
|
|
|
|
set_property(TARGET Boost::serialization PROPERTY
|
|
|
|
INTERFACE_LINK_LIBRARIES ${Boost_SERIALIZARION_LIBRARIES})
|
|
|
|
set_property(TARGET Boost::serialization PROPERTY
|
|
|
|
IMPORTED_LOCATION ${Boost_SERIALIZARION_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2018-11-25 11:29:56 +00:00
|
|
|
|
2018-11-26 10:50:12 +00:00
|
|
|
find_program(UNCOMPRESS_EXECUTABLE uncompress
|
|
|
|
PATHS /bin
|
|
|
|
/usr/bin
|
|
|
|
/usr/sbin
|
|
|
|
)
|
|
|
|
|
2018-11-25 13:20:19 +00:00
|
|
|
if(Boost_FOUND)
|
2020-02-22 09:41:18 +00:00
|
|
|
message(STATUS "The rinex2assist utility tool will be built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'")
|
2018-11-25 13:20:19 +00:00
|
|
|
add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
|
2020-02-22 09:41:18 +00:00
|
|
|
set_property(TARGET rinex2assist PROPERTY CXX_STANDARD 14) # Required by GPSTk
|
|
|
|
# Do not show warnings raised by GPSTk v3.0.0
|
2020-02-22 11:28:35 +00:00
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
|
target_compile_options(rinex2assist
|
|
|
|
PUBLIC
|
|
|
|
-Wno-deprecated -Wno-unused-parameter -Wno-sign-compare -Wno-type-limits -Wno-unused-but-set-variable -Wno-deprecated-copy -Wno-extra
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
target_compile_options(rinex2assist
|
|
|
|
PUBLIC
|
|
|
|
-Wno-deprecated -Wno-unused-parameter -Wno-sign-compare
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-11-25 13:20:19 +00:00
|
|
|
target_link_libraries(rinex2assist
|
2019-02-03 18:24:44 +00:00
|
|
|
PUBLIC
|
|
|
|
Boost::iostreams
|
|
|
|
Boost::serialization
|
|
|
|
${GPSTK_LIBRARY}
|
|
|
|
Gflags::gflags
|
2019-11-10 22:26:03 +00:00
|
|
|
Threads::Threads
|
2019-02-10 17:34:28 +00:00
|
|
|
core_system_parameters
|
2018-11-25 13:20:19 +00:00
|
|
|
)
|
2018-10-16 15:25:42 +00:00
|
|
|
|
2019-02-04 22:26:07 +00:00
|
|
|
target_include_directories(rinex2assist
|
|
|
|
PUBLIC
|
|
|
|
${GPSTK_INCLUDE_DIR}/gpstk
|
|
|
|
${GPSTK_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
|
2019-02-03 18:24:44 +00:00
|
|
|
if(NOT UNCOMPRESS_EXECUTABLE-NOTFOUND)
|
|
|
|
target_compile_definitions(rinex2assist PUBLIC -DUNCOMPRESS_EXECUTABLE="${UNCOMPRESS_EXECUTABLE}")
|
|
|
|
else()
|
|
|
|
target_compile_definitions(rinex2assist PUBLIC -DUNCOMPRESS_EXECUTABLE="")
|
|
|
|
endif()
|
|
|
|
|
2018-11-25 13:20:19 +00:00
|
|
|
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
|
|
|
|
add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
|
|
|
|
endif()
|
2018-10-16 15:25:42 +00:00
|
|
|
|
2018-11-25 13:20:19 +00:00
|
|
|
add_custom_command(TARGET rinex2assist POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:rinex2assist>
|
|
|
|
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:rinex2assist>
|
|
|
|
)
|
2018-10-16 15:25:42 +00:00
|
|
|
|
2018-11-25 13:20:19 +00:00
|
|
|
install(TARGETS rinex2assist
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
COMPONENT "rinex2assist"
|
|
|
|
)
|
|
|
|
else()
|
2018-11-25 19:17:00 +00:00
|
|
|
message(STATUS "Boost Iostreams library not found.")
|
2020-02-22 12:52:34 +00:00
|
|
|
message(STATUS " The rinex2assist utility tool will not be built.")
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU")
|
2020-02-22 12:57:47 +00:00
|
|
|
message(STATUS " You can install the Boost Iostreams library by doing:")
|
2020-02-22 12:52:34 +00:00
|
|
|
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
|
|
|
message(STATUS " sudo yum install boost-iostreams")
|
|
|
|
elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE")
|
|
|
|
message(STATUS " sudo zypper install libboost_iostreams-devel")
|
|
|
|
else()
|
|
|
|
message(STATUS " sudo apt-get install libboost-iostreams-dev")
|
|
|
|
endif()
|
|
|
|
endif()
|
2018-11-25 13:20:19 +00:00
|
|
|
endif()
|
2019-06-16 21:28:24 +00:00
|
|
|
|
2020-02-22 13:23:53 +00:00
|
|
|
set(Boost_FOUND TRUE) # trick for summary report
|