mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-10-20 10:07:42 +00:00
Update to modern CMake usage
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
|
||||
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
@@ -90,20 +90,6 @@ if(OPENCL_FOUND)
|
||||
)
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${GLOG_INCLUDE_DIRS}
|
||||
${GFlags_INCLUDE_DIRS}
|
||||
${ARMADILLO_INCLUDE_DIRS}
|
||||
${GNURADIO_RUNTIME_INCLUDE_DIRS}
|
||||
${GNURADIO_BLOCKS_INCLUDE_DIRS}
|
||||
${VOLK_INCLUDE_DIRS}
|
||||
${VOLK_GNSSSDR_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(OPENCL_FOUND)
|
||||
include_directories(${OPENCL_INCLUDE_DIRS})
|
||||
@@ -114,8 +100,6 @@ if(OPENCL_FOUND)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
list(SORT GNSS_SPLIBS_HEADERS)
|
||||
list(SORT GNSS_SPLIBS_SOURCES)
|
||||
|
||||
@@ -123,29 +107,50 @@ add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS})
|
||||
source_group(Headers FILES ${GNSS_SPLIBS_HEADERS})
|
||||
|
||||
target_link_libraries(gnss_sp_libs
|
||||
${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${VOLK_LIBRARIES} ${ORC_LIBRARIES}
|
||||
${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES}
|
||||
${GFlags_LIBS}
|
||||
${ARMADILLO_LIBRARIES}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
${GNURADIO_FFT_LIBRARIES}
|
||||
${GNURADIO_FILTER_LIBRARIES}
|
||||
${OPT_LIBRARIES}
|
||||
gnss_rx
|
||||
PUBLIC
|
||||
Boost::boost
|
||||
Gflags::gflags
|
||||
Armadillo::armadillo
|
||||
Gnuradio::runtime
|
||||
Gnuradio::blocks
|
||||
Volk::volk ${ORC_LIBRARIES}
|
||||
Volkgnsssdr::volkgnsssdr
|
||||
gnss_system_parameters
|
||||
${OPT_LIBRARIES}
|
||||
PRIVATE
|
||||
Boost::filesystem
|
||||
Glog::glog
|
||||
gnss_rx
|
||||
)
|
||||
|
||||
if(NOT VOLKGNSSSDR_FOUND)
|
||||
add_dependencies(gnss_sp_libs volk_gnsssdr_module
|
||||
armadillo-${armadillo_RELEASE})
|
||||
else()
|
||||
add_dependencies(gnss_sp_libs armadillo-${armadillo_RELEASE})
|
||||
endif()
|
||||
target_compile_definitions(gnss_sp_libs PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
if(${GFLAGS_GREATER_20})
|
||||
add_definitions(-DGFLAGS_GREATER_2_0=1)
|
||||
target_compile_definitions(gnss_sp_libs PUBLIC -DGFLAGS_GREATER_2_0=1)
|
||||
endif()
|
||||
|
||||
set_property(TARGET gnss_sp_libs
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
)
|
||||
|
||||
add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h)
|
||||
source_group(Headers FILES gnss_sdr_flags.h)
|
||||
target_link_libraries(gnss_sdr_flags ${GFlags_LIBS})
|
||||
|
||||
target_link_libraries(gnss_sdr_flags
|
||||
PUBLIC
|
||||
Gflags::gflags
|
||||
PRIVATE
|
||||
Boost::filesystem
|
||||
)
|
||||
|
||||
if(${GFLAGS_GREATER_20})
|
||||
target_compile_definitions(gnss_sdr_flags PUBLIC -DGFLAGS_GREATER_2_0=1)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(gnss_sdr_flags PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
set_property(TARGET gnss_sdr_flags
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
)
|
||||
|
@@ -16,7 +16,6 @@
|
||||
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
add_definitions(-DGNSS_SDR_VERSION="${VERSION}")
|
||||
|
||||
set(RTKLIB_LIB_SOURCES
|
||||
rtklib_rtkcmn.cc
|
||||
@@ -59,33 +58,31 @@ set(RTKLIB_LIB_HEADERS
|
||||
rtklib.h
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${GFlags_INCLUDE_DIRS}
|
||||
${GLOG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(SORT RTKLIB_LIB_HEADERS)
|
||||
list(SORT RTKLIB_LIB_SOURCES)
|
||||
|
||||
add_library(rtklib_lib ${RTKLIB_LIB_SOURCES} ${RTKLIB_LIB_HEADERS})
|
||||
source_group(Headers FILES ${RTKLIB_LIB_HEADERS})
|
||||
add_dependencies(rtklib_lib glog-${glog_RELEASE})
|
||||
|
||||
if(OS_IS_MACOSX)
|
||||
set(MAC_LIBRARIES "-framework Accelerate")
|
||||
endif()
|
||||
|
||||
target_link_libraries(
|
||||
rtklib_lib
|
||||
${Boost_LIBRARIES}
|
||||
${GFlags_LIBS}
|
||||
${GLOG_LIBRARIES}
|
||||
${BLAS}
|
||||
${LAPACK}
|
||||
${MAC_LIBRARIES}
|
||||
target_link_libraries(rtklib_lib
|
||||
PUBLIC
|
||||
gnss_rx
|
||||
gnss_system_parameters
|
||||
PRIVATE
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
${BLAS}
|
||||
${LAPACK}
|
||||
${MAC_LIBRARIES}
|
||||
)
|
||||
|
||||
target_compile_definitions(rtklib_lib PUBLIC -DGNSS_SDR_VERSION="${VERSION}")
|
||||
|
||||
set_property(TARGET rtklib_lib
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
)
|
||||
|
@@ -59,6 +59,7 @@
|
||||
|
||||
#include "rtklib_ionex.h"
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include <cstring>
|
||||
|
||||
/* get index -----------------------------------------------------------------*/
|
||||
int getindex(double value, const double *range)
|
||||
|
@@ -52,6 +52,7 @@
|
||||
|
||||
#include "rtklib_lambda.h"
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include <cstring>
|
||||
|
||||
/* LD factorization (Q=L'*diag(D)*L) -----------------------------------------*/
|
||||
int LD(int n, const double *Q, double *L, double *D)
|
||||
|
@@ -54,6 +54,7 @@
|
||||
#include "rtklib_ephemeris.h"
|
||||
#include "rtklib_ionex.h"
|
||||
#include "rtklib_sbas.h"
|
||||
#include <cstring>
|
||||
|
||||
/* pseudorange measurement error variance ------------------------------------*/
|
||||
double varerr(const prcopt_t *opt, double el, int sys)
|
||||
|
@@ -57,6 +57,7 @@
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include "rtklib_sbas.h"
|
||||
#include "rtklib_tides.h"
|
||||
#include <cstring>
|
||||
|
||||
/* wave length of LC (m) -----------------------------------------------------*/
|
||||
double lam_LC(int i, int j, int k)
|
||||
|
@@ -62,6 +62,7 @@
|
||||
|
||||
#include "rtklib_preceph.h"
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include <cstring>
|
||||
|
||||
/* satellite code to satellite system ----------------------------------------*/
|
||||
int code2sys(char code)
|
||||
|
@@ -54,6 +54,7 @@
|
||||
|
||||
#include "rtklib_rtcm3.h"
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include <cstring>
|
||||
|
||||
|
||||
/* msm signal id table -------------------------------------------------------*/
|
||||
|
@@ -52,6 +52,7 @@
|
||||
|
||||
#include "rtklib_rtkcmn.h"
|
||||
//#include <cstdio>
|
||||
#include <glog/logging.h>
|
||||
#include <dirent.h>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
@@ -79,7 +79,7 @@
|
||||
#define GNSS_SDR_RTKLIB_RTKCMN_H_
|
||||
|
||||
#include "rtklib.h"
|
||||
#include <glog/logging.h>
|
||||
//#include <glog/logging.h>
|
||||
|
||||
/* coordinate rotation matrix ------------------------------------------------*/
|
||||
#define Rx(t, X) \
|
||||
|
@@ -57,6 +57,7 @@
|
||||
#include "rtklib_pntpos.h"
|
||||
#include "rtklib_ppp.h"
|
||||
#include "rtklib_tides.h"
|
||||
#include <cstring>
|
||||
|
||||
static int resamb_WLNL(rtk_t *rtk __attribute((unused)), const obsd_t *obs __attribute((unused)), const int *sat __attribute((unused)),
|
||||
const int *iu __attribute((unused)), const int *ir __attribute((unused)), int ns __attribute__((unused)), const nav_t *nav __attribute((unused)),
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include "rtklib_sbas.h"
|
||||
#include "rtklib_solution.h"
|
||||
#include "rtklib_stream.h"
|
||||
#include <cstring>
|
||||
|
||||
/* write solution header to output stream ------------------------------------*/
|
||||
void writesolhead(stream_t *stream, const solopt_t *solopt)
|
||||
|
@@ -61,6 +61,7 @@
|
||||
|
||||
#include "rtklib_sbas.h"
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include <cstring>
|
||||
|
||||
/* extract field from line ---------------------------------------------------*/
|
||||
char *getfield(char *p, int pos)
|
||||
|
@@ -55,6 +55,7 @@
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include "rtklib_rtksvr.h"
|
||||
#include <cctype>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
/* constants and macros ------------------------------------------------------*/
|
||||
|
@@ -53,6 +53,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <cctype>
|
||||
#include <cerrno>
|
||||
#include <cstring>
|
||||
#include <fcntl.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/tcp.h>
|
||||
|
Reference in New Issue
Block a user