2020-12-30 12:35:06 +00:00
|
|
|
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2020-02-22 13:23:53 +00:00
|
|
|
# This file is part of GNSS-SDR.
|
2018-10-16 15:25:42 +00:00
|
|
|
#
|
2020-12-30 12:35:06 +00:00
|
|
|
# SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es
|
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
2022-07-10 17:19:37 +00:00
|
|
|
if(NOT GNSSTK_FOUND AND NOT ENABLE_OWN_GNSSTK)
|
2022-07-06 11:49:45 +00:00
|
|
|
find_package(GNSSTK)
|
|
|
|
endif()
|
2018-10-16 15:25:42 +00:00
|
|
|
|
2022-07-04 08:05:54 +00:00
|
|
|
if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK)
|
2018-11-18 19:46:38 +00:00
|
|
|
include(GNUInstallDirs)
|
2022-07-05 11:46:58 +00:00
|
|
|
if(GNSSTK_USES_GPSTK_NAMESPACE)
|
2022-07-28 08:37:36 +00:00
|
|
|
set(GNSSTK_LIBRARY ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX})
|
|
|
|
set(GNSSTK_INCLUDE_DIR ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include)
|
2022-07-05 11:46:58 +00:00
|
|
|
else()
|
2022-07-28 08:37:36 +00:00
|
|
|
set(GNSSTK_LIBRARY ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX})
|
|
|
|
set(GNSSTK_INCLUDE_DIR ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include)
|
2022-07-05 11:46:58 +00:00
|
|
|
endif()
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
2018-10-16 15:25:42 +00:00
|
|
|
|
2024-07-10 19:59:33 +00:00
|
|
|
if(CMAKE_VERSION VERSION_LESS 3.30)
|
2024-07-10 18:16:07 +00:00
|
|
|
find_package(Boost COMPONENTS iostreams serialization QUIET)
|
|
|
|
else()
|
|
|
|
find_package(Boost COMPONENTS iostreams serialization)
|
2024-07-10 19:59:33 +00:00
|
|
|
if(NOT TARGET Boost::iostreams)
|
|
|
|
message(STATUS "Trying deprecated FindBoost Module ...")
|
|
|
|
if(POLICY CMP0167)
|
|
|
|
cmake_policy(SET CMP0167 OLD)
|
|
|
|
find_package(Boost COMPONENTS iostreams serialization)
|
|
|
|
endif()
|
|
|
|
endif()
|
2024-07-10 18:16:07 +00:00
|
|
|
endif()
|
2024-07-10 19:59:33 +00:00
|
|
|
|
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-26 10:50:12 +00:00
|
|
|
find_program(UNCOMPRESS_EXECUTABLE uncompress
|
|
|
|
PATHS /bin
|
|
|
|
/usr/bin
|
|
|
|
/usr/sbin
|
|
|
|
)
|
|
|
|
|
2024-07-10 18:37:16 +00:00
|
|
|
if(TARGET Boost::iostreams AND TARGET Boost::serialization)
|
2020-02-22 09:41:18 +00:00
|
|
|
message(STATUS "The rinex2assist utility tool will be built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'")
|
2020-06-12 22:32:40 +00:00
|
|
|
if(USE_CMAKE_TARGET_SOURCES)
|
2020-06-08 18:04:01 +00:00
|
|
|
add_executable(rinex2assist)
|
|
|
|
target_sources(rinex2assist
|
|
|
|
PRIVATE
|
|
|
|
main.cc
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
|
|
|
|
endif()
|
|
|
|
|
2024-07-10 12:28:16 +00:00
|
|
|
if(GNSSTK_VERSION AND "${GNSSTK_VERSION}" VERSION_LESS 3.0.1)
|
2024-05-01 11:02:35 +00:00
|
|
|
set_property(TARGET rinex2assist PROPERTY CXX_STANDARD 14) # Required by GPSTk v3.0.0
|
2024-05-01 07:00:46 +00:00
|
|
|
endif()
|
|
|
|
|
2020-02-22 09:41:18 +00:00
|
|
|
# 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")
|
2020-03-01 10:53:01 +00:00
|
|
|
target_compile_options(rinex2assist
|
2020-06-08 18:04:01 +00:00
|
|
|
PRIVATE
|
2020-03-01 10:53:01 +00:00
|
|
|
-Wno-deprecated -Wno-unused-parameter -Wno-sign-compare -Wno-type-limits -Wno-unused-but-set-variable -Wno-deprecated-copy -Wno-extra
|
|
|
|
)
|
2020-02-22 11:28:35 +00:00
|
|
|
endif()
|
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
target_compile_options(rinex2assist
|
2020-06-08 18:04:01 +00:00
|
|
|
PRIVATE
|
2022-07-05 15:37:21 +00:00
|
|
|
-Wno-deprecated -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-inconsistent-missing-override
|
2020-02-22 11:28:35 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-11-25 13:20:19 +00:00
|
|
|
target_link_libraries(rinex2assist
|
2020-06-08 18:04:01 +00:00
|
|
|
PRIVATE
|
2019-02-03 18:24:44 +00:00
|
|
|
Boost::iostreams
|
|
|
|
Boost::serialization
|
2022-07-04 08:05:54 +00:00
|
|
|
${GNSSTK_LIBRARY}
|
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
|
|
|
|
2024-04-29 06:27:33 +00:00
|
|
|
if(ENABLE_GLOG_AND_GFLAGS)
|
|
|
|
target_link_libraries(rinex2assist PRIVATE Gflags::gflags)
|
|
|
|
target_compile_definitions(rinex2assist PRIVATE -DUSE_GLOG_AND_GFLAGS=1)
|
|
|
|
else()
|
|
|
|
target_link_libraries(rinex2assist PRIVATE absl::flags absl::flags_parse)
|
|
|
|
endif()
|
|
|
|
|
2022-07-05 11:46:58 +00:00
|
|
|
if(GNSSTK_USES_GPSTK_NAMESPACE)
|
|
|
|
target_compile_definitions(rinex2assist PUBLIC -DGNSSTK_USES_GPSTK_NAMESPACE=1)
|
|
|
|
target_include_directories(rinex2assist
|
|
|
|
PRIVATE
|
|
|
|
${GNSSTK_INCLUDE_DIR}/gpstk
|
|
|
|
${GNSSTK_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
target_include_directories(rinex2assist
|
|
|
|
PRIVATE
|
|
|
|
${GNSSTK_INCLUDE_DIR}/gnsstk
|
|
|
|
${GNSSTK_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
endif()
|
2022-07-10 17:19:37 +00:00
|
|
|
if(GNSSTK_OLDER_THAN_9)
|
|
|
|
target_compile_definitions(rinex2assist PRIVATE -DGNSSTK_OLDER_THAN_9=1)
|
2022-07-05 11:46:58 +00:00
|
|
|
endif()
|
2019-02-04 22:26:07 +00:00
|
|
|
|
2019-02-03 18:24:44 +00:00
|
|
|
if(NOT UNCOMPRESS_EXECUTABLE-NOTFOUND)
|
2020-06-08 18:04:01 +00:00
|
|
|
target_compile_definitions(rinex2assist PRIVATE -DUNCOMPRESS_EXECUTABLE="${UNCOMPRESS_EXECUTABLE}")
|
2019-02-03 18:24:44 +00:00
|
|
|
else()
|
2020-06-08 18:04:01 +00:00
|
|
|
target_compile_definitions(rinex2assist PRIVATE -DUNCOMPRESS_EXECUTABLE="")
|
2019-02-03 18:24:44 +00:00
|
|
|
endif()
|
|
|
|
|
2022-07-04 08:05:54 +00:00
|
|
|
if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK)
|
|
|
|
add_dependencies(rinex2assist gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION})
|
2018-11-25 13:20:19 +00:00
|
|
|
endif()
|
2018-10-16 15:25:42 +00:00
|
|
|
|
2020-06-10 15:22:03 +00:00
|
|
|
if(ENABLE_STRIP)
|
|
|
|
set_target_properties(rinex2assist PROPERTIES LINK_FLAGS "-s")
|
|
|
|
endif()
|
|
|
|
|
2018-11-25 13:20:19 +00:00
|
|
|
add_custom_command(TARGET rinex2assist POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:rinex2assist>
|
2020-06-12 18:51:26 +00:00
|
|
|
${LOCAL_INSTALL_BASE_DIR}/install/$<TARGET_FILE_NAME:rinex2assist>
|
2018-11-25 13:20:19 +00:00
|
|
|
)
|
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
|