1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-10-30 06:36:21 +00:00
gnss-sdr/src/utils/rinex2assist/CMakeLists.txt

102 lines
3.7 KiB
CMake
Raw Normal View History

2019-02-04 22:26:07 +00:00
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
2018-10-16 15:25:42 +00:00
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
find_package(GPSTK QUIET)
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
include(GNUInstallDirs)
2019-02-03 18:24:44 +00:00
#string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR})
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})
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
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()
find_program(UNCOMPRESS_EXECUTABLE uncompress
PATHS /bin
/usr/bin
/usr/sbin
)
if(Boost_FOUND)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
2018-10-16 15:25:42 +00:00
target_link_libraries(rinex2assist
2019-02-03 18:24:44 +00:00
PUBLIC
Boost::iostreams
Boost::serialization
${GPSTK_LIBRARY}
Gflags::gflags
algorithms_libs
core_receiver
core_system_parameters
)
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()
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
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
install(TARGETS rinex2assist
RUNTIME DESTINATION bin
COMPONENT "rinex2assist"
)
else()
2018-11-25 19:17:00 +00:00
message(STATUS "Boost Iostreams library not found.")
2019-02-17 12:36:53 +00:00
message(STATUS " rinex2assist will not be built.")
endif()