-
Notifications
You must be signed in to change notification settings - Fork 583
/
CMakeLists.txt
1420 lines (1325 loc) · 66 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
# This file is part of GNSS-SDR.
#
# SPDX-FileCopyrightText: 2010-2024 C. Fernandez-Prades cfernandez(at)cttc.es
# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(unit-tests/signal-processing-blocks/libs)
add_subdirectory(system-tests/libs)
include_directories("${GNSSSDR_SOURCE_DIR}/src/core/receiver")
include(XcodeRemoveWarningDuplicates)
################################################################################
# Google Test - https://github.com/google/googletest
################################################################################
set(GTEST_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
set(TOOLCHAIN_ARG "")
if(DEFINED ENV{OECORE_TARGET_SYSROOT})
set(GTEST_COMPILER "")
set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${GNSSSDR_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake")
else()
if(CMAKE_TOOLCHAIN_FILE)
set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
endif()
if(ENABLE_PACKAGING)
set(TOOLCHAIN_ARG "-DCMAKE_VERBOSE_MAKEFILE=ON")
endif()
endif()
if(NOT GOOGLETEST_FOUND)
set(GTEST_BUILD_COMMAND "${CMAKE_COMMAND}"
"--build" "${GNSSSDR_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}"
"--config" $<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo>$<$<CONFIG:MinSizeRel>:MinSizeRel>$<$<CONFIG:NoOptWithASM>:Debug>$<$<CONFIG:Coverage>:Debug>$<$<CONFIG:O2WithASM>:RelWithDebInfo>$<$<CONFIG:O3WithASM>:RelWithDebInfo>$<$<CONFIG:ASAN>:Debug>
)
if(CMAKE_VERSION VERSION_GREATER 3.12 AND NOT CMAKE_CROSSCOMPILING)
# Parallel building of gtest causes problems in some environments (e.g. Macports buildings)
set(GTEST_BUILD_COMMAND ${GTEST_BUILD_COMMAND} "--parallel 1")
endif()
if(CMAKE_GENERATOR STREQUAL Xcode)
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")
endif()
if(GNSSSDR_GTEST_LOCAL_VERSION VERSION_LESS 1.12.0)
set(DEBUG_DECORATION "d")
else()
set(DEBUG_DECORATION "")
endif()
if(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/google/googletest
GIT_TAG v${GNSSSDR_GTEST_LOCAL_VERSION}
SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
BINARY_DIR ${GNSSSDR_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
CMAKE_ARGS ${GTEST_COMPILER}
-DINSTALL_GTEST=OFF
-DBUILD_GMOCK=OFF
-Dgtest_hide_internal_symbols=ON
${TOOLCHAIN_ARG}
-DCMAKE_BUILD_TYPE=$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo>$<$<CONFIG:MinSizeRel>:MinSizeRel>$<$<CONFIG:NoOptWithASM>:Debug>$<$<CONFIG:Coverage>:Debug>$<$<CONFIG:O2WithASM>:RelWithDebInfo>$<$<CONFIG:O3WithASM>:RelWithDebInfo>$<$<CONFIG:ASAN>:Debug>
BUILD_COMMAND ${GTEST_BUILD_COMMAND}
UPDATE_COMMAND ""
PATCH_COMMAND ""
INSTALL_COMMAND ""
)
else()
set(GOOGLETEST_BUILD_BYPRODUCTS
${GNSSSDR_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
${GNSSSDR_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
)
if((CMAKE_BUILD_TYPE STREQUAL Debug) OR (CMAKE_BUILD_TYPE STREQUAL NoOptWithASM) OR
(CMAKE_BUILD_TYPE STREQUAL Coverage) OR (CMAKE_BUILD_TYPE STREQUAL ASAN)) # Workaround for Ninja generator
set(GOOGLETEST_BUILD_BYPRODUCTS
${GNSSSDR_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${DEBUG_DECORATION}${CMAKE_STATIC_LIBRARY_SUFFIX}
${GNSSSDR_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${DEBUG_DECORATION}${CMAKE_STATIC_LIBRARY_SUFFIX}
)
endif()
ExternalProject_Add(gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/google/googletest
GIT_TAG v${GNSSSDR_GTEST_LOCAL_VERSION}
SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
BINARY_DIR ${GNSSSDR_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
CMAKE_ARGS ${GTEST_COMPILER}
-DINSTALL_GTEST=OFF
-DBUILD_GMOCK=OFF
-Dgtest_hide_internal_symbols=ON
${TOOLCHAIN_ARG}
-DCMAKE_BUILD_TYPE=$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo>$<$<CONFIG:MinSizeRel>:MinSizeRel>$<$<CONFIG:NoOptWithASM>:Debug>$<$<CONFIG:Coverage>:Debug>$<$<CONFIG:O2WithASM>:RelWithDebInfo>$<$<CONFIG:O3WithASM>:RelWithDebInfo>$<$<CONFIG:ASAN>:Debug>
BUILD_COMMAND ${GTEST_BUILD_COMMAND}
UPDATE_COMMAND ""
PATCH_COMMAND ""
BUILD_BYPRODUCTS ${GOOGLETEST_BUILD_BYPRODUCTS}
INSTALL_COMMAND ""
)
endif()
ExternalProject_Get_Property(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} binary_dir)
if(NOT TARGET GTest::GTest)
file(MAKE_DIRECTORY ${GNSSSDR_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include)
add_library(GTest::GTest STATIC IMPORTED)
add_dependencies(GTest::GTest gtest-${GNSSSDR_GTEST_LOCAL_VERSION})
set_target_properties(GTest::GTest PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_CONFIGURATIONS "None;Debug;Release;RelWithDebInfo;MinSizeRel"
MAP_IMPORTED_CONFIG_NOOPTWITHASM Debug
MAP_IMPORTED_CONFIG_COVERAGE Debug
MAP_IMPORTED_CONFIG_O2WITHASM RelWithDebInfo
MAP_IMPORTED_CONFIG_O3WITHASM RelWithDebInfo
MAP_IMPORTED_CONFIG_ASAN Debug
IMPORTED_LOCATION_NONE ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_DEBUG ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELEASE ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELWITHDEBINFO ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_MINSIZEREL ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_INCLUDE_DIRECTORIES ${GNSSSDR_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include
INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/gtest$<$<CONFIG:Debug>:${DEBUG_DECORATION}>${CMAKE_STATIC_LIBRARY_SUFFIX}
)
if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC)
set_target_properties(GTest::GTest PROPERTIES
IMPORTED_LOCATION_DEBUG ${binary_dir}/lib/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${DEBUG_DECORATION}${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELEASE ${binary_dir}/lib/Release/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELWITHDEBINFO ${binary_dir}/lib/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_MINSIZEREL ${binary_dir}/lib/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>gtest$<$<CONFIG:Debug>:${DEBUG_DECORATION}>${CMAKE_STATIC_LIBRARY_SUFFIX}
)
endif()
set_target_properties(GTest::GTest PROPERTIES
INTERFACE_LINK_LIBRARIES Threads::Threads
)
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
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_CONFIGURATIONS "None;Debug;Release;RelWithDebInfo;MinSizeRel"
MAP_IMPORTED_CONFIG_NOOPTWITHASM Debug
MAP_IMPORTED_CONFIG_COVERAGE Debug
MAP_IMPORTED_CONFIG_O2WITHASM RelWithDebInfo
MAP_IMPORTED_CONFIG_O3WITHASM RelWithDebInfo
MAP_IMPORTED_CONFIG_ASAN Debug
IMPORTED_LOCATION_NONE ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_DEBUG ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${DEBUG_DECORATION}${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELEASE ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELWITHDEBINFO ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_MINSIZEREL ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_INCLUDE_DIRECTORIES ${GNSSSDR_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include
INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main$<$<CONFIG:Debug>:${DEBUG_DECORATION}>${CMAKE_STATIC_LIBRARY_SUFFIX}
)
if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC)
set_target_properties(GTest::Main PROPERTIES
IMPORTED_LOCATION_DEBUG ${binary_dir}/lib/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${DEBUG_DECORATION}${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELEASE ${binary_dir}/lib/Release/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELWITHDEBINFO ${binary_dir}/lib/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_MINSIZEREL ${binary_dir}/lib/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main$<$<CONFIG:Debug>:${DEBUG_DECORATION}>${CMAKE_STATIC_LIBRARY_SUFFIX}
)
endif()
endif()
else()
if(GTEST_INCLUDE_DIRS)
set(GTEST_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIRS} ${LIBGTEST_DEV_DIR})
add_library(gtest STATIC ${LIBGTEST_DEV_DIR}/src/gtest-all.cc)
target_include_directories(gtest
PUBLIC
${GTEST_INCLUDE_DIRECTORIES}
)
add_library(gtest_main STATIC ${LIBGTEST_DEV_DIR}/src/gtest_main.cc)
target_include_directories(gtest_main
PUBLIC
${GTEST_INCLUDE_DIRECTORIES}
)
if(NOT TARGET GTest::GTest)
add_library(GTest::GTest STATIC IMPORTED)
add_dependencies(GTest::GTest gtest)
set_target_properties(GTest::GTest PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIRS}
INTERFACE_LINK_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
)
if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC)
set_target_properties(GTest::GTest PROPERTIES
IMPORTED_CONFIGURATIONS "Debug;Release;RelWithDebInfo;MinSizeRel"
IMPORTED_LOCATION_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/Release/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_MINSIZEREL ${CMAKE_CURRENT_BINARY_DIR}/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_LINK_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
)
endif()
set_target_properties(GTest::GTest PROPERTIES
INTERFACE_LINK_LIBRARIES Threads::Threads
)
endif()
if(NOT TARGET GTest::Main)
add_library(GTest::Main STATIC IMPORTED)
add_dependencies(GTest::Main gtest_main)
set_target_properties(GTest::Main PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIRS}
INTERFACE_LINK_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
)
if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC)
set_target_properties(GTest::Main PROPERTIES
IMPORTED_CONFIGURATIONS "Debug;Release;RelWithDebInfo;MinSizeRel"
IMPORTED_LOCATION_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/Release/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_MINSIZEREL ${CMAKE_CURRENT_BINARY_DIR}/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_LINK_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
)
endif()
endif()
endif()
endif()
################################################################################
# Definitions
################################################################################
if(GNURADIO_IS_38_OR_GREATER)
add_definitions(-DGR_GREATER_38=1)
endif()
if(OPENSSL_FOUND)
add_definitions(-DUSE_OPENSSL_FALLBACK=1)
endif()
if(ENABLE_OPENCL)
add_definitions(-DOPENCL_BLOCKS_TEST=1)
endif()
if(ENABLE_CUDA)
add_definitions(-DCUDA_BLOCKS_TEST=1)
endif()
if(ENABLE_FPGA)
add_definitions(-DFPGA_BLOCKS_TEST=1)
endif()
if(ARMADILLO_VERSION_STRING VERSION_GREATER 8.400)
# mvnrnd() requires 8.400
add_definitions(-DARMADILLO_HAVE_MVNRND=1)
endif()
if(ENABLE_PACKAGING)
add_definitions(-DEXCLUDE_TESTS_REQUIRING_BINARIES=1)
endif()
if(has_std_plus_void)
add_definitions(-DCOMPILER_HAS_STD_PLUS_VOID=1)
endif()
find_package(GNUPLOT)
if(GNUPLOT_FOUND)
add_definitions(-DGNUPLOT_EXECUTABLE="${GNUPLOT_EXECUTABLE}")
endif()
set_package_properties(GNUPLOT PROPERTIES
URL "http://www.gnuplot.info"
PURPOSE "Used to generate plots in some tests."
TYPE OPTIONAL
)
if(GNUPLOT_FOUND AND GNUPLOT_VERSION_STRING)
set_package_properties(GNUPLOT PROPERTIES
DESCRIPTION "A portable command-line driven graphing utility (found: v${GNUPLOT_VERSION_STRING})"
)
else()
set_package_properties(GNUPLOT PROPERTIES
DESCRIPTION "A portable command-line driven graphing utility"
)
endif()
if(ENABLE_UNIT_TESTING_MINIMAL)
add_definitions(-DUNIT_TESTING_MINIMAL=1)
endif()
################################################################################
# gnsstk and optional generator
################################################################################
if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
if(ENABLE_FPGA)
set(CROSS_INSTALL_DIR "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
if(DEFINED ENV{OECORE_TARGET_SYSROOT})
set(CROSS_INSTALL_DIR "${CROSS_INSTALL_DIR} -DBOOST_ROOT=$ENV{OECORE_TARGET_SYSROOT}/usr")
endif()
else()
set(CROSS_INSTALL_DIR "")
endif()
find_package(GNSSSIMULATOR QUIET)
if(GNSSSIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL)
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()
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()
set(GNSS_SIM_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}")
if(CMAKE_GENERATOR STREQUAL Xcode)
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")
endif()
if(TOOLCHAIN_ARG)
set(TOOLCHAIN_ARG_GNSS_SIM "-DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON")
else()
set(TOOLCHAIN_ARG_GNSS_SIM "")
endif()
ExternalProject_Add(gnss-sim
GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator
GIT_TAG ${GNSSSDR_GNSS_SIM_LOCAL_VERSION}
SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/gnss-sim
BINARY_DIR ${GNSSSDR_BINARY_DIR}/gnss-sim
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} ${CROSS_INSTALL_DIR} ${TOOLCHAIN_ARG_GNSS_SIM}
BUILD_COMMAND ${GNSS_SIM_BUILD_COMMAND}
UPDATE_COMMAND ""
PATCH_COMMAND ""
INSTALL_COMMAND ""
)
if(ENABLE_INSTALL_TESTS)
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)
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()
set(SW_GENERATOR_BIN ${GNSSSDR_BINARY_DIR}/gnss-sim/gnss_sim)
if(CMAKE_GENERATOR STREQUAL Xcode)
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)
endif()
add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}")
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")
endif()
endif()
############################################################################
# Local installation of gnsstk https://github.com/SGL-UT/gnsstk
############################################################################
if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK)
set_package_properties(GNSSTK PROPERTIES
PURPOSE "GNSSTk v${GNSSSDR_GNSSTK_LOCAL_VERSION} will be automatically downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'."
)
if("${TOOLCHAIN_ARG}" STREQUAL "")
set(TOOLCHAIN_ARG "-DCMAKE_CXX_FLAGS=-Wno-deprecated")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
endif()
set(GNSSTK_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}")
if(CMAKE_GENERATOR STREQUAL Xcode)
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>)
endif()
include(GNUInstallDirs)
find_program(Patch_EXECUTABLE NAME patch PATHS ENV PATH)
if(NOT Patch_EXECUTABLE)
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.")
endif()
if(CMAKE_VERSION VERSION_GREATER 3.17.0)
set(GNSSTK_PATCH_COMMAND
cd ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} &&
${Patch_EXECUTABLE} ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/CMakeLists.txt < ${GNSSSDR_SOURCE_DIR}/src/tests/data/gnsstk_static14.patch &&
${Patch_EXECUTABLE} ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/core/lib/GNSSCore/ObsID.hpp < ${GNSSSDR_SOURCE_DIR}/src/tests/data/gnsstk_gcc13.patch
)
else()
set(GNSSTK_PATCH_COMMAND
cd ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} &&
${Patch_EXECUTABLE} ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/CMakeLists.txt < ${GNSSSDR_SOURCE_DIR}/src/tests/data/gnsstk_static13.patch &&
${Patch_EXECUTABLE} ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/core/lib/GNSSCore/ObsID.hpp < ${GNSSSDR_SOURCE_DIR}/src/tests/data/gnsstk_gcc13.patch
)
endif()
# Patch only once
if(EXISTS ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/CMakeLists.txt)
set(GNSSTK_PATCH_COMMAND "")
endif()
if(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/SGL-UT/gnsstk
GIT_TAG v${GNSSSDR_GNSSTK_LOCAL_VERSION}
SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
BINARY_DIR ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
PATCH_COMMAND ${GNSSTK_PATCH_COMMAND}
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG}
-DCMAKE_INSTALL_PREFIX=${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install
-DBUILD_EXT=ON
-DBUILD_PYTHON=OFF
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_STANDARD=11
-DCMAKE_CXX_EXTENSIONS=ON
-DCMAKE_C_STANDARD=11
-DCMAKE_C_EXTENSIONS=ON
BUILD_COMMAND ${GNSSTK_BUILD_COMMAND}
UPDATE_COMMAND ""
)
else()
if(CMAKE_MAKE_PROGRAM MATCHES "make")
include(ProcessorCount)
ProcessorCount(NUMBER_OF_PROCESSORS)
if(NUMBER_OF_PROCESSORS GREATER 1)
set(GNSSTK_PARALLEL_BUILD "-j${NUMBER_OF_PROCESSORS}")
endif()
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(GNSSTK_FLAGS "-DCMAKE_CXX_FLAGS:STRING=-w") # Fix for clang in aarch64
endif()
if(CMAKE_VERSION VERSION_GREATER 3.17.0)
set(GNSSTK_CXX_STANDARD 17)
if((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND ("${DARWIN_VERSION}" VERSION_GREATER_EQUAL "14"))
set(GNSSTK_CXX_STANDARD 14)
endif()
ExternalProject_Add(gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/SGL-UT/gnsstk
GIT_TAG v${GNSSSDR_GNSSTK_LOCAL_VERSION}
GIT_SUBMODULES_RECURSE OFF
GIT_SUBMODULES ""
SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
BINARY_DIR ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
PATCH_COMMAND ${GNSSTK_PATCH_COMMAND}
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG}
-DCMAKE_INSTALL_PREFIX=${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install
-DBUILD_EXT=ON
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_STANDARD=${GNSSTK_CXX_STANDARD}
-DCMAKE_CXX_EXTENSIONS=ON
-DCMAKE_C_STANDARD=11
-DCMAKE_C_EXTENSIONS=ON
"${GNSSTK_FLAGS}"
BUILD_COMMAND ${GNSSTK_BUILD_COMMAND} ${GNSSTK_PARALLEL_BUILD}
BUILD_BYPRODUCTS ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX}
UPDATE_COMMAND ""
)
else()
ExternalProject_Add(gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/SGL-UT/gnsstk
GIT_TAG v${GNSSSDR_GNSSTK_LOCAL_VERSION}
SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
BINARY_DIR ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
PATCH_COMMAND ${GNSSTK_PATCH_COMMAND}
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG}
-DCMAKE_INSTALL_PREFIX=${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install
-DBUILD_EXT=ON
-DBUILD_PYTHON=OFF
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_STANDARD=14
-DCMAKE_CXX_EXTENSIONS=ON
-DCMAKE_C_STANDARD=11
-DCMAKE_C_EXTENSIONS=ON
BUILD_COMMAND ${GNSSTK_BUILD_COMMAND} ${GNSSTK_PARALLEL_BUILD}
BUILD_BYPRODUCTS ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX}
UPDATE_COMMAND ""
)
endif()
endif()
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/)
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
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GNSSTK_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GNSSTK_INCLUDE_DIRS};${GNSSTK_INCLUDE_DIRS}/gnsstk"
INTERFACE_LINK_LIBRARIES "${GNSSTK_LIBRARY}"
)
else()
set(GNSSTK_BINDIR ${GNSSTK_INCLUDE_DIR}/../bin/)
add_definitions(-DGNSSTK_BINDIR="${GNSSTK_BINDIR}")
endif()
endif()
if(NOT (ENABLE_PACKAGING OR ENABLE_UNIT_TESTING_MINIMAL))
message(STATUS "Downloading some data files for testing ...")
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
${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat
SHOW_PROGRESS
EXPECTED_HASH MD5=d57a02d3c7361bba2e137329b66458ef
STATUS status_download
)
list(GET status_download 0 result_download)
if(NOT (${result_download} EQUAL 0))
file(REMOVE ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat)
endif()
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
${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat
SHOW_PROGRESS
EXPECTED_HASH MD5=f12ada80a2ad1bab061262e010643529
STATUS status_download
)
list(GET status_download 0 result_download)
if(NOT (${result_download} EQUAL 0))
file(REMOVE ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat)
endif()
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
${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat
SHOW_PROGRESS
EXPECTED_HASH MD5=b98d6d82885354f168f279817de284b5
STATUS status_download
)
list(GET status_download 0 result_download)
if(NOT (${result_download} EQUAL 0))
file(REMOVE ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat)
endif()
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
${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin
SHOW_PROGRESS
EXPECTED_HASH MD5=0e2dc212309141d236897bc0af187074
STATUS status_download
)
list(GET status_download 0 result_download)
if(NOT (${result_download} EQUAL 0))
file(REMOVE ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin)
endif()
endif()
message(STATUS "Done.")
endif()
if(ENABLE_UNIT_TESTING_EXTRA)
add_definitions(-DEXTRA_TESTS)
message(STATUS "Downloading some extra data files for testing ...")
if(NOT EXISTS ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat)
message(STATUS "Downloading file: gps_l2c_m_prn7_5msps.dat")
file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/gps_l2c_m_prn7_5msps.dat
${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat
SHOW_PROGRESS
EXPECTED_HASH MD5=a6fcbefe155137945d3c33c5ef7bd0f9
STATUS status_download
)
list(GET status_download 0 result_download)
if(NOT (${result_download} EQUAL 0))
file(REMOVE ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat)
endif()
endif()
if(NOT EXISTS ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat)
message(STATUS "Downloading file: Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat")
file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat
${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat
SHOW_PROGRESS
EXPECTED_HASH MD5=ffb72fc63c116be58d5e5ccb1daaed3a
STATUS status_download
)
list(GET status_download 0 result_download)
if(NOT (${result_download} EQUAL 0))
file(REMOVE ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat)
endif()
endif()
if(NOT EXISTS ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat)
message(STATUS "Downloading file: BdsB1IStr01_fs25e6_if0_4ms.dat")
file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/BdsB1IStr01_fs25e6_if0_4ms.dat
${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat
SHOW_PROGRESS
EXPECTED_HASH MD5=5a4336dad9d80f3313a16dec4fff9233
STATUS status_download
)
list(GET status_download 0 result_download)
if(NOT (${result_download} EQUAL 0))
file(REMOVE ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat)
endif()
endif()
if(NOT EXISTS ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/BdsB3IStr01_fs50e6_if0_4ms.dat)
message(STATUS "Downloading file: BdsB3IStr01_fs50e6_if0_4ms.dat")
file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/BdsB3IStr01_fs50e6_if0_4ms.dat
${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/BdsB3IStr01_fs50e6_if0_4ms.dat
SHOW_PROGRESS
EXPECTED_HASH MD5=066d0d8434a8bc81e161778b7c34cc07
STATUS status_download
)
list(GET status_download 0 result_download)
if(NOT (${result_download} EQUAL 0))
file(REMOVE ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/BdsB3IStr01_fs50e6_if0_4ms.dat)
endif()
endif()
if(NOT EXISTS ${GNSSSDR_BINARY_DIR}/thirdparty/osnma_tests/Test_vectors.zip)
message(STATUS "Downloading file: Test_vectors.zip")
file(DOWNLOAD https://www.gsc-europa.eu/sites/default/files/sites/all/files/Test_vectors.zip
${GNSSSDR_BINARY_DIR}/thirdparty/osnma_tests/Test_vectors.zip
SHOW_PROGRESS
EXPECTED_HASH MD5=8158aebee735652c9398e5bb6d944364
STATUS status_download
)
list(GET status_download 0 result_download)
if(${result_download} EQUAL 0)
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xzf ${GNSSSDR_BINARY_DIR}/thirdparty/osnma_tests/Test_vectors.zip
WORKING_DIRECTORY ${GNSSSDR_BINARY_DIR}/thirdparty/osnma_tests/
)
else()
file(REMOVE ${GNSSSDR_BINARY_DIR}/thirdparty/osnma_tests/Test_vectors.zip)
endif()
endif()
message(STATUS "Done.")
if(ENABLE_INSTALL_TESTS)
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)
endif()
endif()
if(NOT ENABLE_PACKAGING)
if(ENABLE_INSTALL_TESTS)
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)
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()
endif()
################################################################################
# Unit testing
################################################################################
if(ENABLE_UNIT_TESTING)
if(USE_CMAKE_TARGET_SOURCES)
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()
target_link_libraries(run_tests
PRIVATE
Boost::thread
Armadillo::armadillo
Gnuradio::runtime
Gnuradio::blocks
Gnuradio::filter
Gnuradio::analog
GTest::GTest
GTest::Main
Matio::matio
Volk::volk
Volkgnsssdr::volkgnsssdr
signal_source_adapters
data_type_adapters
input_filter_adapters
resampler_adapters
channel_adapters
acquisition_adapters
tracking_adapters
tracking_libs
telemetry_decoder_adapters
obs_adapters
signal_generator_adapters
pvt_adapters
pvt_libs
algorithms_libs
core_monitor
signal_processing_testing_lib
system_testing_lib
core_receiver
)
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()
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>")
endif()
target_include_directories(run_tests
INTERFACE
${GNSSSDR_SOURCE_DIR}/src/tests/common-files
)
if(GNURADIO_USES_STD_POINTERS)
target_compile_definitions(run_tests
PRIVATE -DGNURADIO_USES_STD_POINTERS=1
)
endif()
if(PMT_USES_BOOST_ANY)
target_compile_definitions(run_tests
PRIVATE -DPMT_USES_BOOST_ANY=1
)
endif()
if(ENABLE_UNIT_TESTING_EXTRA)
target_link_libraries(run_tests PRIVATE Gnsstk::gnsstk)
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()
if(GNSSTK_OLDER_THAN_9)
target_compile_definitions(run_tests PRIVATE -DGNSSTK_OLDER_THAN_9=1)
endif()
target_compile_definitions(run_tests PRIVATE -DBASE_OSNMA_TEST_VECTORS="${GNSSSDR_BINARY_DIR}/thirdparty/osnma_tests/Test_vectors/")
endif()
xcode_remove_warning_duplicates(run_tests)
if(ENABLE_STRIP)
set_target_properties(run_tests PROPERTIES LINK_FLAGS "-s")
endif()
if(ENABLE_INSTALL_TESTS)
if(EXISTS ${LOCAL_INSTALL_BASE_DIR}/install/run_tests)
file(REMOVE ${LOCAL_INSTALL_BASE_DIR}/install/run_tests)
endif()
install(TARGETS run_tests RUNTIME DESTINATION bin COMPONENT "run_tests")
else()
add_custom_command(TARGET run_tests POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:run_tests>
${LOCAL_INSTALL_BASE_DIR}/install/$<TARGET_FILE_NAME:run_tests>
)
endif()
if(ENABLE_GPERFTOOLS)
if(GPERFTOOLS_FOUND)
target_link_libraries(run_tests
PRIVATE
Gperftools::gperftools
)
endif()
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(run_tests
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
if(ENABLE_CUDA AND NOT CMAKE_VERSION VERSION_GREATER 3.11)
target_link_libraries(run_tests
PRIVATE
${CUDA_LIBRARIES}
)
target_include_directories(run_tests
PRIVATE
${CUDA_INCLUDE_DIRS}
)
endif()
if(USE_GENERIC_LAMBDAS)
set(has_generic_lambdas HAS_GENERIC_LAMBDA=1)
set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0)
target_compile_definitions(run_tests
PRIVATE
"$<$<COMPILE_FEATURES:cxx_generic_lambdas>:${has_generic_lambdas}>"
"$<$<NOT:$<COMPILE_FEATURES:cxx_generic_lambdas>>:${no_has_generic_lambdas}>"
)
else()
target_compile_definitions(run_tests
PRIVATE
-DHAS_GENERIC_LAMBDA=0
)
endif()
if(USE_BOOST_BIND_PLACEHOLDERS)
target_compile_definitions(run_tests
PRIVATE
-DUSE_BOOST_BIND_PLACEHOLDERS=1
)
endif()
endif()
if(ENABLE_FPGA)
set(GPS_L1_CA_DLL_PLL_TRACKING_TEST_FPGA_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc
${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc
)
if(USE_CMAKE_TARGET_SOURCES)
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()
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
PRIVATE
"$<$<COMPILE_FEATURES:cxx_generic_lambdas>:${has_generic_lambdas}>"
"$<$<NOT:$<COMPILE_FEATURES:cxx_generic_lambdas>>:${no_has_generic_lambdas}>"
)
else()
target_compile_definitions(gps_l1_ca_dll_pll_tracking_test_fpga
PRIVATE
-DHAS_GENERIC_LAMBDA=0
)
endif()
if(USE_BOOST_BIND_PLACEHOLDERS)
target_compile_definitions(gps_l1_ca_dll_pll_tracking_test_fpga
PRIVATE
-DUSE_BOOST_BIND_PLACEHOLDERS=1
)
endif()
if(PMT_USES_BOOST_ANY)
target_compile_definitions(gps_l1_ca_dll_pll_tracking_test_fpga
PRIVATE -DPMT_USES_BOOST_ANY=1
)
endif()
target_link_libraries(gps_l1_ca_dll_pll_tracking_test_fpga
PRIVATE
Armadillo::armadillo
Boost::thread
Gnuradio::runtime
Gnuradio::blocks
GTest::GTest
GTest::Main
Matio::matio
Volk::volk
channel_libs
data_type_adapters
tracking_adapters
signal_processing_testing_lib
algorithms_libs
core_receiver
)
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()
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>")
endif()
target_include_directories(gps_l1_ca_dll_pll_tracking_test_fpga
INTERFACE ${GNSSSDR_SOURCE_DIR}/src/tests/common-files
)
xcode_remove_warning_duplicates(gps_l1_ca_dll_pll_tracking_test_fpga)
install(TARGETS gps_l1_ca_dll_pll_tracking_test_fpga
RUNTIME DESTINATION bin
COMPONENT "fpga-test"
)
endif()
################################################################################
# System testing
################################################################################
function(add_system_test executable)
## Please call this function with variables OPT_INCLUDES_ and OPT_LIBS_
## already defined.
if(NOT OPT_INCLUDES_)
set(OPT_INCLUDES_ "")
endif()
if(NOT OPT_LIBS_)
set(OPT_LIBS_ "")
endif()
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
if(NOT EXISTS ${LOCAL_INSTALL_BASE_DIR}/install/${executable})
execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${SYSTEM_TEST_SOURCES})
endif()
if(USE_CMAKE_TARGET_SOURCES)
add_executable(${executable})
target_sources(${executable} PRIVATE ${SYSTEM_TEST_SOURCES})
else()
add_executable(${executable} ${SYSTEM_TEST_SOURCES})
endif()
target_include_directories(${executable}
PRIVATE ${OPT_INCLUDES_}
INTERFACE ${GNSSSDR_SOURCE_DIR}/src/tests/common-files
)
target_link_libraries(${executable} PRIVATE ${OPT_LIBS_} algorithms_libs)
if(NOT ENABLE_GLOG_AND_GFLAGS)
target_link_libraries(${executable} INTERFACE "$<LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags>")
endif()
if(GNURADIO_USES_STD_POINTERS)
target_compile_definitions(${executable}
PRIVATE -DGNURADIO_USES_STD_POINTERS=1
)
endif()
if(ENABLE_STRIP)
set_target_properties(${executable} PROPERTIES LINK_FLAGS "-s")
endif()
if(ENABLE_INSTALL_TESTS)
if(EXISTS ${LOCAL_INSTALL_BASE_DIR}/install/${executable})
file(REMOVE ${LOCAL_INSTALL_BASE_DIR}/install/${executable})
endif()
install(TARGETS ${executable} RUNTIME DESTINATION bin COMPONENT "${executable}_test")
else()
add_custom_command(TARGET ${executable} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${executable}>
${LOCAL_INSTALL_BASE_DIR}/install/$<TARGET_FILE_NAME:${executable}>
)
endif()
xcode_remove_warning_duplicates(${executable})
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(${executable}
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
endfunction()
if(ENABLE_SYSTEM_TESTING)
set(HOST_SYSTEM "Unknown")
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU")
set(HOST_SYSTEM "GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCHITECTURE_STRING}")
string(REPLACE "\n" "" HOST_SYSTEM "${HOST_SYSTEM}")
string(REPLACE "\"" "" HOST_SYSTEM "${HOST_SYSTEM}")
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(HOST_SYSTEM "macOS")
endif()
add_definitions(-DHOST_SYSTEM="${HOST_SYSTEM}")
#### TTFF
set(OPT_LIBS_ Boost::thread Boost::date_time
Threads::Threads
Gnuradio::runtime GTest::GTest GTest::Main
Gnuradio::blocks Gnuradio::filter
Gnuradio::analog algorithms_libs
core_receiver
)
if(ENABLE_GLOG_AND_GFLAGS)
set(OPT_LIBS_ ${OPT_LIBS_} Gflags::gflags Glog::glog)
else()
set(OPT_LIBS_ ${OPT_LIBS_} absl::flags_parse absl::flags absl::log absl::log_initialize absl::log_sink absl::log_sink_registry)
endif()
if(NOT ENABLE_PACKAGING)
add_system_test(ttff
CMAKE_ARGS -DCMAKE_BUILD_TYPE=$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo>$<$<CONFIG:MinSizeRel>:MinSizeRel>$<$<CONFIG:NoOptWithASM>:Debug>$<$<CONFIG:Coverage>:Debug>$<$<CONFIG:O2WithASM>:RelWithDebInfo>$<$<CONFIG:O3WithASM>:RelWithDebInfo>$<$<CONFIG:ASAN>:Debug>
)
if(ENABLE_GLOG_AND_GFLAGS)
target_compile_definitions(ttff PRIVATE -DUSE_GLOG_AND_GFLAGS=1)
endif()
endif()
if(ENABLE_SYSTEM_TESTING_EXTRA)
#### POSITION_TEST
set(OPT_LIBS_
algorithms_libs core_receiver core_system_parameters gnss_sdr_flags
system_testing_lib signal_processing_testing_lib
Boost::thread Threads::Threads
GTest::GTest GTest::Main Gnuradio::runtime
Gnuradio::blocks Gnuradio::filter
Gnuradio::analog Matio::matio Volkgnsssdr::volkgnsssdr
)
if(ENABLE_GLOG_AND_GFLAGS)
set(OPT_LIBS_ ${OPT_LIBS_} Gflags::gflags Glog::glog)
else()
set(OPT_LIBS_ ${OPT_LIBS_} absl::flags_parse absl::log absl::log_initialize absl::log_sink absl::log_sink_registry)
endif()
add_system_test(position_test
CMAKE_ARGS -DCMAKE_BUILD_TYPE=$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo>$<$<CONFIG:MinSizeRel>:MinSizeRel>$<$<CONFIG:NoOptWithASM>:Debug>$<$<CONFIG:Coverage>:Debug>$<$<CONFIG:O2WithASM>:RelWithDebInfo>$<$<CONFIG:O3WithASM>:RelWithDebInfo>$<$<CONFIG:ASAN>:Debug>
)
if(ENABLE_GLOG_AND_GFLAGS)
target_compile_definitions(position_test PRIVATE -DUSE_GLOG_AND_GFLAGS=1)
endif()
if(ENABLE_GPERFTOOLS)
if(GPERFTOOLS_FOUND)
target_link_libraries(position_test
PRIVATE
Gperftools::gperftools
)
endif()
endif()
if(NOT GNSSSIMULATOR_FOUND OR ENABLE_GNSS_SIM_INSTALL)
if(NOT CMAKE_CROSSCOMPILING)
add_dependencies(position_test gnss-sim)
endif()
endif()
else()
# Avoid working with old executables if they were switched ON and then OFF
if(EXISTS ${LOCAL_INSTALL_BASE_DIR}/install/position_test)
file(REMOVE ${LOCAL_INSTALL_BASE_DIR}/install/position_test)
endif()
endif()
else()
# Avoid working with old executables if they were switched ON and then OFF
if(EXISTS ${LOCAL_INSTALL_BASE_DIR}/install/ttff)
file(REMOVE ${LOCAL_INSTALL_BASE_DIR}/install/ttff)
endif()
if(EXISTS ${LOCAL_INSTALL_BASE_DIR}/install/position_test)
file(REMOVE ${LOCAL_INSTALL_BASE_DIR}/install/position_test)
endif()
endif()