2020-12-30 12:35:06 +00:00
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
2012-12-24 13:29:23 +00:00
# This file is part of GNSS-SDR.
#
2024-01-01 16:33:15 +00:00
# SPDX-FileCopyrightText: 2010-2024 C. Fernandez-Prades cfernandez(at)cttc.es
2020-12-30 12:35:06 +00:00
# SPDX-License-Identifier: BSD-3-Clause
2012-12-24 13:29:23 +00:00
2017-02-01 18:24:25 +00:00
add_subdirectory ( unit-tests/signal-processing-blocks/libs )
2018-08-29 16:53:03 +00:00
add_subdirectory ( system-tests/libs )
2024-02-20 14:49:36 +00:00
include_directories ( "${GNSSSDR_SOURCE_DIR}/src/core/receiver" )
2017-02-01 18:24:25 +00:00
2024-04-13 07:03:46 +00:00
include ( XcodeRemoveWarningDuplicates )
2024-04-12 16:15:33 +00:00
2016-11-27 23:18:02 +00:00
################################################################################
# Google Test - https://github.com/google/googletest
################################################################################
2016-12-20 20:43:19 +00:00
set ( GTEST_COMPILER -DCMAKE_CXX_COMPILER= ${ CMAKE_CXX_COMPILER } -DCMAKE_C_COMPILER= ${ CMAKE_C_COMPILER } )
set ( TOOLCHAIN_ARG "" )
2019-04-02 01:31:46 +00:00
if ( DEFINED ENV{OECORE_TARGET_SYSROOT} )
2017-02-15 21:10:06 +00:00
set ( GTEST_COMPILER "" )
2022-07-28 08:37:36 +00:00
set ( TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${GNSSSDR_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake" )
2019-02-17 12:36:13 +00:00
else ( )
2019-11-01 18:29:28 +00:00
if ( CMAKE_TOOLCHAIN_FILE )
set ( TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" )
endif ( )
2019-02-17 12:36:13 +00:00
if ( ENABLE_PACKAGING )
set ( TOOLCHAIN_ARG "-DCMAKE_VERBOSE_MAKEFILE=ON" )
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2016-12-20 20:43:19 +00:00
2019-04-02 00:41:20 +00:00
if ( NOT GOOGLETEST_FOUND )
2020-01-19 23:35:00 +00:00
set ( GTEST_BUILD_COMMAND "${CMAKE_COMMAND}"
2022-07-28 08:37:36 +00:00
" - - b u i l d " " $ { G N S S S D R _ B I N A R Y _ D I R } / g t e s t - $ { G N S S S D R _ G T E S T _ L O C A L _ V E R S I O N } "
2020-01-19 23:35:00 +00:00
" - - c o n f i g " $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
)
2021-12-17 19:00:30 +00:00
if ( CMAKE_VERSION VERSION_GREATER 3.12 AND NOT CMAKE_CROSSCOMPILING )
2021-05-31 08:47:07 +00:00
# Parallel building of gtest causes problems in some environments (e.g. Macports buildings)
set ( GTEST_BUILD_COMMAND ${ GTEST_BUILD_COMMAND } "--parallel 1" )
endif ( )
2019-11-09 18:56:28 +00:00
if ( CMAKE_GENERATOR STREQUAL Xcode )
2024-04-29 06:27:33 +00:00
set ( GTEST_BUILD_COMMAND "xcodebuild" "-configuration" $< $<CONFIG:None > :None> $< $<CONFIG:Debug > :Debug> $< $<CONFIG:Release > :Release> $< $<CONFIG:RelWithDebInfo > :RelWithDebInfo> $< $<CONFIG:MinSizeRel > :MinSizeRel> $< $<CONFIG:NoOptWithASM > :NoOptWithASM> $< $<CONFIG:Coverage > :Coverage> $< $<CONFIG:O2WithASM > :O2WithASM> $< $<CONFIG:O3WithASM > :O3WithASM> $< $<CONFIG:ASAN > :Debug> "-target" "gtest_main" )
2019-02-17 12:36:13 +00:00
endif ( )
2022-07-04 08:50:21 +00:00
if ( GNSSSDR_GTEST_LOCAL_VERSION VERSION_LESS 1.12.0 )
set ( DEBUG_DECORATION "d" )
else ( )
set ( DEBUG_DECORATION "" )
endif ( )
2018-11-19 07:51:05 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.2 )
2019-04-02 00:41:20 +00:00
ExternalProject_Add ( gtest- ${ GNSSSDR_GTEST_LOCAL_VERSION }
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / g o o g l e / g o o g l e t e s t
2023-01-26 17:39:25 +00:00
G I T _ T A G v $ { G N S S S D R _ G T E S T _ L O C A L _ V E R S I O N }
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g t e s t / g t e s t - $ { G N S S S D R _ G T E S T _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / g t e s t - $ { G N S S S D R _ G T E S T _ L O C A L _ V E R S I O N }
2020-01-19 23:35:00 +00:00
C M A K E _ A R G S $ { G T E S T _ C O M P I L E R }
- D I N S T A L L _ G T E S T = O F F
- D B U I L D _ G M O C K = O F F
- D g t e s t _ h i d e _ i n t e r n a l _ s y m b o l s = O N
$ { T O O L C H A I N _ A R G }
- D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
2019-11-09 18:56:28 +00:00
B U I L D _ C O M M A N D $ { G T E S T _ B U I L D _ C O M M A N D }
2019-04-02 00:41:20 +00:00
U P D A T E _ C O M M A N D " "
P A T C H _ C O M M A N D " "
I N S T A L L _ C O M M A N D " "
)
2018-11-24 17:40:34 +00:00
else ( )
2019-12-06 13:23:12 +00:00
set ( GOOGLETEST_BUILD_BYPRODUCTS
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ B I N A R Y _ D I R } / g t e s t - $ { G N S S S D R _ G T E S T _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
$ { G N S S S D R _ B I N A R Y _ D I R } / g t e s t - $ { G N S S S D R _ G T E S T _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
)
2022-07-04 08:50:21 +00:00
2020-01-19 21:13:50 +00:00
if ( ( CMAKE_BUILD_TYPE STREQUAL Debug ) OR ( CMAKE_BUILD_TYPE STREQUAL NoOptWithASM ) OR
( C M A K E _ B U I L D _ T Y P E S T R E Q U A L C o v e r a g e ) OR ( CMAKE_BUILD_TYPE STREQUAL ASAN ) ) # Workaround for Ninja generator
2019-12-06 13:23:12 +00:00
set ( GOOGLETEST_BUILD_BYPRODUCTS
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ B I N A R Y _ D I R } / g t e s t - $ { G N S S S D R _ G T E S T _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { D E B U G _ D E C O R A T I O N } $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
$ { G N S S S D R _ B I N A R Y _ D I R } / g t e s t - $ { G N S S S D R _ G T E S T _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { D E B U G _ D E C O R A T I O N } $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
)
endif ( )
2019-04-02 00:41:20 +00:00
ExternalProject_Add ( gtest- ${ GNSSSDR_GTEST_LOCAL_VERSION }
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / g o o g l e / g o o g l e t e s t
2023-01-26 17:39:25 +00:00
G I T _ T A G v $ { G N S S S D R _ G T E S T _ L O C A L _ V E R S I O N }
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g t e s t / g t e s t - $ { G N S S S D R _ G T E S T _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / g t e s t - $ { G N S S S D R _ G T E S T _ L O C A L _ V E R S I O N }
2020-01-19 23:35:00 +00:00
C M A K E _ A R G S $ { G T E S T _ C O M P I L E R }
- D I N S T A L L _ G T E S T = O F F
- D B U I L D _ G M O C K = O F F
- D g t e s t _ h i d e _ i n t e r n a l _ s y m b o l s = O N
$ { T O O L C H A I N _ A R G }
- D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
2019-11-09 18:56:28 +00:00
B U I L D _ C O M M A N D $ { G T E S T _ B U I L D _ C O M M A N D }
2019-04-02 00:41:20 +00:00
U P D A T E _ C O M M A N D " "
P A T C H _ C O M M A N D " "
2019-12-06 13:23:12 +00:00
B U I L D _ B Y P R O D U C T S $ { G O O G L E T E S T _ B U I L D _ B Y P R O D U C T S }
2019-04-02 00:41:20 +00:00
I N S T A L L _ C O M M A N D " "
)
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
ExternalProject_Get_Property ( gtest- ${ GNSSSDR_GTEST_LOCAL_VERSION } binary_dir )
2019-02-07 16:05:26 +00:00
if ( NOT TARGET GTest::GTest )
2022-07-28 08:37:36 +00:00
file ( MAKE_DIRECTORY ${ GNSSSDR_BINARY_DIR } /thirdparty/gtest/gtest- ${ GNSSSDR_GTEST_LOCAL_VERSION } /googletest/include )
2019-02-07 16:05:26 +00:00
add_library ( GTest::GTest STATIC IMPORTED )
add_dependencies ( GTest::GTest gtest- ${ GNSSSDR_GTEST_LOCAL_VERSION } )
set_target_properties ( GTest::GTest PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
2020-01-19 21:13:50 +00:00
I M P O R T E D _ C O N F I G U R A T I O N S " N o n e ; D e b u g ; R e l e a s e ; R e l W i t h D e b I n f o ; M i n S i z e R e l "
M A P _ I M P O R T E D _ C O N F I G _ N O O P T W I T H A S M D e b u g
M A P _ I M P O R T E D _ C O N F I G _ C O V E R A G E D e b u g
M A P _ I M P O R T E D _ C O N F I G _ O 2 W I T H A S M R e l W i t h D e b I n f o
M A P _ I M P O R T E D _ C O N F I G _ O 3 W I T H A S M R e l W i t h D e b I n f o
M A P _ I M P O R T E D _ C O N F I G _ A S A N D e b u g
I M P O R T E D _ L O C A T I O N _ N O N E $ { b i n a r y _ d i r } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2022-07-04 08:05:54 +00:00
I M P O R T E D _ L O C A T I O N _ D E B U G $ { b i n a r y _ d i r } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { b i n a r y _ d i r } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L W I T H D E B I N F O $ { b i n a r y _ d i r } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ M I N S I Z E R E L $ { b i n a r y _ d i r } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2022-07-28 08:37:36 +00:00
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g t e s t / g t e s t - $ { G N S S S D R _ G T E S T _ L O C A L _ V E R S I O N } / g o o g l e t e s t / i n c l u d e
2022-07-04 08:50:21 +00:00
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { b i n a r y _ d i r } / l i b / g t e s t $ < $ < C O N F I G : D e b u g > : $ { D E B U G _ D E C O R A T I O N } > $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-02-07 16:05:26 +00:00
)
2019-12-06 13:23:12 +00:00
if ( ( CMAKE_GENERATOR STREQUAL Xcode ) OR MSVC )
set_target_properties ( GTest::GTest PROPERTIES
2022-07-04 08:50:21 +00:00
I M P O R T E D _ L O C A T I O N _ D E B U G $ { b i n a r y _ d i r } / l i b / D e b u g / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { D E B U G _ D E C O R A T I O N } $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { b i n a r y _ d i r } / l i b / R e l e a s e / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L W I T H D E B I N F O $ { b i n a r y _ d i r } / l i b / R e l W i t h D e b I n f o / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ M I N S I Z E R E L $ { b i n a r y _ d i r } / l i b / M i n S i z e R e l / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2022-07-04 08:50:21 +00:00
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { b i n a r y _ d i r } / l i b / $ < $ < C O N F I G : D e b u g > : D e b u g / > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e / > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o / > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l / > g t e s t $ < $ < C O N F I G : D e b u g > : $ { D E B U G _ D E C O R A T I O N } > $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
)
endif ( )
2019-02-07 16:05:26 +00:00
set_target_properties ( GTest::GTest PROPERTIES
I N T E R F A C E _ L I N K _ L I B R A R I E S T h r e a d s : : T h r e a d s
)
endif ( )
if ( NOT TARGET GTest::Main )
add_library ( GTest::Main STATIC IMPORTED )
add_dependencies ( GTest::Main gtest- ${ GNSSSDR_GTEST_LOCAL_VERSION } )
set_target_properties ( GTest::Main PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
2020-01-19 21:13:50 +00:00
I M P O R T E D _ C O N F I G U R A T I O N S " N o n e ; D e b u g ; R e l e a s e ; R e l W i t h D e b I n f o ; M i n S i z e R e l "
M A P _ I M P O R T E D _ C O N F I G _ N O O P T W I T H A S M D e b u g
M A P _ I M P O R T E D _ C O N F I G _ C O V E R A G E D e b u g
M A P _ I M P O R T E D _ C O N F I G _ O 2 W I T H A S M R e l W i t h D e b I n f o
M A P _ I M P O R T E D _ C O N F I G _ O 3 W I T H A S M R e l W i t h D e b I n f o
M A P _ I M P O R T E D _ C O N F I G _ A S A N D e b u g
I M P O R T E D _ L O C A T I O N _ N O N E $ { b i n a r y _ d i r } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2022-07-04 08:50:21 +00:00
I M P O R T E D _ L O C A T I O N _ D E B U G $ { b i n a r y _ d i r } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { D E B U G _ D E C O R A T I O N } $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { b i n a r y _ d i r } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L W I T H D E B I N F O $ { b i n a r y _ d i r } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ M I N S I Z E R E L $ { b i n a r y _ d i r } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2022-07-28 08:37:36 +00:00
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g t e s t / g t e s t - $ { G N S S S D R _ G T E S T _ L O C A L _ V E R S I O N } / g o o g l e t e s t / i n c l u d e
2022-07-04 08:50:21 +00:00
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { b i n a r y _ d i r } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ < $ < C O N F I G : D e b u g > : $ { D E B U G _ D E C O R A T I O N } > $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-02-07 16:05:26 +00:00
)
2019-12-06 13:23:12 +00:00
if ( ( CMAKE_GENERATOR STREQUAL Xcode ) OR MSVC )
set_target_properties ( GTest::Main PROPERTIES
2022-07-04 08:50:21 +00:00
I M P O R T E D _ L O C A T I O N _ D E B U G $ { b i n a r y _ d i r } / l i b / D e b u g / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { D E B U G _ D E C O R A T I O N } $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2020-01-19 21:13:50 +00:00
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { b i n a r y _ d i r } / l i b / R e l e a s e / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L W I T H D E B I N F O $ { b i n a r y _ d i r } / l i b / R e l W i t h D e b I n f o / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ M I N S I Z E R E L $ { b i n a r y _ d i r } / l i b / M i n S i z e R e l / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2022-07-04 08:50:21 +00:00
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { b i n a r y _ d i r } / l i b / $ < $ < C O N F I G : D e b u g > : D e b u g / > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e / > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o / > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l / > $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ < $ < C O N F I G : D e b u g > : $ { D E B U G _ D E C O R A T I O N } > $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
)
endif ( )
2019-02-07 16:05:26 +00:00
endif ( )
2018-11-24 17:40:34 +00:00
else ( )
2018-11-19 07:51:05 +00:00
if ( GTEST_INCLUDE_DIRS )
set ( GTEST_INCLUDE_DIRECTORIES ${ GTEST_INCLUDE_DIRS } ${ LIBGTEST_DEV_DIR } )
2019-02-07 18:45:31 +00:00
add_library ( gtest STATIC ${ LIBGTEST_DEV_DIR } /src/gtest-all.cc )
2019-02-07 16:05:26 +00:00
target_include_directories ( gtest
P U B L I C
2019-02-07 18:26:09 +00:00
$ { G T E S T _ I N C L U D E _ D I R E C T O R I E S }
2019-02-07 16:05:26 +00:00
)
2019-02-07 18:45:31 +00:00
add_library ( gtest_main STATIC ${ LIBGTEST_DEV_DIR } /src/gtest_main.cc )
2019-02-07 16:05:26 +00:00
target_include_directories ( gtest_main
P U B L I C
2019-02-07 18:26:09 +00:00
$ { G T E S T _ I N C L U D E _ D I R E C T O R I E S }
2019-02-07 16:05:26 +00:00
)
if ( NOT TARGET GTest::GTest )
add_library ( GTest::GTest STATIC IMPORTED )
add_dependencies ( GTest::GTest gtest )
set_target_properties ( GTest::GTest PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
2019-12-06 17:00:06 +00:00
I M P O R T E D _ L O C A T I O N $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { G T E S T _ I N C L U D E _ D I R S }
2019-12-06 17:00:06 +00:00
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-02-07 16:05:26 +00:00
)
2019-12-06 13:23:12 +00:00
if ( ( CMAKE_GENERATOR STREQUAL Xcode ) OR MSVC )
set_target_properties ( GTest::GTest PROPERTIES
2019-12-06 17:00:06 +00:00
I M P O R T E D _ C O N F I G U R A T I O N S " D e b u g ; R e l e a s e ; R e l W i t h D e b I n f o ; M i n S i z e R e l "
I M P O R T E D _ L O C A T I O N _ D E B U G $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / D e b u g / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / R e l e a s e / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L W I T H D E B I N F O $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / R e l W i t h D e b I n f o / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ M I N S I Z E R E L $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / M i n S i z e R e l / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 17:00:06 +00:00
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ < $ < C O N F I G : D e b u g > : D e b u g / > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e / > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o / > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l / > $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
)
endif ( )
2019-02-07 16:05:26 +00:00
set_target_properties ( GTest::GTest PROPERTIES
I N T E R F A C E _ L I N K _ L I B R A R I E S T h r e a d s : : T h r e a d s
)
endif ( )
if ( NOT TARGET GTest::Main )
add_library ( GTest::Main STATIC IMPORTED )
add_dependencies ( GTest::Main gtest_main )
set_target_properties ( GTest::Main PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
2019-12-06 17:00:06 +00:00
I M P O R T E D _ L O C A T I O N $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { G T E S T _ I N C L U D E _ D I R S }
2019-12-06 17:00:06 +00:00
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-04-02 00:41:20 +00:00
)
2019-12-06 13:23:12 +00:00
if ( ( CMAKE_GENERATOR STREQUAL Xcode ) OR MSVC )
set_target_properties ( GTest::Main PROPERTIES
2019-12-06 17:00:06 +00:00
I M P O R T E D _ C O N F I G U R A T I O N S " D e b u g ; R e l e a s e ; R e l W i t h D e b I n f o ; M i n S i z e R e l "
I M P O R T E D _ L O C A T I O N _ D E B U G $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / D e b u g / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / R e l e a s e / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L W I T H D E B I N F O $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / R e l W i t h D e b I n f o / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ M I N S I Z E R E L $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / M i n S i z e R e l / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 17:00:06 +00:00
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ < $ < C O N F I G : D e b u g > : D e b u g / > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e / > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o / > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l / > $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g t e s t _ m a i n $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
)
endif ( )
2019-02-07 16:05:26 +00:00
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2013-07-06 02:15:09 +00:00
2014-03-15 01:21:17 +00:00
2016-11-27 23:18:02 +00:00
################################################################################
2019-02-07 19:31:40 +00:00
# Definitions
2016-11-27 23:18:02 +00:00
################################################################################
2015-10-27 19:18:48 +00:00
2020-06-13 08:56:49 +00:00
if ( GNURADIO_IS_38_OR_GREATER )
2018-11-24 17:40:34 +00:00
add_definitions ( -DGR_GREATER_38=1 )
endif ( )
2015-10-27 19:18:48 +00:00
if ( OPENSSL_FOUND )
2018-11-19 07:51:05 +00:00
add_definitions ( -DUSE_OPENSSL_FALLBACK=1 )
2018-11-24 17:40:34 +00:00
endif ( )
2016-09-23 19:59:00 +00:00
2019-08-02 12:59:05 +00:00
if ( ENABLE_OPENCL )
2016-11-27 23:18:02 +00:00
add_definitions ( -DOPENCL_BLOCKS_TEST=1 )
2018-11-24 17:40:34 +00:00
endif ( )
2016-11-27 23:18:02 +00:00
2017-03-13 19:54:25 +00:00
if ( ENABLE_CUDA )
add_definitions ( -DCUDA_BLOCKS_TEST=1 )
2018-11-24 17:40:34 +00:00
endif ( )
2016-11-27 23:18:02 +00:00
2017-03-13 19:54:25 +00:00
if ( ENABLE_FPGA )
add_definitions ( -DFPGA_BLOCKS_TEST=1 )
2018-11-24 17:40:34 +00:00
endif ( )
2017-02-13 16:20:49 +00:00
2019-06-15 08:11:11 +00:00
if ( ARMADILLO_VERSION_STRING VERSION_GREATER 8.400 )
# mvnrnd() requires 8.400
2019-06-14 16:22:07 +00:00
add_definitions ( -DARMADILLO_HAVE_MVNRND=1 )
endif ( )
2022-12-13 16:35:53 +00:00
if ( ENABLE_PACKAGING )
add_definitions ( -DEXCLUDE_TESTS_REQUIRING_BINARIES=1 )
endif ( )
2020-06-30 11:41:20 +00:00
if ( has_std_plus_void )
add_definitions ( -DCOMPILER_HAS_STD_PLUS_VOID=1 )
2020-06-29 10:32:35 +00:00
endif ( )
2021-08-02 07:33:16 +00:00
find_package ( GNUPLOT )
2017-10-21 11:05:51 +00:00
if ( GNUPLOT_FOUND )
add_definitions ( -DGNUPLOT_EXECUTABLE= "${GNUPLOT_EXECUTABLE}" )
2018-11-24 17:40:34 +00:00
endif ( )
2021-08-02 07:33:16 +00:00
set_package_properties ( GNUPLOT PROPERTIES
2019-03-09 00:39:32 +00:00
U R L " h t t p : / / w w w . g n u p l o t . i n f o "
P U R P O S E " U s e d t o g e n e r a t e p l o t s i n s o m e t e s t s . "
T Y P E O P T I O N A L
)
2019-06-19 21:42:46 +00:00
if ( GNUPLOT_FOUND AND GNUPLOT_VERSION_STRING )
2021-08-02 07:33:16 +00:00
set_package_properties ( GNUPLOT PROPERTIES
2019-06-19 21:42:46 +00:00
D E S C R I P T I O N " A p o r t a b l e c o m m a n d - l i n e d r i v e n g r a p h i n g utility ( found: v ${ GNUPLOT_VERSION_STRING } ) "
)
else ( )
2021-08-02 07:33:16 +00:00
set_package_properties ( GNUPLOT PROPERTIES
2019-06-19 21:42:46 +00:00
D E S C R I P T I O N " A p o r t a b l e c o m m a n d - l i n e d r i v e n g r a p h i n g u t i l i t y "
)
endif ( )
2018-02-03 09:49:03 +00:00
2018-09-07 12:36:11 +00:00
if ( ENABLE_UNIT_TESTING_MINIMAL )
add_definitions ( -DUNIT_TESTING_MINIMAL=1 )
2018-11-24 17:40:34 +00:00
endif ( )
2018-09-07 12:36:11 +00:00
2017-11-17 22:17:08 +00:00
2016-12-20 20:43:19 +00:00
################################################################################
2022-07-04 08:05:54 +00:00
# gnsstk and optional generator
2016-12-20 20:43:19 +00:00
################################################################################
2019-03-09 00:39:32 +00:00
2017-02-15 21:10:06 +00:00
if ( ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA )
2018-11-19 07:51:05 +00:00
if ( ENABLE_FPGA )
2019-04-02 00:41:20 +00:00
set ( CROSS_INSTALL_DIR "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" )
2019-04-02 01:31:46 +00:00
if ( DEFINED ENV{OECORE_TARGET_SYSROOT} )
2022-07-25 10:48:57 +00:00
set ( CROSS_INSTALL_DIR "${CROSS_INSTALL_DIR} -DBOOST_ROOT=$ENV{OECORE_TARGET_SYSROOT}/usr" )
2019-04-02 00:41:20 +00:00
endif ( )
2018-11-24 17:40:34 +00:00
else ( )
2019-04-02 00:41:20 +00:00
set ( CROSS_INSTALL_DIR "" )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-21 07:28:50 +00:00
find_package ( GNSSSIMULATOR QUIET )
if ( GNSSSIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL )
2021-08-02 07:33:16 +00:00
if ( NOT GNSSSIMULATOR_FOUND )
message ( STATUS "Warning: gnss_sim has not been found, you can install it later." )
message ( STATUS " See https://bitbucket.org/jarribas/gnss-simulator" )
message ( STATUS " It is expected at /usr/bin/gnss_sim" )
set ( SW_GENERATOR_BIN "/usr/bin/gnss_sim" )
endif ( )
2019-04-02 00:41:20 +00:00
add_definitions ( -DSW_GENERATOR_BIN= "${SW_GENERATOR_BIN}" )
add_definitions ( -DDEFAULT_RINEX_NAV= "${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n" )
add_definitions ( -DDEFAULT_POSITION_FILE= "${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv" )
2018-11-24 17:40:34 +00:00
else ( )
2019-11-09 09:38:38 +00:00
set ( GNSS_SIM_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}" )
if ( CMAKE_GENERATOR STREQUAL Xcode )
2024-04-29 06:27:33 +00:00
set ( GNSS_SIM_BUILD_COMMAND "xcodebuild" "-configuration" $< $<CONFIG:None > :None> $< $<CONFIG:Debug > :Debug> $< $<CONFIG:Release > :Release> $< $<CONFIG:RelWithDebInfo > :RelWithDebInfo> $< $<CONFIG:MinSizeRel > :MinSizeRel> $< $<CONFIG:NoOptWithASM > :NoOptWithASM> $< $<CONFIG:Coverage > :Coverage> $< $<CONFIG:O2WithASM > :O2WithASM> $< $<CONFIG:O3WithASM > :O3WithASM> $< $<CONFIG:ASAN > :Debug> "-target" "gnss_sim" )
2019-11-09 09:38:38 +00:00
endif ( )
2022-07-25 10:48:57 +00:00
if ( TOOLCHAIN_ARG )
2022-07-25 10:56:53 +00:00
set ( TOOLCHAIN_ARG_GNSS_SIM "-DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON" )
else ( )
set ( TOOLCHAIN_ARG_GNSS_SIM "" )
2022-07-25 10:48:57 +00:00
endif ( )
2019-04-02 00:41:20 +00:00
ExternalProject_Add ( gnss-sim
2018-11-24 17:40:34 +00:00
G I T _ R E P O S I T O R Y h t t p s : / / b i t b u c k e t . o r g / j a r r i b a s / g n s s - s i m u l a t o r
G I T _ T A G $ { G N S S S D R _ G N S S _ S I M _ L O C A L _ V E R S I O N }
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g n s s - s i m
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / g n s s - s i m
2022-07-25 10:56:53 +00:00
C M A K E _ A R G S $ { G T E S T _ C O M P I L E R } $ { T O O L C H A I N _ A R G } $ { C R O S S _ I N S T A L L _ D I R } $ { T O O L C H A I N _ A R G _ G N S S _ S I M }
2019-11-09 09:38:38 +00:00
B U I L D _ C O M M A N D $ { G N S S _ S I M _ B U I L D _ C O M M A N D }
2018-11-24 17:40:34 +00:00
U P D A T E _ C O M M A N D " "
P A T C H _ C O M M A N D " "
I N S T A L L _ C O M M A N D " "
)
if ( ENABLE_INSTALL_TESTS )
2022-07-28 08:37:36 +00:00
install ( PROGRAMS ${ GNSSSDR_BINARY_DIR } /gnss-sim/gnss_sim DESTINATION bin )
install ( FILES ${ GNSSSDR_BINARY_DIR } /thirdparty/gnss-sim/brdc3540.14n DESTINATION share/gnss-sim )
install ( FILES ${ GNSSSDR_BINARY_DIR } /thirdparty/gnss-sim/circle.csv DESTINATION share/gnss-sim )
2018-11-24 17:40:34 +00:00
set ( SW_GENERATOR_BIN ${ CMAKE_INSTALL_PREFIX } /bin/gnss_sim )
add_definitions ( -DSW_GENERATOR_BIN= "${SW_GENERATOR_BIN}" )
add_definitions ( -DDEFAULT_RINEX_NAV= "${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n" )
add_definitions ( -DDEFAULT_POSITION_FILE= "${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv" )
else ( )
2022-07-28 08:37:36 +00:00
set ( SW_GENERATOR_BIN ${ GNSSSDR_BINARY_DIR } /gnss-sim/gnss_sim )
2019-11-08 13:25:43 +00:00
if ( CMAKE_GENERATOR STREQUAL Xcode )
2024-04-30 08:35:37 +00:00
set ( SW_GENERATOR_BIN ${ GNSSSDR_BINARY_DIR } /gnss-sim/ $< $<CONFIG:None > :None> $< $<CONFIG:Debug > :Debug> $< $<CONFIG:Release > :Release> $< $<CONFIG:RelWithDebInfo > :RelWithDebInfo> $< $<CONFIG:MinSizeRel > :MinSizeRel> $< $<CONFIG:NoOptWithASM > :NoOptWithASM> $< $<CONFIG:Coverage > :Coverage> $< $<CONFIG:O2WithASM > :O2WithASM> $< $<CONFIG:O3WithASM > :O3WithASM> $< $<CONFIG:ASAN > :Debug>/gnss_sim )
2019-11-08 13:25:43 +00:00
endif ( )
2018-11-24 17:40:34 +00:00
add_definitions ( -DSW_GENERATOR_BIN= "${SW_GENERATOR_BIN}" )
2022-07-28 08:37:36 +00:00
add_definitions ( -DDEFAULT_RINEX_NAV= "${GNSSSDR_BINARY_DIR}/thirdparty/gnss-sim/brdc3540.14n" )
add_definitions ( -DDEFAULT_POSITION_FILE= "${GNSSSDR_BINARY_DIR}/thirdparty/gnss-sim/circle.csv" )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2017-02-01 15:17:58 +00:00
2019-08-20 21:02:48 +00:00
############################################################################
2022-07-04 08:05:54 +00:00
# Local installation of gnsstk https://github.com/SGL-UT/gnsstk
2019-08-20 21:02:48 +00:00
############################################################################
2022-07-04 08:05:54 +00:00
if ( NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK )
set_package_properties ( GNSSTK PROPERTIES
2022-07-06 11:49:45 +00:00
P U R P O S E " G N S S T k v $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N } w i l l b e a u t o m a t i c a l l y d o w n l o a d e d a n d b u i l t w h e n d o i n g ' $ { C M A K E _ M A K E _ P R O G R A M _ P R E T T Y _ N A M E } ' . "
2019-08-20 21:02:48 +00:00
)
2019-04-02 00:41:20 +00:00
if ( "${TOOLCHAIN_ARG}" STREQUAL "" )
2019-06-10 19:41:13 +00:00
set ( TOOLCHAIN_ARG "-DCMAKE_CXX_FLAGS=-Wno-deprecated" )
2019-04-02 00:41:20 +00:00
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated" )
endif ( )
2022-07-04 08:05:54 +00:00
set ( GNSSTK_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}" )
2019-11-10 22:26:03 +00:00
if ( CMAKE_GENERATOR STREQUAL Xcode )
2024-04-29 06:27:33 +00:00
set ( GNSSTK_BUILD_COMMAND "xcodebuild" "-configuration" $< $<CONFIG:None > :None> $< $<CONFIG:Debug > :Debug> $< $<CONFIG:Release > :Release> $< $<CONFIG:RelWithDebInfo > :RelWithDebInfo> $< $<CONFIG:MinSizeRel > :MinSizeRel> $< $<CONFIG:NoOptWithASM > :NoOptWithASM> $< $<CONFIG:Coverage > :Coverage> $< $<CONFIG:O2WithASM > :O2WithASM> $< $<CONFIG:O3WithASM > :O3WithASM> $< $<CONFIG:ASAN > :Debug> )
2019-11-10 22:26:03 +00:00
endif ( )
2019-04-02 00:41:20 +00:00
include ( GNUInstallDirs )
2020-10-25 10:50:09 +00:00
find_program ( Patch_EXECUTABLE NAME patch PATHS ENV PATH )
2021-01-16 09:51:38 +00:00
if ( NOT Patch_EXECUTABLE )
2022-07-05 15:37:21 +00:00
message ( FATAL_ERROR "The patch command is not found. It is required to build GNSSTk. Please check your OS documentation and install the patch command." )
2021-01-15 14:03:36 +00:00
endif ( )
2022-12-19 12:12:35 +00:00
if ( CMAKE_VERSION VERSION_GREATER 3.17.0 )
set ( GNSSTK_PATCH_COMMAND
c d $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N } & &
2023-01-26 17:39:25 +00:00
$ { P a t c h _ E X E C U T A B L E } $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N } / C M a k e L i s t s . t x t < $ { G N S S S D R _ S O U R C E _ D I R } / s r c / t e s t s / d a t a / g n s s t k _ s t a t i c 1 4 . p a t c h & &
$ { P a t c h _ E X E C U T A B L E } $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N } / c o r e / l i b / G N S S C o r e / O b s I D . h p p < $ { G N S S S D R _ S O U R C E _ D I R } / s r c / t e s t s / d a t a / g n s s t k _ g c c 1 3 . p a t c h
2022-12-19 12:12:35 +00:00
)
else ( )
set ( GNSSTK_PATCH_COMMAND
c d $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N } & &
2023-01-26 17:39:25 +00:00
$ { P a t c h _ E X E C U T A B L E } $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N } / C M a k e L i s t s . t x t < $ { G N S S S D R _ S O U R C E _ D I R } / s r c / t e s t s / d a t a / g n s s t k _ s t a t i c 1 3 . p a t c h & &
$ { P a t c h _ E X E C U T A B L E } $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N } / c o r e / l i b / G N S S C o r e / O b s I D . h p p < $ { G N S S S D R _ S O U R C E _ D I R } / s r c / t e s t s / d a t a / g n s s t k _ g c c 1 3 . p a t c h
2022-12-19 12:12:35 +00:00
)
endif ( )
2020-12-18 11:51:45 +00:00
# Patch only once
2022-07-28 08:37:36 +00:00
if ( EXISTS ${ GNSSSDR_BINARY_DIR } /thirdparty/gnsstk- ${ GNSSSDR_GNSSTK_LOCAL_VERSION } /CMakeLists.txt )
2022-07-04 08:05:54 +00:00
set ( GNSSTK_PATCH_COMMAND "" )
2020-12-18 11:51:45 +00:00
endif ( )
2019-04-02 00:41:20 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.2 )
2022-07-04 08:05:54 +00:00
ExternalProject_Add ( gnsstk- ${ GNSSSDR_GNSSTK_LOCAL_VERSION }
2022-07-01 14:24:48 +00:00
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / S G L - U T / g n s s t k
2022-07-04 08:05:54 +00:00
G I T _ T A G v $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N }
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N }
2022-07-04 08:05:54 +00:00
P A T C H _ C O M M A N D $ { G N S S T K _ P A T C H _ C O M M A N D }
2020-12-18 11:51:45 +00:00
C M A K E _ A R G S $ { G T E S T _ C O M P I L E R } $ { T O O L C H A I N _ A R G }
2022-07-28 08:37:36 +00:00
- D C M A K E _ I N S T A L L _ P R E F I X = $ { G N S S S D R _ B I N A R Y _ D I R } / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N } / i n s t a l l
2020-12-18 11:51:45 +00:00
- D B U I L D _ E X T = O N
- D B U I L D _ P Y T H O N = O F F
- D C M A K E _ B U I L D _ T Y P E = $ { C M A K E _ B U I L D _ T Y P E }
- D C M A K E _ C X X _ S T A N D A R D = 1 1
- D C M A K E _ C X X _ E X T E N S I O N S = O N
- D C M A K E _ C _ S T A N D A R D = 1 1
- D C M A K E _ C _ E X T E N S I O N S = O N
2022-07-04 08:05:54 +00:00
B U I L D _ C O M M A N D $ { G N S S T K _ B U I L D _ C O M M A N D }
2019-04-02 00:41:20 +00:00
U P D A T E _ C O M M A N D " "
)
else ( )
2020-06-13 12:01:35 +00:00
if ( CMAKE_MAKE_PROGRAM MATCHES "make" )
include ( ProcessorCount )
ProcessorCount ( NUMBER_OF_PROCESSORS )
if ( NUMBER_OF_PROCESSORS GREATER 1 )
2022-07-04 08:05:54 +00:00
set ( GNSSTK_PARALLEL_BUILD "-j${NUMBER_OF_PROCESSORS}" )
2020-06-13 12:01:35 +00:00
endif ( )
endif ( )
2023-01-26 17:39:25 +00:00
if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
set ( GNSSTK_FLAGS "-DCMAKE_CXX_FLAGS:STRING=-w" ) # Fix for clang in aarch64
endif ( )
2022-12-19 12:12:35 +00:00
if ( CMAKE_VERSION VERSION_GREATER 3.17.0 )
2024-01-01 16:33:15 +00:00
set ( GNSSTK_CXX_STANDARD 17 )
if ( ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" ) AND ( "${DARWIN_VERSION}" VERSION_GREATER_EQUAL "14" ) )
set ( GNSSTK_CXX_STANDARD 14 )
endif ( )
2022-12-19 12:12:35 +00:00
ExternalProject_Add ( gnsstk- ${ GNSSSDR_GNSSTK_LOCAL_VERSION }
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / S G L - U T / g n s s t k
G I T _ T A G v $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N }
G I T _ S U B M O D U L E S _ R E C U R S E O F F
G I T _ S U B M O D U L E S " "
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N }
P A T C H _ C O M M A N D $ { G N S S T K _ P A T C H _ C O M M A N D }
C M A K E _ A R G S $ { G T E S T _ C O M P I L E R } $ { T O O L C H A I N _ A R G }
- D C M A K E _ I N S T A L L _ P R E F I X = $ { G N S S S D R _ B I N A R Y _ D I R } / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N } / i n s t a l l
- D B U I L D _ E X T = O N
- D C M A K E _ B U I L D _ T Y P E = $ { C M A K E _ B U I L D _ T Y P E }
2024-01-01 16:33:15 +00:00
- D C M A K E _ C X X _ S T A N D A R D = $ { G N S S T K _ C X X _ S T A N D A R D }
2022-12-19 12:12:35 +00:00
- D C M A K E _ C X X _ E X T E N S I O N S = O N
- D C M A K E _ C _ S T A N D A R D = 1 1
- D C M A K E _ C _ E X T E N S I O N S = O N
2023-01-26 17:39:25 +00:00
" $ { G N S S T K _ F L A G S } "
2022-12-19 12:12:35 +00:00
B U I L D _ C O M M A N D $ { G N S S T K _ B U I L D _ C O M M A N D } $ { G N S S T K _ P A R A L L E L _ B U I L D }
B U I L D _ B Y P R O D U C T S $ { G N S S S D R _ B I N A R Y _ D I R } / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N } / i n s t a l l / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g n s s t k $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
U P D A T E _ C O M M A N D " "
)
else ( )
ExternalProject_Add ( gnsstk- ${ GNSSSDR_GNSSTK_LOCAL_VERSION }
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / S G L - U T / g n s s t k
G I T _ T A G v $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N }
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N }
P A T C H _ C O M M A N D $ { G N S S T K _ P A T C H _ C O M M A N D }
C M A K E _ A R G S $ { G T E S T _ C O M P I L E R } $ { T O O L C H A I N _ A R G }
- D C M A K E _ I N S T A L L _ P R E F I X = $ { G N S S S D R _ B I N A R Y _ D I R } / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N } / i n s t a l l
- D B U I L D _ E X T = O N
- D B U I L D _ P Y T H O N = O F F
- D C M A K E _ B U I L D _ T Y P E = $ { C M A K E _ B U I L D _ T Y P E }
- D C M A K E _ C X X _ S T A N D A R D = 1 4
- D C M A K E _ C X X _ E X T E N S I O N S = O N
- D C M A K E _ C _ S T A N D A R D = 1 1
- D C M A K E _ C _ E X T E N S I O N S = O N
B U I L D _ C O M M A N D $ { G N S S T K _ B U I L D _ C O M M A N D } $ { G N S S T K _ P A R A L L E L _ B U I L D }
B U I L D _ B Y P R O D U C T S $ { G N S S S D R _ B I N A R Y _ D I R } / g n s s t k - $ { G N S S S D R _ G N S S T K _ L O C A L _ V E R S I O N } / i n s t a l l / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g n s s t k $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
U P D A T E _ C O M M A N D " "
)
endif ( )
2019-04-02 00:41:20 +00:00
endif ( )
2022-07-28 08:37:36 +00:00
set ( GNSSTK_INCLUDE_DIRS ${ GNSSSDR_BINARY_DIR } /gnsstk- ${ GNSSSDR_GNSSTK_LOCAL_VERSION } /install/include CACHE PATH "Local GNSSTK headers" )
set ( GNSSTK_LIBRARY ${ GNSSSDR_BINARY_DIR } /gnsstk- ${ GNSSSDR_GNSSTK_LOCAL_VERSION } /install/lib/ ${ CMAKE_FIND_LIBRARY_PREFIXES } gnsstk ${ CMAKE_STATIC_LIBRARY_SUFFIX } )
set ( GNSSTK_BINDIR ${ GNSSSDR_BINARY_DIR } /gnsstk- ${ GNSSSDR_GNSSTK_LOCAL_VERSION } /install/bin/ )
2022-07-04 08:05:54 +00:00
add_definitions ( -DGNSSTK_BINDIR= "${GNSSTK_BINDIR}" )
add_library ( Gnsstk::gnsstk STATIC IMPORTED )
add_dependencies ( Gnsstk::gnsstk gnsstk- ${ GNSSSDR_GNSSTK_LOCAL_VERSION } )
file ( MAKE_DIRECTORY ${ GNSSTK_INCLUDE_DIRS } )
file ( MAKE_DIRECTORY ${ GNSSTK_INCLUDE_DIRS } /gnsstk )
set_target_properties ( Gnsstk::gnsstk PROPERTIES
2019-04-02 00:41:20 +00:00
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
2022-07-04 08:05:54 +00:00
I M P O R T E D _ L O C A T I O N " $ { G N S S T K _ L I B R A R Y } "
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S " $ { G N S S T K _ I N C L U D E _ D I R S } ; $ { G N S S T K _ I N C L U D E _ D I R S } / g n s s t k "
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { G N S S T K _ L I B R A R Y } "
2019-04-02 00:41:20 +00:00
)
2018-11-24 17:40:34 +00:00
else ( )
2022-07-04 08:05:54 +00:00
set ( GNSSTK_BINDIR ${ GNSSTK_INCLUDE_DIR } /../bin/ )
add_definitions ( -DGNSSTK_BINDIR= "${GNSSTK_BINDIR}" )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2016-12-20 20:43:19 +00:00
2023-03-19 12:53:58 +00:00
if ( NOT ( ENABLE_PACKAGING OR ENABLE_UNIT_TESTING_MINIMAL ) )
message ( STATUS "Downloading some data files for testing ..." )
2022-12-19 14:09:55 +00:00
if ( NOT EXISTS ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat )
message ( STATUS "Downloading file: Galileo_E1_ID_1_Fs_4Msps_8ms.dat" )
file ( DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/Galileo_E1_ID_1_Fs_4Msps_8ms.dat
$ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / s i g n a l _ s a m p l e s / G a l i l e o _ E 1 _ I D _ 1 _ F s _ 4 M s p s _ 8 m s . d a t
S H O W _ P R O G R E S S
E X P E C T E D _ H A S H M D 5 = d 5 7 a 0 2 d 3 c 7 3 6 1 b b a 2 e 1 3 7 3 2 9 b 6 6 4 5 8 e f
)
endif ( )
if ( NOT EXISTS ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat )
message ( STATUS "Downloading file: GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat" )
file ( DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat
$ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / s i g n a l _ s a m p l e s / G P S _ L 1 _ C A _ I D _ 1 _ F s _ 4 M s p s _ 2 m s . d a t
S H O W _ P R O G R E S S
E X P E C T E D _ H A S H M D 5 = f 1 2 a d a 8 0 a 2 a d 1 b a b 0 6 1 2 6 2 e 0 1 0 6 4 3 5 2 9
)
endif ( )
if ( NOT EXISTS ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat )
message ( STATUS "Downloading file: GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat" )
file ( DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat
$ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / s i g n a l _ s a m p l e s / G S o C _ C T T C _ c a p t u r e _ 2 0 1 2 _ 0 7 _ 2 6 _ 4 M s p s _ 4 m s . d a t
S H O W _ P R O G R E S S
E X P E C T E D _ H A S H M D 5 = b 9 8 d 6 d 8 2 8 8 5 3 5 4 f 1 6 8 f 2 7 9 8 1 7 d e 2 8 4 b 5
)
endif ( )
if ( NOT EXISTS ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin )
message ( STATUS "Downloading file: NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin" )
file ( DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin
$ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / s i g n a l _ s a m p l e s / N T 1 0 6 5 _ G L O N A S S _ L 1 _ 2 0 1 6 0 8 3 1 _ f s 6 6 2 5 e 6 _ i f 0 e 3 _ 4 m s . b i n
S H O W _ P R O G R E S S
E X P E C T E D _ H A S H M D 5 = 0 e 2 d c 2 1 2 3 0 9 1 4 1 d 2 3 6 8 9 7 b c 0 a f 1 8 7 0 7 4
)
endif ( )
message ( STATUS "Done." )
endif ( )
2016-12-30 13:36:41 +00:00
2017-01-28 15:49:46 +00:00
if ( ENABLE_UNIT_TESTING_EXTRA )
2018-11-19 07:51:05 +00:00
add_definitions ( -DEXTRA_TESTS )
2023-03-19 12:53:58 +00:00
message ( STATUS "Downloading some extra data files for testing ..." )
2022-07-28 08:37:36 +00:00
if ( NOT EXISTS ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat )
2019-04-02 00:41:20 +00:00
message ( STATUS "Downloading file: gps_l2c_m_prn7_5msps.dat" )
2022-12-19 14:09:55 +00:00
file ( DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/gps_l2c_m_prn7_5msps.dat
$ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / s i g n a l _ s a m p l e s / g p s _ l 2 c _ m _ p r n 7 _ 5 m s p s . d a t
2019-04-02 00:41:20 +00:00
S H O W _ P R O G R E S S
E X P E C T E D _ H A S H M D 5 = a 6 f c b e f e 1 5 5 1 3 7 9 4 5 d 3 c 3 3 c 5 e f 7 b d 0 f 9
)
2018-11-24 17:40:34 +00:00
endif ( )
2022-07-28 08:37:36 +00:00
if ( NOT EXISTS ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat )
2019-04-02 00:41:20 +00:00
message ( STATUS "Downloading file: Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat" )
2022-12-19 14:09:55 +00:00
file ( DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat
$ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / s i g n a l _ s a m p l e s / G l o n a s s _ L 1 _ C A _ S I M _ F s _ 6 2 M s p s _ 4 m s . d a t
2019-04-02 00:41:20 +00:00
S H O W _ P R O G R E S S
E X P E C T E D _ H A S H M D 5 = f f b 7 2 f c 6 3 c 1 1 6 b e 5 8 d 5 e 5 c c b 1 d a a e d 3 a
)
2019-03-26 22:04:08 +00:00
endif ( )
2022-07-28 08:37:36 +00:00
if ( NOT EXISTS ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat )
2019-04-02 00:41:20 +00:00
message ( STATUS "Downloading file: BdsB1IStr01_fs25e6_if0_4ms.dat" )
2022-12-19 14:09:55 +00:00
file ( DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/BdsB1IStr01_fs25e6_if0_4ms.dat
$ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / s i g n a l _ s a m p l e s / B d s B 1 I S t r 0 1 _ f s 2 5 e 6 _ i f 0 _ 4 m s . d a t
2019-04-02 00:41:20 +00:00
S H O W _ P R O G R E S S
E X P E C T E D _ H A S H M D 5 = 5 a 4 3 3 6 d a d 9 d 8 0 f 3 3 1 3 a 1 6 d e c 4 f f f 9 2 3 3
)
2019-03-26 22:04:08 +00:00
endif ( )
2022-07-28 08:37:36 +00:00
if ( NOT EXISTS ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/BdsB3IStr01_fs50e6_if0_4ms.dat )
2019-04-02 00:41:20 +00:00
message ( STATUS "Downloading file: BdsB3IStr01_fs50e6_if0_4ms.dat" )
2022-12-19 14:09:55 +00:00
file ( DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/BdsB3IStr01_fs50e6_if0_4ms.dat
$ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / s i g n a l _ s a m p l e s / B d s B 3 I S t r 0 1 _ f s 5 0 e 6 _ i f 0 _ 4 m s . d a t
2019-04-02 00:41:20 +00:00
S H O W _ P R O G R E S S
E X P E C T E D _ H A S H M D 5 = 0 6 6 d 0 d 8 4 3 4 a 8 b c 8 1 e 1 6 1 7 7 8 b 7 c 3 4 c c 0 7
)
2018-11-24 17:40:34 +00:00
endif ( )
2019-03-26 22:04:08 +00:00
message ( STATUS "Done." )
2018-11-19 07:51:05 +00:00
if ( ENABLE_INSTALL_TESTS )
2022-07-28 08:37:36 +00:00
install ( FILES ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat DESTINATION share/gnss-sdr/signal_samples )
install ( FILES ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples )
install ( FILES ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat DESTINATION share/gnss-sdr/signal_samples )
install ( FILES ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat DESTINATION share/gnss-sdr/signal_samples )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2017-01-28 15:49:46 +00:00
2022-12-13 16:35:53 +00:00
if ( NOT ENABLE_PACKAGING )
if ( ENABLE_INSTALL_TESTS )
2022-12-19 14:09:55 +00:00
install ( FILES ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples )
install ( FILES ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat DESTINATION share/gnss-sdr/signal_samples )
install ( FILES ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat DESTINATION share/gnss-sdr/signal_samples )
install ( FILES ${ GNSSSDR_BINARY_DIR } /thirdparty/signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin DESTINATION share/gnss-sdr/signal_samples )
2022-12-13 16:35:53 +00:00
install ( FILES ${ GNSSSDR_SOURCE_DIR } /src/tests/data/rtklib_test/obs_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test )
install ( FILES ${ GNSSSDR_SOURCE_DIR } /src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test )
add_definitions ( -DTEST_PATH= "${CMAKE_INSTALL_PREFIX}/share/gnss-sdr/" )
else ( )
file ( COPY ${ GNSSSDR_SOURCE_DIR } /src/tests/data/rtklib_test/obs_test1.xml DESTINATION ${ GNSSSDR_BINARY_DIR } /thirdparty/data/rtklib_test )
file ( COPY ${ GNSSSDR_SOURCE_DIR } /src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION ${ GNSSSDR_BINARY_DIR } /thirdparty/data/rtklib_test )
add_definitions ( -DTEST_PATH= "${GNSSSDR_BINARY_DIR}/thirdparty/" )
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2016-11-27 23:18:02 +00:00
2012-12-26 11:19:57 +00:00
2014-03-23 09:45:03 +00:00
2016-11-27 23:18:02 +00:00
################################################################################
# Unit testing
################################################################################
2016-10-01 23:59:12 +00:00
if ( ENABLE_UNIT_TESTING )
2020-06-12 22:32:40 +00:00
if ( USE_CMAKE_TARGET_SOURCES )
2020-06-08 18:04:01 +00:00
add_executable ( run_tests )
target_sources ( run_tests PRIVATE ${ CMAKE_CURRENT_SOURCE_DIR } /test_main.cc )
else ( )
add_executable ( run_tests ${ CMAKE_CURRENT_SOURCE_DIR } /test_main.cc )
endif ( )
2014-03-23 09:45:03 +00:00
2019-02-03 18:24:44 +00:00
target_link_libraries ( run_tests
2020-06-08 18:04:01 +00:00
P R I V A T E
2019-02-07 16:05:26 +00:00
B o o s t : : t h r e a d
2019-02-03 18:24:44 +00:00
A r m a d i l l o : : a r m a d i l l o
G n u r a d i o : : r u n t i m e
G n u r a d i o : : b l o c k s
G n u r a d i o : : f i l t e r
G n u r a d i o : : a n a l o g
2019-02-07 21:06:48 +00:00
G T e s t : : G T e s t
G T e s t : : M a i n
2019-02-03 18:24:44 +00:00
M a t i o : : m a t i o
V o l k : : v o l k
V o l k g n s s s d r : : v o l k g n s s s d r
s i g n a l _ s o u r c e _ a d a p t e r s
2019-02-10 17:34:28 +00:00
d a t a _ t y p e _ a d a p t e r s
2019-02-03 18:24:44 +00:00
i n p u t _ f i l t e r _ a d a p t e r s
r e s a m p l e r _ a d a p t e r s
c h a n n e l _ a d a p t e r s
2019-02-10 17:34:28 +00:00
a c q u i s i t i o n _ a d a p t e r s
2019-02-03 18:24:44 +00:00
t r a c k i n g _ a d a p t e r s
2019-02-10 17:34:28 +00:00
t r a c k i n g _ l i b s
2019-02-03 18:24:44 +00:00
t e l e m e t r y _ d e c o d e r _ a d a p t e r s
o b s _ a d a p t e r s
s i g n a l _ g e n e r a t o r _ a d a p t e r s
p v t _ a d a p t e r s
2019-02-10 17:34:28 +00:00
p v t _ l i b s
a l g o r i t h m s _ l i b s
c o r e _ m o n i t o r
2019-02-03 18:24:44 +00:00
s i g n a l _ p r o c e s s i n g _ t e s t i n g _ l i b
s y s t e m _ t e s t i n g _ l i b
2019-02-10 17:34:28 +00:00
c o r e _ r e c e i v e r
2016-10-01 23:59:12 +00:00
)
2024-04-29 06:27:33 +00:00
if ( ENABLE_GLOG_AND_GFLAGS )
target_link_libraries ( run_tests PRIVATE Gflags::gflags Glog::glog )
target_compile_definitions ( run_tests PRIVATE -DUSE_GLOG_AND_GFLAGS=1 )
else ( )
2024-07-10 12:28:16 +00:00
target_link_libraries ( run_tests PRIVATE absl::flags absl::flags_parse absl::log absl::log_initialize )
target_link_libraries ( run_tests INTERFACE "$<LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags>" )
2024-04-29 06:27:33 +00:00
endif ( )
2020-06-13 08:25:28 +00:00
target_include_directories ( run_tests
I N T E R F A C E
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ S O U R C E _ D I R } / s r c / t e s t s / c o m m o n - f i l e s
2020-06-13 08:25:28 +00:00
)
2020-04-02 21:59:35 +00:00
if ( GNURADIO_USES_STD_POINTERS )
target_compile_definitions ( run_tests
2020-06-08 18:04:01 +00:00
P R I V A T E - D G N U R A D I O _ U S E S _ S T D _ P O I N T E R S = 1
2020-04-02 21:59:35 +00:00
)
endif ( )
2021-10-30 03:43:22 +00:00
if ( PMT_USES_BOOST_ANY )
target_compile_definitions ( run_tests
P R I V A T E - D P M T _ U S E S _ B O O S T _ A N Y = 1
)
endif ( )
2019-02-03 18:24:44 +00:00
if ( ENABLE_UNIT_TESTING_EXTRA )
2022-07-04 08:05:54 +00:00
target_link_libraries ( run_tests PRIVATE Gnsstk::gnsstk )
2022-07-05 11:46:58 +00:00
if ( GNSSTK_OLDER_THAN_8 )
target_compile_definitions ( run_tests PRIVATE -DOLD_GPSTK=1 )
endif ( )
if ( GNSSTK_USES_GPSTK_NAMESPACE )
target_compile_definitions ( run_tests PRIVATE -DGNSSTK_USES_GPSTK_NAMESPACE=1 )
endif ( )
2022-07-10 17:19:37 +00:00
if ( GNSSTK_OLDER_THAN_9 )
target_compile_definitions ( run_tests PRIVATE -DGNSSTK_OLDER_THAN_9=1 )
endif ( )
2019-02-03 18:24:44 +00:00
endif ( )
2024-04-13 07:03:46 +00:00
xcode_remove_warning_duplicates ( run_tests )
2020-06-10 15:22:03 +00:00
if ( ENABLE_STRIP )
set_target_properties ( run_tests PROPERTIES LINK_FLAGS "-s" )
endif ( )
2017-02-17 00:02:07 +00:00
if ( ENABLE_INSTALL_TESTS )
2020-06-12 18:51:26 +00:00
if ( EXISTS ${ LOCAL_INSTALL_BASE_DIR } /install/run_tests )
file ( REMOVE ${ LOCAL_INSTALL_BASE_DIR } /install/run_tests )
2018-11-24 17:40:34 +00:00
endif ( )
2017-02-16 18:41:11 +00:00
install ( TARGETS run_tests RUNTIME DESTINATION bin COMPONENT "run_tests" )
2018-11-24 17:40:34 +00:00
else ( )
2017-02-17 00:02:07 +00:00
add_custom_command ( TARGET run_tests POST_BUILD
2018-11-19 07:51:05 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ < T A R G E T _ F I L E : r u n _ t e s t s >
2020-06-12 18:51:26 +00:00
$ { L O C A L _ I N S T A L L _ B A S E _ D I R } / i n s t a l l / $ < T A R G E T _ F I L E _ N A M E : r u n _ t e s t s >
2019-04-02 00:41:20 +00:00
)
2018-11-24 17:40:34 +00:00
endif ( )
2019-02-07 19:31:40 +00:00
if ( ENABLE_GPERFTOOLS )
if ( GPERFTOOLS_FOUND )
target_link_libraries ( run_tests
2020-06-08 18:04:01 +00:00
P R I V A T E
2019-02-07 19:31:40 +00:00
G p e r f t o o l s : : g p e r f t o o l s
)
endif ( )
endif ( )
2019-02-21 10:42:56 +00:00
if ( ENABLE_CLANG_TIDY )
if ( CLANG_TIDY_EXE )
set_target_properties ( run_tests
P R O P E R T I E S
C X X _ C L A N G _ T I D Y " $ { D O _ C L A N G _ T I D Y } "
)
endif ( )
endif ( )
2019-06-24 18:02:19 +00:00
if ( ENABLE_CUDA AND NOT CMAKE_VERSION VERSION_GREATER 3.11 )
2019-02-07 19:31:40 +00:00
target_link_libraries ( run_tests
2020-06-08 18:04:01 +00:00
P R I V A T E
2019-02-07 19:31:40 +00:00
$ { C U D A _ L I B R A R I E S }
)
target_include_directories ( run_tests
2020-06-08 18:04:01 +00:00
P R I V A T E
2019-02-07 19:31:40 +00:00
$ { C U D A _ I N C L U D E _ D I R S }
)
endif ( )
2020-06-12 22:32:40 +00:00
if ( USE_GENERIC_LAMBDAS )
2020-04-25 21:03:44 +00:00
set ( has_generic_lambdas HAS_GENERIC_LAMBDA=1 )
set ( no_has_generic_lambdas HAS_GENERIC_LAMBDA=0 )
target_compile_definitions ( run_tests
P R I V A T E
" $ < $ < C O M P I L E _ F E A T U R E S : c x x _ g e n e r i c _ l a m b d a s > : $ { h a s _ g e n e r i c _ l a m b d a s } > "
" $ < $ < N O T : $ < C O M P I L E _ F E A T U R E S : c x x _ g e n e r i c _ l a m b d a s > > : $ { n o _ h a s _ g e n e r i c _ l a m b d a s } > "
)
else ( )
target_compile_definitions ( run_tests
P R I V A T E
- D H A S _ G E N E R I C _ L A M B D A = 0
)
endif ( )
2020-06-12 22:32:40 +00:00
if ( USE_BOOST_BIND_PLACEHOLDERS )
2020-05-18 20:50:34 +00:00
target_compile_definitions ( run_tests
P R I V A T E
2020-06-12 22:32:40 +00:00
- D U S E _ B O O S T _ B I N D _ P L A C E H O L D E R S = 1
2020-05-18 20:50:34 +00:00
)
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2012-12-28 15:40:03 +00:00
2017-02-15 21:10:06 +00:00
if ( ENABLE_FPGA )
2020-06-10 03:30:23 +00:00
set ( GPS_L1_CA_DLL_PLL_TRACKING_TEST_FPGA_SOURCES
2018-11-24 17:40:34 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s i n g l e _ t e s t _ m a i n . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / t r a c k i n g / g p s _ l 1 _ c a _ d l l _ p l l _ t r a c k i n g _ t e s t _ f p g a . c c
)
2020-06-12 22:32:40 +00:00
if ( USE_CMAKE_TARGET_SOURCES )
2020-06-08 18:04:01 +00:00
add_executable ( gps_l1_ca_dll_pll_tracking_test_fpga )
target_sources ( gps_l1_ca_dll_pll_tracking_test_fpga PRIVATE ${ GPS_L1_CA_DLL_PLL_TRACKING_TEST_FPGA_SOURCES } )
else ( )
add_executable ( gps_l1_ca_dll_pll_tracking_test_fpga ${ GPS_L1_CA_DLL_PLL_TRACKING_TEST_FPGA_SOURCES } )
endif ( )
2021-01-16 13:37:19 +00:00
2021-01-15 14:03:36 +00:00
if ( USE_GENERIC_LAMBDAS )
set ( has_generic_lambdas HAS_GENERIC_LAMBDA=1 )
set ( no_has_generic_lambdas HAS_GENERIC_LAMBDA=0 )
target_compile_definitions ( gps_l1_ca_dll_pll_tracking_test_fpga
P R I V A T E
" $ < $ < C O M P I L E _ F E A T U R E S : c x x _ g e n e r i c _ l a m b d a s > : $ { h a s _ g e n e r i c _ l a m b d a s } > "
" $ < $ < N O T : $ < C O M P I L E _ F E A T U R E S : c x x _ g e n e r i c _ l a m b d a s > > : $ { n o _ h a s _ g e n e r i c _ l a m b d a s } > "
)
else ( )
target_compile_definitions ( gps_l1_ca_dll_pll_tracking_test_fpga
P R I V A T E
- D H A S _ G E N E R I C _ L A M B D A = 0
)
endif ( )
if ( USE_BOOST_BIND_PLACEHOLDERS )
target_compile_definitions ( gps_l1_ca_dll_pll_tracking_test_fpga
P R I V A T E
- D U S E _ B O O S T _ B I N D _ P L A C E H O L D E R S = 1
)
endif ( )
2021-10-30 19:51:23 +00:00
if ( PMT_USES_BOOST_ANY )
target_compile_definitions ( gps_l1_ca_dll_pll_tracking_test_fpga
P R I V A T E - D P M T _ U S E S _ B O O S T _ A N Y = 1
)
endif ( )
2021-01-15 14:03:36 +00:00
2017-02-15 21:10:06 +00:00
target_link_libraries ( gps_l1_ca_dll_pll_tracking_test_fpga
2020-06-08 18:04:01 +00:00
P R I V A T E
2019-02-07 21:06:48 +00:00
A r m a d i l l o : : a r m a d i l l o
2019-02-07 16:21:32 +00:00
B o o s t : : t h r e a d
2019-02-03 18:24:44 +00:00
G n u r a d i o : : r u n t i m e
G n u r a d i o : : b l o c k s
2019-02-07 21:06:48 +00:00
G T e s t : : G T e s t
G T e s t : : M a i n
2019-02-03 18:24:44 +00:00
M a t i o : : m a t i o
2019-02-07 21:06:48 +00:00
V o l k : : v o l k
2019-02-10 17:34:28 +00:00
c h a n n e l _ l i b s
d a t a _ t y p e _ a d a p t e r s
2019-02-03 18:24:44 +00:00
t r a c k i n g _ a d a p t e r s
2019-02-10 00:13:02 +00:00
s i g n a l _ p r o c e s s i n g _ t e s t i n g _ l i b
2019-02-10 17:34:28 +00:00
a l g o r i t h m s _ l i b s
c o r e _ r e c e i v e r
2018-11-24 17:40:34 +00:00
)
2024-04-29 06:27:33 +00:00
if ( ENABLE_GLOG_AND_GFLAGS )
target_link_libraries ( gps_l1_ca_dll_pll_tracking_test_fpga PRIVATE Gflags::gflags Glog::glog )
target_compile_definitions ( gps_l1_ca_dll_pll_tracking_test_fpga PRIVATE -DUSE_GLOG_AND_GFLAGS=1 )
else ( )
2024-07-10 12:28:16 +00:00
target_link_libraries ( gps_l1_ca_dll_pll_tracking_test_fpga PRIVATE absl::flags absl::flags_parse absl::log absl::log_initialize )
target_link_libraries ( gps_l1_ca_dll_pll_tracking_test_fpga INTERFACE "$<LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags>" )
2024-04-29 06:27:33 +00:00
endif ( )
2020-06-13 08:25:28 +00:00
target_include_directories ( gps_l1_ca_dll_pll_tracking_test_fpga
2022-07-28 08:37:36 +00:00
I N T E R F A C E $ { G N S S S D R _ S O U R C E _ D I R } / s r c / t e s t s / c o m m o n - f i l e s
2020-06-13 08:25:28 +00:00
)
2024-04-29 06:27:33 +00:00
xcode_remove_warning_duplicates ( gps_l1_ca_dll_pll_tracking_test_fpga )
2017-02-15 21:10:06 +00:00
install ( TARGETS gps_l1_ca_dll_pll_tracking_test_fpga
2018-11-24 17:40:34 +00:00
R U N T I M E D E S T I N A T I O N b i n
C O M P O N E N T " f p g a - t e s t "
)
endif ( )
2017-02-15 21:10:06 +00:00
2016-11-27 23:18:02 +00:00
2017-02-25 20:13:16 +00:00
################################################################################
# System testing
################################################################################
2018-05-28 13:42:44 +00:00
function ( add_system_test executable )
## Please call this function with variables OPT_INCLUDES_ and OPT_LIBS_
## already defined.
2020-02-29 13:33:09 +00:00
if ( NOT OPT_INCLUDES_ )
set ( OPT_INCLUDES_ "" )
endif ( )
if ( NOT OPT_LIBS_ )
set ( OPT_LIBS_ "" )
endif ( )
2018-05-28 13:42:44 +00:00
set ( SYSTEM_TEST_SOURCES ${ CMAKE_CURRENT_SOURCE_DIR } /system-tests/ ${ executable } .cc )
# Ensure that executable is rebuilt if it was previously built and then removed
2020-06-12 18:51:26 +00:00
if ( NOT EXISTS ${ LOCAL_INSTALL_BASE_DIR } /install/ ${ executable } )
2018-05-28 13:42:44 +00:00
execute_process ( COMMAND ${ CMAKE_COMMAND } -E touch ${ SYSTEM_TEST_SOURCES } )
2018-11-24 17:40:34 +00:00
endif ( )
2020-06-12 22:32:40 +00:00
if ( USE_CMAKE_TARGET_SOURCES )
2020-06-08 18:04:01 +00:00
add_executable ( ${ executable } )
target_sources ( ${ executable } PRIVATE ${ SYSTEM_TEST_SOURCES } )
else ( )
add_executable ( ${ executable } ${ SYSTEM_TEST_SOURCES } )
endif ( )
2020-06-13 08:25:28 +00:00
target_include_directories ( ${ executable }
2021-01-16 13:37:19 +00:00
P R I V A T E $ { O P T _ I N C L U D E S _ }
2022-07-28 08:37:36 +00:00
I N T E R F A C E $ { G N S S S D R _ S O U R C E _ D I R } / s r c / t e s t s / c o m m o n - f i l e s
2020-06-13 08:25:28 +00:00
)
2020-06-08 18:04:01 +00:00
target_link_libraries ( ${ executable } PRIVATE ${ OPT_LIBS_ } algorithms_libs )
2024-07-10 12:28:16 +00:00
if ( NOT ENABLE_GLOG_AND_GFLAGS )
target_link_libraries ( ${ executable } INTERFACE "$<LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags>" )
endif ( )
2020-04-02 21:59:35 +00:00
if ( GNURADIO_USES_STD_POINTERS )
target_compile_definitions ( ${ executable }
2020-06-08 18:04:01 +00:00
P R I V A T E - D G N U R A D I O _ U S E S _ S T D _ P O I N T E R S = 1
2020-04-02 21:59:35 +00:00
)
endif ( )
2018-05-28 13:42:44 +00:00
2020-06-10 15:22:03 +00:00
if ( ENABLE_STRIP )
set_target_properties ( ${ executable } PROPERTIES LINK_FLAGS "-s" )
endif ( )
2018-05-28 13:42:44 +00:00
if ( ENABLE_INSTALL_TESTS )
2020-06-12 18:51:26 +00:00
if ( EXISTS ${ LOCAL_INSTALL_BASE_DIR } /install/ ${ executable } )
file ( REMOVE ${ LOCAL_INSTALL_BASE_DIR } /install/ ${ executable } )
2018-11-24 17:40:34 +00:00
endif ( )
2018-05-28 13:42:44 +00:00
install ( TARGETS ${ executable } RUNTIME DESTINATION bin COMPONENT "${executable}_test" )
2018-11-24 17:40:34 +00:00
else ( )
2018-05-28 13:42:44 +00:00
add_custom_command ( TARGET ${ executable } POST_BUILD
2018-11-19 07:51:05 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ < T A R G E T _ F I L E : $ { e x e c u t a b l e } >
2020-06-12 18:51:26 +00:00
$ { L O C A L _ I N S T A L L _ B A S E _ D I R } / i n s t a l l / $ < T A R G E T _ F I L E _ N A M E : $ { e x e c u t a b l e } >
2019-04-02 00:41:20 +00:00
)
2018-11-24 17:40:34 +00:00
endif ( )
2024-04-12 16:15:33 +00:00
2024-04-13 07:03:46 +00:00
xcode_remove_warning_duplicates ( ${ executable } )
2024-04-12 16:15:33 +00:00
2019-02-21 10:42:56 +00:00
if ( ENABLE_CLANG_TIDY )
if ( CLANG_TIDY_EXE )
set_target_properties ( ${ executable }
P R O P E R T I E S
C X X _ C L A N G _ T I D Y " $ { D O _ C L A N G _ T I D Y } "
)
endif ( )
endif ( )
2018-11-24 17:40:34 +00:00
endfunction ( )
2018-05-28 13:42:44 +00:00
2017-02-25 20:13:16 +00:00
if ( ENABLE_SYSTEM_TESTING )
set ( HOST_SYSTEM "Unknown" )
2019-08-11 12:43:26 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux|kFreeBSD|GNU" )
2020-02-03 21:11:04 +00:00
set ( HOST_SYSTEM "GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCHITECTURE_STRING}" )
2017-08-12 11:22:54 +00:00
string ( REPLACE "\n" "" HOST_SYSTEM "${HOST_SYSTEM}" )
2018-11-17 18:26:06 +00:00
string ( REPLACE "\" " " " HOST_SYSTEM " ${ HOST_SYSTEM } " )
2018-11-24 17:40:34 +00:00
endif ( )
2017-02-25 20:13:16 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
2020-02-01 10:18:08 +00:00
set ( HOST_SYSTEM "macOS" )
2018-11-24 17:40:34 +00:00
endif ( )
2017-02-25 20:13:16 +00:00
add_definitions ( -DHOST_SYSTEM= "${HOST_SYSTEM}" )
2017-11-20 10:21:23 +00:00
2018-05-28 13:42:44 +00:00
#### TTFF
2019-06-10 19:41:13 +00:00
set ( OPT_LIBS_ Boost::thread Boost::date_time
2024-04-29 06:27:33 +00:00
T h r e a d s : : T h r e a d s
2019-02-07 16:21:32 +00:00
G n u r a d i o : : r u n t i m e G T e s t : : G T e s t G T e s t : : M a i n
G n u r a d i o : : b l o c k s G n u r a d i o : : f i l t e r
2019-02-10 17:34:28 +00:00
G n u r a d i o : : a n a l o g a l g o r i t h m s _ l i b s
2020-06-08 18:04:01 +00:00
c o r e _ r e c e i v e r
2019-02-07 16:21:32 +00:00
)
2024-04-29 06:27:33 +00:00
if ( ENABLE_GLOG_AND_GFLAGS )
set ( OPT_LIBS_ ${ OPT_LIBS_ } Gflags::gflags Glog::glog )
else ( )
2024-07-10 12:28:16 +00:00
set ( OPT_LIBS_ ${ OPT_LIBS_ } absl::flags_parse absl::flags absl::log absl::log_initialize absl::log_sink absl::log_sink_registry )
2024-04-29 06:27:33 +00:00
endif ( )
2022-12-19 14:29:04 +00:00
if ( NOT ENABLE_PACKAGING )
2024-04-30 08:35:37 +00:00
add_system_test ( ttff
C M A K E _ A R G S - D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
)
if ( ENABLE_GLOG_AND_GFLAGS )
target_compile_definitions ( ttff PRIVATE -DUSE_GLOG_AND_GFLAGS=1 )
endif ( )
2022-12-19 14:29:04 +00:00
endif ( )
2017-02-25 20:13:16 +00:00
if ( ENABLE_SYSTEM_TESTING_EXTRA )
2018-05-28 13:42:44 +00:00
#### POSITION_TEST
2020-02-10 18:51:33 +00:00
set ( OPT_LIBS_
a l g o r i t h m s _ l i b s c o r e _ r e c e i v e r c o r e _ s y s t e m _ p a r a m e t e r s g n s s _ s d r _ f l a g s
s y s t e m _ t e s t i n g _ l i b s i g n a l _ p r o c e s s i n g _ t e s t i n g _ l i b
2024-04-29 06:27:33 +00:00
B o o s t : : t h r e a d T h r e a d s : : T h r e a d s
2019-02-07 16:21:32 +00:00
G T e s t : : G T e s t G T e s t : : M a i n G n u r a d i o : : r u n t i m e
G n u r a d i o : : b l o c k s G n u r a d i o : : f i l t e r
G n u r a d i o : : a n a l o g M a t i o : : m a t i o V o l k g n s s s d r : : v o l k g n s s s d r
)
2024-04-29 06:27:33 +00:00
if ( ENABLE_GLOG_AND_GFLAGS )
set ( OPT_LIBS_ ${ OPT_LIBS_ } Gflags::gflags Glog::glog )
else ( )
2024-07-10 12:28:16 +00:00
set ( OPT_LIBS_ ${ OPT_LIBS_ } absl::flags_parse absl::log absl::log_initialize absl::log_sink absl::log_sink_registry )
2024-04-29 06:27:33 +00:00
endif ( )
2024-04-30 08:35:37 +00:00
add_system_test ( position_test
C M A K E _ A R G S - D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
)
if ( ENABLE_GLOG_AND_GFLAGS )
target_compile_definitions ( position_test PRIVATE -DUSE_GLOG_AND_GFLAGS=1 )
endif ( )
2020-07-06 08:25:54 +00:00
if ( ENABLE_GPERFTOOLS )
if ( GPERFTOOLS_FOUND )
target_link_libraries ( position_test
P R I V A T E
G p e r f t o o l s : : g p e r f t o o l s
)
endif ( )
endif ( )
2019-11-09 09:38:38 +00:00
if ( NOT GNSSSIMULATOR_FOUND OR ENABLE_GNSS_SIM_INSTALL )
2020-04-08 08:51:46 +00:00
if ( NOT CMAKE_CROSSCOMPILING )
add_dependencies ( position_test gnss-sim )
endif ( )
2019-11-09 09:38:38 +00:00
endif ( )
2018-11-24 17:40:34 +00:00
else ( )
2017-11-10 11:34:20 +00:00
# Avoid working with old executables if they were switched ON and then OFF
2020-06-12 18:51:26 +00:00
if ( EXISTS ${ LOCAL_INSTALL_BASE_DIR } /install/position_test )
file ( REMOVE ${ LOCAL_INSTALL_BASE_DIR } /install/position_test )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
else ( )
2017-11-10 11:34:20 +00:00
# Avoid working with old executables if they were switched ON and then OFF
2020-06-12 18:51:26 +00:00
if ( EXISTS ${ LOCAL_INSTALL_BASE_DIR } /install/ttff )
file ( REMOVE ${ LOCAL_INSTALL_BASE_DIR } /install/ttff )
2018-11-24 17:40:34 +00:00
endif ( )
2020-06-12 18:51:26 +00:00
if ( EXISTS ${ LOCAL_INSTALL_BASE_DIR } /install/position_test )
file ( REMOVE ${ LOCAL_INSTALL_BASE_DIR } /install/position_test )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2017-02-25 20:13:16 +00:00
2012-12-28 15:40:03 +00:00
#########################################################
# Adding Tests to Ctest
#########################################################
2014-12-19 22:19:50 +00:00
set ( CMAKE_CTEST_COMMAND ctest -V )
add_custom_target ( check COMMAND ${ CMAKE_CTEST_COMMAND } )
2019-03-06 18:16:18 +00:00
if ( NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA )
2020-06-08 18:04:01 +00:00
set ( FLOWGRAPH_TEST_SOURCES
2019-02-10 00:13:02 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s i n g l e _ t e s t _ m a i n . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / c o n t r o l - p l a n e / g n s s _ f l o w g r a p h _ t e s t . c c
)
2020-06-12 22:32:40 +00:00
if ( USE_CMAKE_TARGET_SOURCES )
2020-06-08 18:04:01 +00:00
add_executable ( flowgraph_test )
target_sources ( flowgraph_test PRIVATE ${ FLOWGRAPH_TEST_SOURCES } )
else ( )
add_executable ( flowgraph_test ${ FLOWGRAPH_TEST_SOURCES } )
endif ( )
2021-01-16 13:37:19 +00:00
2019-02-10 00:13:02 +00:00
target_link_libraries ( flowgraph_test
2020-06-08 18:04:01 +00:00
P R I V A T E
2019-02-10 00:13:02 +00:00
B o o s t : : t h r e a d
G n u r a d i o : : r u n t i m e
G T e s t : : G T e s t
G T e s t : : M a i n
V o l k g n s s s d r : : v o l k g n s s s d r
s i g n a l _ s o u r c e _ a d a p t e r s
i n p u t _ f i l t e r _ a d a p t e r s
c h a n n e l _ a d a p t e r s
2019-02-10 17:34:28 +00:00
c o r e _ r e c e i v e r
a l g o r i t h m s _ l i b s
2019-02-10 00:13:02 +00:00
)
2024-04-29 06:27:33 +00:00
if ( ENABLE_GLOG_AND_GFLAGS )
target_link_libraries ( flowgraph_test PRIVATE Gflags::gflags Glog::glog )
target_compile_definitions ( flowgraph_test PRIVATE -DUSE_GLOG_AND_GFLAGS=1 )
else ( )
2024-07-10 12:28:16 +00:00
target_link_libraries ( flowgraph_test PRIVATE absl::flags absl::flags_parse absl::log absl::log_initialize )
target_link_libraries ( flowgraph_test INTERFACE "$<LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags>" )
2024-04-29 06:27:33 +00:00
endif ( )
2019-02-10 00:13:02 +00:00
target_include_directories ( flowgraph_test
2020-06-08 18:04:01 +00:00
P R I V A T E
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ S O U R C E _ D I R } / s r c / a l g o r i t h m s / l i b s
2019-02-10 00:13:02 +00:00
)
2024-04-12 16:15:33 +00:00
2024-04-13 07:03:46 +00:00
xcode_remove_warning_duplicates ( flowgraph_test )
2024-04-12 16:15:33 +00:00
2019-02-10 00:13:02 +00:00
add_test ( flowgraph_test flowgraph_test )
2019-02-03 18:24:44 +00:00
2019-02-10 00:13:02 +00:00
set_property ( TEST flowgraph_test PROPERTY TIMEOUT 30 )
endif ( )
2019-02-07 16:05:26 +00:00
2014-12-24 10:26:36 +00:00
2018-03-01 16:30:47 +00:00
#########################################################
2019-03-06 18:16:18 +00:00
if ( NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA )
2020-06-08 18:04:01 +00:00
set ( GNSS_BLOCK_TEST_SOURCES
2019-02-10 00:13:02 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s i n g l e _ t e s t _ m a i n . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / s o u r c e s / f i l e _ s i g n a l _ s o u r c e _ t e s t . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / f i l t e r / f i r _ f i l t e r _ t e s t . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / f i l t e r / p u l s e _ b l a n k i n g _ f i l t e r _ t e s t . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / f i l t e r / n o t c h _ f i l t e r _ t e s t . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / f i l t e r / n o t c h _ f i l t e r _ l i t e _ t e s t . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / a d a p t e r / p a s s _ t h r o u g h _ t e s t . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / a d a p t e r / a d a p t e r _ t e s t . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / c o n t r o l - p l a n e / g n s s _ b l o c k _ f a c t o r y _ t e s t . c c
)
2020-06-12 22:32:40 +00:00
if ( USE_CMAKE_TARGET_SOURCES )
2020-06-08 18:04:01 +00:00
add_executable ( gnss_block_test )
target_sources ( gnss_block_test PRIVATE ${ GNSS_BLOCK_TEST_SOURCES } )
else ( )
add_executable ( gnss_block_test ${ GNSS_BLOCK_TEST_SOURCES } )
endif ( )
2021-01-16 13:37:19 +00:00
2019-02-10 00:13:02 +00:00
target_link_libraries ( gnss_block_test
2020-06-08 18:04:01 +00:00
P R I V A T E
2019-02-10 00:13:02 +00:00
B o o s t : : t h r e a d
G n u r a d i o : : r u n t i m e
G n u r a d i o : : b l o c k s
G n u r a d i o : : f i l t e r
G n u r a d i o : : a n a l o g
G T e s t : : G T e s t
G T e s t : : M a i n
V o l k g n s s s d r : : v o l k g n s s s d r
s i g n a l _ s o u r c e _ a d a p t e r s
2019-02-10 17:34:28 +00:00
d a t a _ t y p e _ a d a p t e r s
2019-02-10 00:13:02 +00:00
i n p u t _ f i l t e r _ a d a p t e r s
c h a n n e l _ a d a p t e r s
2019-02-10 17:34:28 +00:00
c o r e _ r e c e i v e r
a l g o r i t h m s _ l i b s
2019-02-10 00:13:02 +00:00
)
2024-04-29 06:27:33 +00:00
if ( ENABLE_GLOG_AND_GFLAGS )
target_link_libraries ( gnss_block_test PRIVATE Gflags::gflags Glog::glog )
target_compile_definitions ( gnss_block_test PRIVATE -DUSE_GLOG_AND_GFLAGS=1 )
else ( )
2024-07-10 12:28:16 +00:00
target_link_libraries ( gnss_block_test PRIVATE absl::flags absl::flags_parse absl::log absl::log_initialize )
target_link_libraries ( gnss_block_test INTERFACE "$<LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags>" )
2024-04-29 06:27:33 +00:00
endif ( )
2019-02-10 00:13:02 +00:00
2020-06-13 08:25:28 +00:00
target_include_directories ( gnss_block_test
2022-07-28 08:37:36 +00:00
P R I V A T E $ { G N S S S D R _ S O U R C E _ D I R } / s r c / a l g o r i t h m s / l i b s
I N T E R F A C E $ { G N S S S D R _ S O U R C E _ D I R } / s r c / t e s t s / c o m m o n - f i l e s
2020-06-13 08:25:28 +00:00
)
2019-02-07 16:21:32 +00:00
2019-02-10 12:52:37 +00:00
if ( ENABLE_FPGA )
2020-06-08 18:04:01 +00:00
target_compile_definitions ( gnss_block_test PRIVATE -DENABLE_FPGA=1 )
2019-02-10 12:52:37 +00:00
endif ( )
2024-01-23 10:03:03 +00:00
2024-04-13 07:03:46 +00:00
xcode_remove_warning_duplicates ( gnss_block_test )
2024-04-12 16:15:33 +00:00
2019-02-10 00:13:02 +00:00
add_test ( gnss_block_test gnss_block_test )
2019-02-07 16:21:32 +00:00
2019-02-10 00:13:02 +00:00
set_property ( TEST gnss_block_test PROPERTY TIMEOUT 60 )
endif ( )
2019-02-07 16:21:32 +00:00
2018-03-01 16:30:47 +00:00
#########################################################
2019-03-06 18:16:18 +00:00
if ( NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA )
2020-06-08 18:04:01 +00:00
set ( GNURADIO_BLOCK_TEST_SOURCES
2019-02-10 00:13:02 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s i n g l e _ t e s t _ m a i n . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / s o u r c e s / u n p a c k _ 2 b i t _ s a m p l e s _ t e s t . c c
)
2020-06-12 22:32:40 +00:00
if ( USE_CMAKE_TARGET_SOURCES )
2020-06-08 18:04:01 +00:00
add_executable ( gnuradio_block_test )
target_sources ( gnuradio_block_test PRIVATE ${ GNURADIO_BLOCK_TEST_SOURCES } )
else ( )
add_executable ( gnuradio_block_test ${ GNURADIO_BLOCK_TEST_SOURCES } )
endif ( )
2021-01-16 13:37:19 +00:00
2019-02-10 00:13:02 +00:00
target_link_libraries ( gnuradio_block_test
2020-06-08 18:04:01 +00:00
P R I V A T E
2019-02-10 00:13:02 +00:00
B o o s t : : t h r e a d
G n u r a d i o : : r u n t i m e
G n u r a d i o : : b l o c k s
G n u r a d i o : : f i l t e r
G n u r a d i o : : a n a l o g
G T e s t : : G T e s t
G T e s t : : M a i n
V o l k g n s s s d r : : v o l k g n s s s d r
s i g n a l _ s o u r c e _ g r _ b l o c k s
2019-02-10 17:34:28 +00:00
s i g n a l _ s o u r c e _ l i b s
c o r e _ r e c e i v e r
a l g o r i t h m s _ l i b s
2019-02-10 00:13:02 +00:00
)
2024-04-29 06:27:33 +00:00
if ( ENABLE_GLOG_AND_GFLAGS )
target_link_libraries ( gnuradio_block_test PRIVATE Gflags::gflags Glog::glog )
target_compile_definitions ( gnuradio_block_test PRIVATE -DUSE_GLOG_AND_GFLAGS=1 )
else ( )
2024-07-10 12:28:16 +00:00
target_link_libraries ( gnuradio_block_test PRIVATE absl::flags absl::flags_parse absl::log absl::log_initialize )
target_link_libraries ( gnuradio_block_test INTERFACE "$<LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags>" )
2024-04-29 06:27:33 +00:00
endif ( )
2024-01-23 10:03:03 +00:00
2024-04-13 07:03:46 +00:00
xcode_remove_warning_duplicates ( gnuradio_block_test )
2024-01-23 10:03:03 +00:00
2019-02-10 00:13:02 +00:00
add_test ( gnuradio_block_test gnuradio_block_test )
2019-02-07 16:21:32 +00:00
2019-02-10 00:13:02 +00:00
set_property ( TEST gnuradio_block_test PROPERTY TIMEOUT 30 )
endif ( )
2018-03-01 16:30:47 +00:00
2015-10-01 19:55:33 +00:00
2019-02-10 00:13:02 +00:00
#########################################################
2020-06-08 18:04:01 +00:00
set ( MATIO_TEST_SOURCES
2019-02-10 00:13:02 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s i n g l e _ t e s t _ m a i n . c c
2018-11-24 17:40:34 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / a r i t h m e t i c / m a t i o _ t e s t . c c
)
2020-06-12 22:32:40 +00:00
if ( USE_CMAKE_TARGET_SOURCES )
2020-06-08 18:04:01 +00:00
add_executable ( matio_test )
target_sources ( matio_test PRIVATE ${ MATIO_TEST_SOURCES } )
else ( )
add_executable ( matio_test ${ MATIO_TEST_SOURCES } )
endif ( )
2019-02-10 00:13:02 +00:00
2019-02-03 18:24:44 +00:00
target_link_libraries ( matio_test
2020-06-08 18:04:01 +00:00
P R I V A T E
2021-01-16 13:37:19 +00:00
a l g o r i t h m s _ l i b s
2019-02-07 21:06:48 +00:00
G T e s t : : G T e s t
G T e s t : : M a i n
M a t i o : : m a t i o
2019-02-10 17:34:28 +00:00
c o r e _ r e c e i v e r
2018-11-24 17:40:34 +00:00
)
2019-02-03 18:24:44 +00:00
2024-04-29 06:27:33 +00:00
if ( ENABLE_GLOG_AND_GFLAGS )
target_link_libraries ( matio_test PRIVATE Gflags::gflags Glog::glog )
target_compile_definitions ( matio_test PRIVATE -DUSE_GLOG_AND_GFLAGS=1 )
else ( )
2024-07-10 12:28:16 +00:00
target_link_libraries ( matio_test PRIVATE absl::flags absl::flags_parse absl::log absl::log_initialize )
target_link_libraries ( matio_test INTERFACE "$<LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags>" )
2024-04-29 06:27:33 +00:00
endif ( )
2020-06-13 08:25:28 +00:00
target_include_directories ( matio_test
I N T E R F A C E
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ S O U R C E _ D I R } / s r c / t e s t s / c o m m o n - f i l e s
2020-06-13 08:25:28 +00:00
)
2024-01-23 10:03:03 +00:00
2024-04-13 07:03:46 +00:00
xcode_remove_warning_duplicates ( matio_test )
2024-04-12 16:15:33 +00:00
2018-02-23 23:13:35 +00:00
add_test ( matio_test matio_test )
2019-02-03 18:24:44 +00:00
2018-11-18 12:00:36 +00:00
set_property ( TEST matio_test PROPERTY TIMEOUT 30 )
2018-03-01 16:30:47 +00:00
2019-02-10 00:13:02 +00:00
2018-03-01 16:30:47 +00:00
#########################################################
2019-03-06 18:16:18 +00:00
if ( NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA )
2020-06-08 18:04:01 +00:00
set ( ACQ_TEST_SOURCES
2019-02-10 00:13:02 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s i n g l e _ t e s t _ m a i n . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / a c q u i s i t i o n / g p s _ l 1 _ c a _ p c p s _ a c q u i s i t i o n _ t e s t . c c
)
2020-06-12 22:32:40 +00:00
if ( USE_CMAKE_TARGET_SOURCES )
2020-06-08 18:04:01 +00:00
add_executable ( acq_test )
target_sources ( acq_test PRIVATE ${ ACQ_TEST_SOURCES } )
else ( )
add_executable ( acq_test ${ ACQ_TEST_SOURCES } )
endif ( )
2021-01-16 13:37:19 +00:00
2019-02-10 00:13:02 +00:00
target_link_libraries ( acq_test
2020-06-08 18:04:01 +00:00
P R I V A T E
2019-02-10 00:13:02 +00:00
B o o s t : : t h r e a d
G n u r a d i o : : r u n t i m e
G n u r a d i o : : b l o c k s
G n u r a d i o : : f i l t e r
G n u r a d i o : : a n a l o g
G T e s t : : G T e s t
G T e s t : : M a i n
V o l k g n s s s d r : : v o l k g n s s s d r
2019-02-21 08:59:06 +00:00
s i g n a l _ g e n e r a t o r _ g r _ b l o c k s
2019-02-10 00:13:02 +00:00
s i g n a l _ s o u r c e _ g r _ b l o c k s
2019-02-10 17:34:28 +00:00
s i g n a l _ s o u r c e _ l i b s
a c q u i s i t i o n _ a d a p t e r s
a l g o r i t h m s _ l i b s
2019-02-10 00:13:02 +00:00
s i g n a l _ p r o c e s s i n g _ t e s t i n g _ l i b
2019-02-10 17:34:28 +00:00
c o r e _ r e c e i v e r
2019-02-10 00:13:02 +00:00
)
2024-04-29 06:27:33 +00:00
if ( ENABLE_GLOG_AND_GFLAGS )
target_link_libraries ( acq_test PRIVATE Gflags::gflags Glog::glog )
target_compile_definitions ( acq_test PRIVATE -DUSE_GLOG_AND_GFLAGS=1 )
else ( )
2024-07-10 12:28:16 +00:00
target_link_libraries ( acq_test PRIVATE absl::flags absl::flags_parse absl::log absl::log_initialize )
target_link_libraries ( acq_test INTERFACE "$<LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags>" )
2024-04-29 06:27:33 +00:00
endif ( )
2020-06-13 08:25:28 +00:00
target_include_directories ( acq_test
I N T E R F A C E
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ S O U R C E _ D I R } / s r c / t e s t s / c o m m o n - f i l e s
2020-06-13 08:25:28 +00:00
)
2021-10-30 03:43:22 +00:00
if ( PMT_USES_BOOST_ANY )
target_compile_definitions ( acq_test
P R I V A T E
- D P M T _ U S E S _ B O O S T _ A N Y = 1
)
endif ( )
2024-01-23 10:03:03 +00:00
2024-04-13 07:03:46 +00:00
xcode_remove_warning_duplicates ( acq_test )
2024-04-12 16:15:33 +00:00
2019-02-10 00:13:02 +00:00
add_test ( acq_test acq_test )
2019-02-07 16:05:26 +00:00
2020-06-12 22:32:40 +00:00
if ( USE_GENERIC_LAMBDAS )
2020-04-25 21:03:44 +00:00
set ( has_generic_lambdas HAS_GENERIC_LAMBDA=1 )
set ( no_has_generic_lambdas HAS_GENERIC_LAMBDA=0 )
target_compile_definitions ( acq_test
P R I V A T E
" $ < $ < C O M P I L E _ F E A T U R E S : c x x _ g e n e r i c _ l a m b d a s > : $ { h a s _ g e n e r i c _ l a m b d a s } > "
" $ < $ < N O T : $ < C O M P I L E _ F E A T U R E S : c x x _ g e n e r i c _ l a m b d a s > > : $ { n o _ h a s _ g e n e r i c _ l a m b d a s } > "
)
else ( )
target_compile_definitions ( acq_test
P R I V A T E
- D H A S _ G E N E R I C _ L A M B D A = 0
)
endif ( )
2020-06-12 22:32:40 +00:00
if ( USE_BOOST_BIND_PLACEHOLDERS )
2020-05-18 20:50:34 +00:00
target_compile_definitions ( acq_test
P R I V A T E
2020-06-12 22:32:40 +00:00
- D U S E _ B O O S T _ B I N D _ P L A C E H O L D E R S = 1
2020-05-18 20:50:34 +00:00
)
endif ( )
2019-02-10 00:13:02 +00:00
set_property ( TEST acq_test PROPERTY TIMEOUT 30 )
endif ( )
2018-02-23 22:44:57 +00:00
2014-12-21 21:46:57 +00:00
2019-02-10 00:13:02 +00:00
#########################################################
2019-03-06 18:16:18 +00:00
if ( NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA )
2019-06-14 19:16:40 +00:00
set ( NONLINEAR_SOURCES "" )
2019-06-15 08:11:11 +00:00
if ( ARMADILLO_VERSION_STRING VERSION_GREATER 8.400 )
2019-06-14 19:16:40 +00:00
set ( NONLINEAR_SOURCES
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / t r a c k i n g / c u b a t u r e _ f i l t e r _ t e s t . c c
2019-11-29 15:40:50 +00:00
# ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/unscented_filter_test.cc
2019-06-14 19:16:40 +00:00
)
endif ( )
2020-06-08 18:04:01 +00:00
set ( TRKTEST_SOURCES
2019-02-10 00:13:02 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s i n g l e _ t e s t _ m a i n . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / t r a c k i n g / g a l i l e o _ e 1 _ d l l _ p l l _ v e m l _ t r a c k i n g _ t e s t . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / t r a c k i n g / t r a c k i n g _ l o o p _ f i l t e r _ t e s t . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / t r a c k i n g / c p u _ m u l t i c o r r e l a t o r _ r e a l _ c o d e s _ t e s t . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / t r a c k i n g / b a y e s i a n _ e s t i m a t i o n _ t e s t . c c
2019-06-14 19:16:40 +00:00
$ { N O N L I N E A R _ S O U R C E S }
2019-02-10 00:13:02 +00:00
)
2020-06-12 22:32:40 +00:00
if ( USE_CMAKE_TARGET_SOURCES )
2020-06-08 18:04:01 +00:00
add_executable ( trk_test )
target_sources ( trk_test PRIVATE ${ TRKTEST_SOURCES } )
else ( )
add_executable ( trk_test ${ TRKTEST_SOURCES } )
endif ( )
2018-02-23 22:44:57 +00:00
2019-02-10 00:13:02 +00:00
target_link_libraries ( trk_test
2020-06-08 18:04:01 +00:00
P R I V A T E
2019-02-10 00:13:02 +00:00
B o o s t : : t h r e a d
G n u r a d i o : : r u n t i m e
G n u r a d i o : : b l o c k s
G n u r a d i o : : f i l t e r
G n u r a d i o : : a n a l o g
G T e s t : : G T e s t
G T e s t : : M a i n
V o l k g n s s s d r : : v o l k g n s s s d r
s i g n a l _ s o u r c e _ g r _ b l o c k s
2019-02-10 17:34:28 +00:00
s i g n a l _ s o u r c e _ l i b s
a l g o r i t h m s _ l i b s
2019-02-10 00:13:02 +00:00
t r a c k i n g _ a d a p t e r s
2019-02-21 08:59:06 +00:00
s i g n a l _ g e n e r a t o r _ g r _ b l o c k s
2019-02-10 17:34:28 +00:00
c o r e _ r e c e i v e r
2019-02-10 00:13:02 +00:00
)
2024-04-29 06:27:33 +00:00
if ( ENABLE_GLOG_AND_GFLAGS )
target_link_libraries ( trk_test PRIVATE Gflags::gflags Glog::glog )
target_compile_definitions ( trk_test PRIVATE -DUSE_GLOG_AND_GFLAGS=1 )
else ( )
2024-07-10 12:28:16 +00:00
target_link_libraries ( trk_test PRIVATE absl::flags absl::flags_parse absl::log absl::log_initialize )
target_link_libraries ( trk_test INTERFACE "$<LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags>" )
2024-04-29 06:27:33 +00:00
endif ( )
2020-06-12 22:32:40 +00:00
if ( USE_GENERIC_LAMBDAS )
2020-04-26 06:41:49 +00:00
set ( has_generic_lambdas HAS_GENERIC_LAMBDA=1 )
set ( no_has_generic_lambdas HAS_GENERIC_LAMBDA=0 )
target_compile_definitions ( trk_test
P R I V A T E
" $ < $ < C O M P I L E _ F E A T U R E S : c x x _ g e n e r i c _ l a m b d a s > : $ { h a s _ g e n e r i c _ l a m b d a s } > "
" $ < $ < N O T : $ < C O M P I L E _ F E A T U R E S : c x x _ g e n e r i c _ l a m b d a s > > : $ { n o _ h a s _ g e n e r i c _ l a m b d a s } > "
)
else ( )
target_compile_definitions ( trk_test
P R I V A T E
- D H A S _ G E N E R I C _ L A M B D A = 0
)
endif ( )
2020-06-12 22:32:40 +00:00
if ( USE_BOOST_BIND_PLACEHOLDERS )
2020-05-18 20:50:34 +00:00
target_compile_definitions ( trk_test
P R I V A T E
2020-06-12 22:32:40 +00:00
- D U S E _ B O O S T _ B I N D _ P L A C E H O L D E R S = 1
2020-05-18 20:50:34 +00:00
)
endif ( )
2021-10-30 03:43:22 +00:00
if ( PMT_USES_BOOST_ANY )
target_compile_definitions ( trk_test
P R I V A T E
- D P M T _ U S E S _ B O O S T _ A N Y = 1
)
endif ( )
2024-01-23 10:03:03 +00:00
2024-04-13 07:03:46 +00:00
xcode_remove_warning_duplicates ( trk_test )
2024-04-12 16:15:33 +00:00
2019-02-10 00:13:02 +00:00
add_test ( trk_test trk_test )
2018-11-18 12:00:36 +00:00
2019-02-10 00:13:02 +00:00
set_property ( TEST trk_test PROPERTY TIMEOUT 30 )
endif ( )
2017-04-13 18:29:56 +00:00
2018-03-01 20:02:48 +00:00
#########################################################
2019-03-06 18:16:18 +00:00
if ( NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA )
2020-06-08 18:04:01 +00:00
set ( CONTROL_THREAD_TEST_SOURCES
2019-02-10 00:13:02 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s i n g l e _ t e s t _ m a i n . c c
2018-11-24 17:40:34 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / c o n t r o l - p l a n e / c o n t r o l _ t h r e a d _ t e s t . c c
)
2020-06-12 22:32:40 +00:00
if ( USE_CMAKE_TARGET_SOURCES )
2020-06-08 18:04:01 +00:00
add_executable ( control_thread_test )
target_sources ( control_thread_test PRIVATE ${ CONTROL_THREAD_TEST_SOURCES } )
else ( )
add_executable ( control_thread_test ${ CONTROL_THREAD_TEST_SOURCES } )
endif ( )
2018-03-01 20:02:48 +00:00
2019-02-10 00:13:02 +00:00
target_link_libraries ( control_thread_test
2020-06-08 18:04:01 +00:00
P R I V A T E
2019-02-10 00:13:02 +00:00
B o o s t : : t h r e a d
G T e s t : : G T e s t
G T e s t : : M a i n
s i g n a l _ s o u r c e _ a d a p t e r s
2019-02-10 17:34:28 +00:00
a l g o r i t h m s _ l i b s
c o r e _ r e c e i v e r
2018-11-24 17:40:34 +00:00
)
2024-04-29 06:27:33 +00:00
if ( ENABLE_GLOG_AND_GFLAGS )
target_link_libraries ( control_thread_test PRIVATE Gflags::gflags Glog::glog )
target_compile_definitions ( control_thread_test PRIVATE -DUSE_GLOG_AND_GFLAGS=1 )
else ( )
2024-07-10 12:28:16 +00:00
target_link_libraries ( control_thread_test PRIVATE absl::flags absl::flags_parse absl::log absl::log_initialize )
target_link_libraries ( control_thread_test INTERFACE "$<LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags>" )
2024-04-29 06:27:33 +00:00
endif ( )
2024-01-23 10:03:03 +00:00
2024-04-13 07:03:46 +00:00
xcode_remove_warning_duplicates ( control_thread_test )
2024-01-23 10:03:03 +00:00
2018-03-01 20:02:48 +00:00
add_test ( control_thread_test control_thread_test )
2019-02-07 16:05:26 +00:00
2018-03-01 20:02:48 +00:00
set_property ( TEST control_thread_test PROPERTY TIMEOUT 30 )
2018-11-24 17:40:34 +00:00
endif ( )
2018-03-01 20:02:48 +00:00
#########################################################
if ( ENABLE_PACKAGING )
2019-02-03 18:24:44 +00:00
add_dependencies ( check matio_test )
2018-11-24 17:40:34 +00:00
else ( )
2019-03-06 18:16:18 +00:00
if ( ENABLE_FPGA )
add_dependencies ( check matio_test )
else ( )
2019-04-02 00:41:20 +00:00
add_dependencies ( check
c o n t r o l _ t h r e a d _ t e s t
f l o w g r a p h _ t e s t
g n s s _ b l o c k _ t e s t
g n u r a d i o _ b l o c k _ t e s t
a c q _ t e s t
t r k _ t e s t
m a t i o _ t e s t
)
2019-03-06 18:16:18 +00:00
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2020-06-21 19:10:22 +00:00
2024-04-18 22:47:31 +00:00
2024-05-20 09:24:31 +00:00
######################################################### osnma_msg_receiver_test
2024-04-18 22:47:31 +00:00
if ( NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA )
set ( OSNMA_MSG_RECEIVER_TEST_SOURCES
2024-06-23 09:10:40 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s i n g l e _ t e s t _ m a i n . c c
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / u n i t - t e s t s / s i g n a l - p r o c e s s i n g - b l o c k s / o s n m a / o s n m a _ m s g _ r e c e i v e r _ t e s t . c c
)
2024-04-18 22:47:31 +00:00
if ( USE_CMAKE_TARGET_SOURCES )
add_executable ( osnma_msg_receiver_test )
target_sources ( osnma_msg_receiver_test PRIVATE ${ OSNMA_MSG_RECEIVER_TEST_SOURCES } )
else ( )
add_executable ( osnma_msg_receiver_test ${ OSNMA_MSG_RECEIVER_TEST_SOURCES } )
endif ( )
target_link_libraries ( osnma_msg_receiver_test
2024-06-23 09:10:40 +00:00
P R I V A T E
g n s s _ s d r _ f l a g s
2024-04-18 22:47:31 +00:00
B o o s t : : t h r e a d
G T e s t : : G T e s t
G T e s t : : M a i n
c o r e _ l i b s
2024-06-29 09:10:35 +00:00
G n u r a d i o : : b l o c k s
G n u r a d i o : : r u n t i m e
G n u r a d i o : : f i l t e r # workaround for old systems
2024-04-18 22:47:31 +00:00
)
2024-05-20 09:24:31 +00:00
if ( ENABLE_GLOG_AND_GFLAGS )
target_link_libraries ( osnma_msg_receiver_test PRIVATE Gflags::gflags Glog::glog )
target_compile_definitions ( osnma_msg_receiver_test PRIVATE -DUSE_GLOG_AND_GFLAGS=1 )
else ( )
target_link_libraries ( osnma_msg_receiver_test PRIVATE absl::flags absl::flags_parse absl::log $< LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags > absl::log_initialize )
endif ( )
xcode_remove_warning_duplicates ( osnma_msg_receiver_test ) # TODO - unsure if needed
add_test ( osnma_msg_receiver_test osnma_msg_receiver_test )
2024-06-23 09:10:40 +00:00
set_property ( TEST osnma_msg_receiver_test PROPERTY TIMEOUT 30 )
2024-04-18 22:47:31 +00:00
target_include_directories ( osnma_msg_receiver_test
2024-06-23 09:10:40 +00:00
P R I V A T E
$ { G N S S S D R _ S O U R C E _ D I R } / s r c / c o r e / s y s t e m _ p a r a m e t e r s
)
2024-05-20 09:24:31 +00:00
endif ( )
if ( ENABLE_BENCHMARKS )
add_subdirectory ( benchmarks )
endif ( )