forked from OpenCPN/OpenCPN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
2726 lines (2448 loc) · 86.7 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
#[[
Author: Dave Register
DEB config from: antonm - Anton Martchukov <[email protected]>
Update: sethdart (Jean-Eudes Onfray) with parts from balp (Anders Arnholm)
#]]
#[[
Copyright (C) 2010 by David S. Register
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the
Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#]]
#[[
TODO:
- Profiling opt
USE_GLU_TESS
USE_GLU_DLL
#]]
cmake_minimum_required(VERSION 3.15.0)
cmake_policy(SET CMP0043 NEW)
cmake_policy(SET CMP0025 NEW)
if (POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
endif ()
if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif ()
# Prefer libGL.so to libOpenGL.so, see CMP0072
set(OpenGL_GL_PREFERENCE "LEGACY")
if ("${OCPN_TARGET_TUPLE}" MATCHES "Android")
message(STATUS "Building for wxQt-Android")
set(CMAKE_TOOLCHAIN_FILE buildandroid/build_android.cmake)
set(QT_ANDROID "ON")
if ("${OCPN_TARGET_TUPLE}" MATCHES "Android-arm64")
add_definitions("-DANDROID_ARM64")
else ()
add_definitions("-DANDROID_ARMHF")
endif ()
endif ()
if (APPLE)
set(PACKAGE_NAME OpenCPN)
string(REPLACE ";" "," CMAKE_OSX_ARCHITECTURES_COMMA_SEP "${CMAKE_OSX_ARCHITECTURES}")
elseif (QT_ANDROID)
set(PACKAGE_NAME gorp)
else ()
set(PACKAGE_NAME opencpn)
endif ()
project(OpenCPN)
if (NOT DEFINED OCPN_VERBOSE OR OCPN_VERBOSE)
set(CMAKE_VERBOSE_MAKEFILE ON)
endif ()
message(STATUS "cmake version: ${CMAKE_VERSION}")
# Locations where cmake looks for cmake modules.
set(
CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/build ${CMAKE_SOURCE_DIR}/ ${CMAKE_SOURCE_DIR}/cmake
)
include(FindPkgConfig)
include(CMakeDependentOption)
include(CheckSymbolExists)
#
# Options
#
macro (BUNDLE_DOCS_OPT onoff)
option(OCPN_BUNDLE_DOCS "Include documentation in package" ${onoff})
endmacro ()
macro (BUNDLE_TCDATA_OPT onoff)
option(OCPN_BUNDLE_TCDATA "Include tide/current harmonics data in package"
${onoff}
)
endmacro ()
macro (BUNDLE_GSHHS_OPT onoff)
option(OCPN_BUNDLE_GSHHS "Bundle minimal GSHHS data files" ${onoff})
endmacro ()
# If on Windows or Apple, build the monolithic package, to override use a non-
# sense values from the commandline (due to cmake inability to distinguish
# between not set and set to FALSE): cmake -DOCPN_BUNDLE_DOCS=BLAH
# -DOCPN_BUNDLE_TCDATA=BLAH
# Bundle tcdata and gshhs by default also on linux, to keep the defaults close
# to the official Debian package.
bundle_gshhs_opt("ON")
bundle_tcdata_opt("ON")
if (APPLE OR WIN32)
bundle_docs_opt("ON")
else ()
bundle_docs_opt("OFF")
endif ()
option(OCPN_VERBOSE "Make verbose builds" ON)
option(OCPN_PEDANTIC "Enable more compiler warnings" OFF)
set(OCPN_PACKAGE_RELEASE
"1" CACHE STRING "Package release number"
)
option(OCPN_USE_GL "Enable OpenGL support" ON)
option(OCPN_USE_GLES_SHIM "Enable GLESv1 Shim library" OFF)
option(OCPN_USE_UDEV_PORTS "Use udev to enumerate serial ports" ON)
option(OCPN_USE_SYSFS_PORTS "Use sysfs to enumerate serial ports" OFF)
option(OCPN_ENABLE_MDNS_DEBUG "Enable mDNS debug output" OFF)
set(OCPN_TARGET_TUPLE "" CACHE STRING
"List of target;version;arch like flatpak;20.08;aarch64 [\"\"]"
)
if (MSVC OR MINGW)
option(OCPN_USE_CRASHREPORT "Enable crash reporting" ON)
else ()
set(OCPN_USE_CRASHREPORT FALSE)
endif ()
if (WIN32 OR APPLE OR QT_ANDROID)
set(PA_DEFAULT "OFF")
else ()
set(PA_DEFAULT "ON")
endif ()
option(OCPN_ENABLE_PORTAUDIO "Use portaudio(3) to play sounds if available"
${PA_DEFAULT}
)
cmake_dependent_option(
OCPN_ENABLE_SNDFILE "Use libsndfile for portaudio if available." ON
"OCPN_ENABLE_PORTAUDIO" ON
)
option(OCPN_USE_GARMINHOST "Enable Garmin Host Mode support" ON)
if (QT_ANDROID)
set(OCPN_BUILD_TEST OFF)
else ()
option(OCPN_BUILD_TEST "Enable test subproject build" ON)
endif ()
execute_process(
COMMAND "ip" "address" "show" "vcan0"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
OUTPUT_VARIABLE _VCAN_STDOUT
RESULT_VARIABLE _VCAN_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if ("${_VCAN_RESULT}" EQUAL 0)
set(ENABLE_VCAN_TESTS ON)
message(STATUS "tests using vcan0 are available.")
else ()
set(ENABLE_VCAN_TESTS OFF)
message(STATUS "tests using vcan0 are NOT available: \"${_VCAN_STDERR}\"")
endif ()
set(OCPN_WXWIDGETS_FORCE_VERSION
CACHE STRING "Force usage of a specific wxWidgets version."
)
set(OCPN_WXWIDGETS_OPTIONS CACHE STRING
"Additional flags to wxWidgets_CONFIG_OPTIONS"
)
if (WIN32 AND NOT UNIX)
option(OCPN_BUNDLE_WXDLLS "Bundle the prebuilt WX DLLs" ON)
option(OCPN_BUNDLE_VCDLLS "Bundle the VC redistributable libraries" ON)
option(BUNDLE_LIBARCHIVEDLLS
"Bundle the prebuilt LibArchive and LibLZMA DLLs" ON
)
endif ()
option(OCPN_ENABLE_CLANG_TIDY "Add clang-tidy automatically to builds" OFF)
set(ENABLE_SANITIZER "none" CACHE STRING "Add clang sanitizer to the build")
option(OCPN_ENABLE_CPPCHECK "Add cppcheck automatically to builds" OFF)
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose type of build: None Debug Release RelWithDebInfo MinSizeRel."
FORCE
)
# Set the possible values of build type for cmake-gui
set_property(
CACHE CMAKE_BUILD_TYPE
PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo"
)
endif ()
if (APPLE)
option(OCPN_USE_LIBCPP "Use libc++ instead of libstdc++ on macOS" ON)
option(
OCPN_USE_DEPS_BUNDLE
"Use prebuilt dependency bundle instead of searching for libraries on macOS"
OFF
)
if (NOT OCPN_DEPS_BUNDLE_PATH)
set(OCPN_DEPS_BUNDLE_PATH "/usr/local")
endif ()
endif ()
option(OCPN_USE_EXTERN_CURL "Use external libcurl" OFF)
if (NOT CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX ${TENTATIVE_PREFIX})
endif ()
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(BUNDLED_LIBS_DEFAULT "ON")
else ()
set(BUNDLED_LIBS_DEFAULT "OFF")
endif ()
set(OCPN_USE_BUNDLED_LIBS ${BUNDLED_LIBS_DEFAULT} CACHE STRING
"Use bundled libraries instead of system's [ON, OFF or comma-sep list]"
)
set(OCPN_RELEASE "" CACHE STRING
"Hardcoded value for build number when using OCPN_CI_BUILD"
)
option(OCPN_USE_NEWSERIAL "Use new serial communication implementation" ON)
option(OCPN_USE_CURL "Use Curl libraries" ON)
option(OCPN_USE_SVG "Use SVG graphics via wxSVG or wxBitmapBundle" ON)
option(OCPN_USE_WEBVIEW "Use wxWidget's webview addon if available" ON)
option(OCPN_USE_LZMA "Use LZMA for chart compression" ON)
option(OCPN_CI_BUILD "Use CI build versioning rules" OFF)
option(OCPN_USE_SYSTEM_LIBARCHIVE
"Use the libarchive version provided by the system on MacOS" ON
)
add_definitions(-D__OCPN_USE_GLEW__)
if (WIN32)
set(cmd_snd_default OFF)
else ()
set(cmd_snd_default ON)
endif ()
option(OCPN_ENABLE_SYSTEM_CMD_SOUND
"Use aplay(1), afplay(1) etc. to play sounds if available"
${cmd_snd_default}
)
set(OCPN_SOUND_CMD "" CACHE STRING
"Hardcoded value for CLI command used in SystemCmdSound backend"
)
if (UNIX AND NOT APPLE AND NOT QT_ANDROID)
set(LINUX "1")
endif ()
if (QT_ANDROID)
set(OCPN_NEW_SERIAL OFF)
set(OCPN_USE_NEWSERIAL OFF)
set(OCPN_USE_CURL ON)
set(OCPN_USE_LZMA OFF)
endif ()
# Check if a given library should use the bundled source
macro (USE_BUNDLED_LIB _result library)
if ("${OCPN_USE_BUNDLED_LIBS}" STREQUAL "")
set(OCPN_USE_BUNDLED_LIBS "ON")
endif ()
if (${OCPN_USE_BUNDLED_LIBS} STREQUAL "OFF")
set(${_result} "OFF")
elseif (${OCPN_USE_BUNDLED_LIBS} STREQUAL "ON")
set(${_result} "ON")
elseif (",${OCPN_USE_BUNDLED_LIBS}," MATCHES ",${library},")
set(${_result} "ON")
else ()
set(${_result} "OFF")
endif ()
endmacro ()
#
# Language, compiler and static checkers setup
#
if (NOT DEFINED ENV{ARCH})
include(GetArch)
getarch()
else ()
set(ARCH $ENV{ARCH})
endif ()
message(STATUS "*** Host Build Architecture is ${ARCH}")
set(CMAKE_CXX_STANDARD 17)
message(STATUS "Setting C++17 standard via cmake standard mechanism")
set(CMAKE_CXX_VISIBILITY_PRESET=hidden)
if (NOT MSVC)
set(OBJ_VISIBILITY "-fvisibility=hidden")
endif ()
if (OCPN_ENABLE_CLANG_TIDY)
find_program(
CLANG_TIDY_EXE
NAMES "clang-tidy"
PATHS /usr/local/opt/llvm/bin
)
if (CLANG_TIDY_EXE)
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
# For more, see http://clang.llvm.org/extra/clang-tidy/
# set(CLANG_TIDY_CHECKS "-*,modernize-*")
set(CLANG_TIDY_CHECKS "-*,performance-*")
set(CMAKE_CXX_CLANG_TIDY
"${CLANG_TIDY_EXE};-checks=${CLANG_TIDY_CHECKS};-header-filter='${CMAKE_SOURCE_DIR}/*'"
CACHE STRING "" FORCE
)
else ()
message(AUTHOR_WARNING "clang-tidy not found!")
set(CMAKE_CXX_CLANG_TIDY "" CACHE STRING "" FORCE) # delete it
endif ()
endif ()
# Add support for address etc sanitizers, part 1/2 (other half after
# ADD_EXECUTABLE)
set_property(
CACHE ENABLE_SANITIZER
PROPERTY STRINGS none address memory thread undefined
)
if (NOT "${ENABLE_SANITIZER}" MATCHES "none")
add_compile_options(-fsanitize=${ENABLE_SANITIZER})
endif ()
if (OCPN_ENABLE_CPPCHECK)
find_program(CPPCHECK_EXECUTABLE NAMES "cppcheck")
set(CMAKE_CXX_CPPCHECK ${CPPCHECK_EXECUTABLE})
endif ()
# ADD_COMPILE_OPTIONS( "-Wall" "-ansi" "-pedantic" "-Wno-variadic-macros" )
# TODO: Should we use -fno-stack-protector IF NOT DEBUGGING CFLAGS="-O2
# -march=native"
if (NOT WIN32 AND NOT APPLE)
add_compile_options("-Wall")
if (NOT OCPN_PEDANTIC)
add_compile_options(
"-Wno-unused" "-fexceptions" "-rdynamic" "-fno-strict-aliasing"
"-Wno-deprecated-declarations"
)
endif ()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang|GNU")
if (CMAKE_BUILD_TYPE MATCHES "Debug")
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -O0")
add_compile_options("-O0")
endif ()
endif ()
add_definitions(" -DPREFIX=\\\"${CMAKE_INSTALL_PREFIX}\\\"")
# profiling with gprof ADD_COMPILE_OPTIONS( -pg )
# SET(CMAKE_EXE_LINKER_FLAGS -pg)
# profiling with gcov ADD_COMPILE_OPTIONS( "-fprofile-arcs -ftest- # coverage" )
endif ()
if (APPLE)
add_compile_options("-Wall")
if (NOT OCPN_PEDANTIC)
add_compile_options(
"-Wno-unused"
"-fexceptions"
"-Wno-overloaded-virtual"
"-fno-strict-aliasing"
"-Wno-deprecated"
"-Wno-deprecated-declarations"
"-Wno-unknown-pragmas"
"-Wno-unknown-warning-option"
"-D_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_"
)
endif ()
endif ()
if (APPLE)
set(CMAKE_C_FLAGS "-O2 -arch ${ARCH}")
set(CMAKE_C_FLAGS_DEBUG "-g -O0 -arch ${ARCH}")
set(CMAKE_C_FLAGS_MINSIZEREL "-O2 -arch ${ARCH}")
set(CMAKE_C_FLAGS_RELEASE "-O3 -arch ${ARCH}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O3 -arch ${ARCH}")
if (OCPN_USE_LIBCPP)
set(OCPN_LIBCPP "-stdlib=libc++")
endif ()
set(CMAKE_CXX_FLAGS "-O2 ${OCPN_LIBCPP} -arch ${ARCH}")
set(CMAKE_CXX_FLAGS_DEBUG "-g -gdwarf-2 -O0 ${OCPN_LIBCPP} -arch ${ARCH}")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-O2 ${OCPN_LIBCPP} -arch ${ARCH}")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${OCPN_LIBCPP} -arch ${ARCH}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-g -gdwarf-2 -O3 ${OCPN_LIBCPP} -arch ${ARCH}"
)
set(CMAKE_EXE_LINKER_FLAGS
"-O2 ${OCPN_LIBCPP} -arch ${ARCH} ${CMAKE_EXE_LINKER_FLAGS} -framework CoreGraphics"
)
set(CMAKE_SHARED_LINKER_FLAGS "-O2 ${OCPN_LIBCPP} -arch ${ARCH}")
set(CMAKE_MODULE_LINKER_FLAGS "-O2 ${OCPN_LIBCPP} -arch ${ARCH}")
endif ()
if (MSVC)
add_definitions(-D__MSVC__)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-DPSAPI_VERSION=1)
add_definitions(-D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS=1)
# https://developercommunity.visualstudio.com
# /t/error-c2872-byte-ambiguous-symbol/93889 https://shorturl.at/hmJSZ
add_definitions(-D_HAS_STD_BYTE=0)
endif ()
if (MSVC)
# /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR works around https://github.com/actions/runner-images/issues/10004
set(CMAKE_C_FLAGS_DEBUG "/MP /MDd /Ob0 /Od /D_DEBUG /Zi /RTC1")
set(CMAKE_C_FLAGS_MINSIZEREL "/MP /MD /O1 /Ob1 /D NDEBUG")
set(CMAKE_C_FLAGS_RELEASE "/MP /MD /O2 /Ob2 /D NDEBUG /Zi /wd4068")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MP /MD /O2 /Ob1 /D NDEBUG /Zi /wd4068")
set(CMAKE_CXX_FLAGS_DEBUG "/MP /MDd /Ob0 /Od /D_DEBUG /Zi /RTC1 /EHa /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR")
set(CMAKE_CXX_FLAGS_MINSIZEREL "/MP /MD /O1 /Ob1 /D NDEBUG /EHa /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR")
set(CMAKE_CXX_FLAGS_RELEASE "/MP /MD /O2 /Ob2 /D NDEBUG /Zi /EHa /wd4068 /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"/MP /MD /O2 /Ob1 /D NDEBUG /Zi /EHa /wd4068 /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR"
)
set(CMAKE_EXE_LINKER_FLAGS "/DEBUG /Release ${CMAKE_EXE_LINKER_FLAGS}")
endif ()
if (QT_ANDROID)
set(CMAKE_BUILD_TYPE Debug)
add_definitions(-D__WXQT__)
add_definitions(-D__OCPN__ANDROID__)
add_definitions(-DANDROID)
add_definitions(-DNOASSERT)
set(CMAKE_CXX_FLAGS "-pthread -fPIC -g")
set(CMAKE_C_FLAGS "-pthread -fPIC -g")
add_compile_options(
"-Wno-inconsistent-missing-override"
"-Wno-potentially-evaluated-expression" "-Wno-overloaded-virtual"
"-Wno-unused-command-line-argument" "-Wno-unknown-pragmas"
)
if (CMAKE_BUILD_TYPE MATCHES "Debug")
add_compile_options("-O0")
endif ()
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-soname,libgorp.so -Wl,--build-id")
endif ()
if (ARCH STREQUAL armhf)
# See: https://forums.raspberrypi.com/viewtopic.php?t=144115
add_compile_options(-mcpu=cortex-a53 -mfpu=neon-fp-armv8)
endif () # Assuming at least RPi 3
message(STATUS "Final compiler options:")
message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
message(STATUS "CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}")
message(STATUS "CMAKE_CXX_FLAGS_MINSIZEREL: ${CMAKE_CXX_FLAGS_MINSIZEREL}")
message(STATUS "CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
message(
STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}"
)
# Per default, use CMAKE_INSTALL_LIBDIR=lib on Debian (and derivatives) to avoid
# multilib plugin paths. After all, we do not install any "real" libraries.
if (EXISTS /etc/debian_version AND NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")
endif ()
include(GNUInstallDirs)
set(PREFIX_DATA ${CMAKE_INSTALL_DATADIR})
set(PREFIX_PKGDATA ${CMAKE_INSTALL_DATADIR}/${PACKAGE_NAME})
set(PREFIX_LIB "${CMAKE_INSTALL_FULL_LIBDIR}")
#
# Version handling
#
include(${CMAKE_SOURCE_DIR}/VERSION.cmake)
string(TIMESTAMP VERSION_DATE "%Y-%m-%d")
string(TIMESTAMP UNIX_TIMESTAMP "%s")
if (OCPN_CI_BUILD)
include(Utils)
commit_id(COMMIT)
build_num(BUILD_NUMBER)
if (NOT "${OCPN_RELEASE}" STREQUAL "")
set(BUILD_NUMBER ${OCPN_RELEASE})
endif ()
set(VERSION_TAIL "+${COMMIT}")
if (NOT "${BUILD_NUMBER}" STREQUAL "")
set(VERSION_TAIL "-${BUILD_NUMBER}${VERSION_TAIL}")
endif ()
endif ()
set(PACKAGE_VERSION
"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_TAIL}"
)
message(STATUS "Building version ${PACKAGE_VERSION}")
# Detect the Apple Version of the build machine
if (APPLE)
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
message(STATUS "*** Building on DARWIN_VERSION=${DARWIN_VERSION}")
if (DARWIN_VERSION GREATER 11)
set(APPLE_MODERN 1 INTERNAL)
endif ()
endif ()
message(STATUS "*** Staging to build ${PACKAGE_NAME} ${PACKAGE_VERSION} ***")
#
# Bundled data: docs, tcdata
#
if (OCPN_BUNDLE_DOCS)
message(STATUS "*** Package will include documentation ***")
else (OCPN_BUNDLE_DOCS)
message(STATUS "*** Package will NOT include documentation ***")
endif (OCPN_BUNDLE_DOCS)
#
# Linux: set up GTK (wxWidgets prerequisite).
#
if (LINUX)
include(OcpnFindGtk)
endif ()
# set a build flag for arm architecture, to catch any rPI runtime changes
# required
if (ARCH MATCHES "arm*" AND (NOT QT_ANDROID))
add_definitions(-DocpnARM)
if (ARCH STREQUAL "armhf")
add_definitions(-DocpnARMHF)
endif ()
endif ()
if (DEFINED _wx_selected_config)
if (_wx_selected_config MATCHES "androideabi-qt")
# MESSAGE (STATUS "Qt_Base: " ${Qt_Base}) MESSAGE (STATUS "wxQt_Base/Build:
# " ${wxQt_Base} "/" ${wxQt_Build}) ADD_DEFINITIONS(-DocpnUSE_GLES)
# ADD_DEFINITIONS(-DocpnUSE_GL)
# SET(OPENGLES_FOUND "YES") SET(OPENGL_FOUND "YES")
# ADD_DEFINITIONS(-DUSE_GLU_TESS) SET(USE_GLES2 ON ) MESSAGE (STATUS "Using
# GLESv2 for Android") ADD_DEFINITIONS(-DUSE_ANDROID_GLES2)
# ADD_DEFINITIONS(-DUSE_GLSL)
include_directories(${CMAKE_SOURCE_DIR}/libs/glshim/include/GLES)
endif ()
endif ()
if (APPLE)
# Bundle all of wxWidgets as a courtesy for plugins, see #2153
set(wxWidgets_FIND_COMPONENTS
net xml html adv aui core base media propgrid qa ribbon richtext webview
stc xrc
)
elseif (_wx_selected_config MATCHES "qt-armv7")
set(wxWidgets_FIND_COMPONENTS base core xml html adv aui)
elseif (OCPN_USE_WEBVIEW)
set(wxWidgets_FIND_COMPONENTS net xml html adv aui core base richtext webview)
else ()
set(wxWidgets_FIND_COMPONENTS net xml html adv aui core base richtext)
endif ()
if (OPENGLES_FOUND)
set(wxWidgets_FIND_COMPONENTS ${wxWidgets_FIND_COMPONENTS} gl)
endif ()
if ((NOT OPENGLES_FOUND) AND (NOT QT_ANDROID))
if (OCPN_USE_GL)
find_package(OpenGL)
else (OCPN_USE_GL)
message(STATUS "OpenGL disabled by option USE_GL...")
endif (OCPN_USE_GL)
if (OPENGL_FOUND)
set(wxWidgets_FIND_COMPONENTS gl ${wxWidgets_FIND_COMPONENTS})
include_directories(${OPENGL_INCLUDE_DIR})
message(STATUS "Found OpenGL....")
message(STATUS " GL Lib: " ${OPENGL_LIBRARIES})
message(STATUS " GL Include: " ${OPENGL_INCLUDE_DIR})
add_definitions(-DocpnUSE_GL)
add_definitions(-DocpnUSE_GLSL)
# We need to remove GLU from the OPENGL_LIBRARIES list
foreach (_currentLibFile ${OPENGL_LIBRARIES})
# MESSAGE (STATUS " Lib File: " ${_currentLibFile})
set(UCNAME ${_currentLibFile})
string(TOUPPER ${UCNAME} UCNAME)
if (NOT ${UCNAME} MATCHES "(.*)GLU(.*)")
set(REVISED_OPENGL_LIBRARIES ${_currentLibFile}
${REVISED_OPENGL_LIBRARIES}
)
endif ()
endforeach ()
set(OPENGL_LIBRARIES ${REVISED_OPENGL_LIBRARIES})
message(STATUS " Revised GL Lib: " ${OPENGL_LIBRARIES})
else ()
message(STATUS "OpenGL not found...")
endif ()
endif ()
# configure GLEW
if (OPENGL_FOUND AND CMAKE_HOST_WIN32)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/cache/buildwin/include/glew)
link_libraries(${CMAKE_SOURCE_DIR}/cache/buildwin/glew32.lib)
elseif (OPENGL_FOUND AND NOT APPLE)
find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_DIRS})
link_libraries(${GLEW_LIBRARIES})
endif ()
if (NOT QT_ANDROID)
# Find wxWidgets here, and the setting get inherited by all plugins. These
# options can be used to set the linux widgets build type
set(wxWidgets_USE_DEBUG OFF)
set(wxWidgets_USE_UNICODE ON)
set(wxWidgets_USE_UNIVERSAL OFF)
set(wxWidgets_USE_STATIC OFF)
if (OCPN_WXWIDGETS_FORCE_VERSION)
set(wxWidgets_CONFIG_OPTIONS --version=${OCPN_WXWIDGETS_FORCE_VERSION})
endif ()
if (MSVC)
# Exclude wxexpat.lib, since we use our own version. Other things are
# excluded as well, but we don't need them
set(wxWidgets_EXCLUDE_COMMON_LIBRARIES TRUE)
endif ()
if (GTK3_FOUND)
set(wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS} --toolkit=gtk3)
endif ()
# find_package(wxWidgets COMPONENTS ${wxWidgets_FIND_COMPONENTS} REQUIRED )
if (APPLE AND OCPN_USE_DEPS_BUNDLE)
set(wxWidgets_CONFIG_EXECUTABLE
"${OCPN_DEPS_BUNDLE_PATH}/lib/wx/config/osx_cocoa-unicode-3.2"
)
set(wxWidgets_CONFIG_OPTIONS "--prefix=${OCPN_DEPS_BUNDLE_PATH}")
endif ()
find_package(wxWidgets COMPONENTS ${wxWidgets_FIND_COMPONENTS})
if (wxWidgets_FOUND AND OCPN_USE_WEBVIEW)
message(STATUS "Found wxWidgets webview add-on")
add_definitions(-DwxUSE_WEBVIEW=1 -DHAVE_WEBVIEW)
else ()
add_definitions(-DwxUSE_WEBVIEW=0)
list(REMOVE_ITEM wxWidgets_FIND_COMPONENTS webview)
message(STATUS "Could not find wxWidgets webview add-on")
find_package(wxWidgets COMPONENTS ${wxWidgets_FIND_COMPONENTS})
endif ()
if (NOT wxWidgets_FOUND)
message(FATAL_ERROR "Cannot find wxWidgets, giving up.")
endif ()
if (MSYS)
# Convert msys to windows paths, and handle the missing /usr
string(REGEX REPLACE "/usr/local" ";C:/MinGW/msys/1.0/local"
wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}"
)
endif ()
include(${wxWidgets_USE_FILE})
message(STATUS "Found wxWidgets...")
message(STATUS " wxWidgets Include: ${wxWidgets_INCLUDE_DIRS}")
message(STATUS " wxWidgets Libraries: ${wxWidgets_LIBRARIES}")
# We need to remove GLU from the wxWidgets_LIBRARIES list It only appears to
# get on the list for MSW...
foreach (_currentLibFile ${wxWidgets_LIBRARIES})
set(UCNAME ${_currentLibFile})
string(TOUPPER ${UCNAME} UCNAME)
if (NOT ${UCNAME} MATCHES "(.*)GLU(.*)")
set(REVISED_wxWidgets_LIBRARIES
${REVISED_wxWidgets_LIBRARIES} ${_currentLibFile}
)
endif ()
endforeach ()
set(wxWidgets_LIBRARIES ${REVISED_wxWidgets_LIBRARIES})
message(STATUS " Revised wxWidgets Libraries: ${wxWidgets_LIBRARIES}")
endif (NOT QT_ANDROID)
# Handle #1500: Force NDEBUG on gtk3 for wxwidgets < 3.2 (all builds)
if (GTK3_FOUND)
set(_VERSPROG
[=[
#include <stdio.h>
#include <wx/version.h>
int main(int argc, char**argv) {
printf("%d\\n", wxMAJOR_VERSION * 10 + wxMINOR_VERSION);
}
]=]
)
set(TRY_COMPILE
"echo '${_VERSPROG}' > wx-32.c; cc $(${wxWidgets_CONFIG_EXECUTABLE} --cflags) wx-32.c; ./a.out"
)
execute_process(
COMMAND "/bin/sh" "-c" "${TRY_COMPILE}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
OUTPUT_VARIABLE _WX_VERSION
ERROR_VARIABLE _WX_ERRORS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (NOT "${_WX_ERRORS}" STREQUAL "" OR "${_WX_VERSION}" STREQUAL "")
message(FATAL_ERROR "Cannot run wxWidgets version test (!)")
elseif ("${_WX_VERSION}" LESS 32)
add_definitions("-DNDEBUG")
message(STATUS "Forcing -NDEBUG on gtk3 build (#1500).")
endif ()
endif ()
# Make sure that the variable "wxWidgets_VERSION_STRING" is set, even on older
# CMake versions Seems safe to set to "3.0", since OCPN does not support earlier
# wxWidgets versions
if (wxWidgets_VERSION_STRING)
message(STATUS "Found wxWidgets_VERSION_STRING: ${wxWidgets_VERSION_STRING}")
else ()
message(
STATUS "Forcing wxWidgets_VERSION_STRING: ${wxWidgets_VERSION_STRING}"
)
set(wxWidgets_VERSION_STRING "3.0")
endif ()
# Enable gestures on all platforms except MacOS There are no touch capable MacOS
# machines
if ((wxWidgets_VERSION_STRING VERSION_GREATER "3.1.0") AND (NOT APPLE))
add_definitions("-DHAVE_WX_GESTURE_EVENTS")
endif ()
message(STATUS "")
message(STATUS "*** Staging to build ${PACKAGE_NAME} ***")
message(STATUS "*** Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS "*** Will install to ${CMAKE_INSTALL_PREFIX} ***")
set(GUI_S57_DIR ${CMAKE_SOURCE_DIR}/gui/src/s57)
set(GUI_HDR_DIR ${CMAKE_SOURCE_DIR}/gui/include/gui)
set(GUI_HDRS
${GUI_HDR_DIR}/AboutFrame.h
${GUI_HDR_DIR}/AboutFrameImpl.h
${GUI_HDR_DIR}/about.h
${GUI_HDR_DIR}/ais.h
${GUI_HDR_DIR}/ais_info_gui.h
${GUI_HDR_DIR}/AISTargetAlertDialog.h
${GUI_HDR_DIR}/AISTargetListDialog.h
${GUI_HDR_DIR}/AISTargetQueryDialog.h
${GUI_HDR_DIR}/CanvasConfig.h
${GUI_HDR_DIR}/canvasMenu.h
${GUI_HDR_DIR}/CanvasOptions.h
${GUI_HDR_DIR}/catalog_mgr.h
${GUI_HDR_DIR}/cat_settings.h
${GUI_HDR_DIR}/chartbase.h
${GUI_HDR_DIR}/chart_ctx_factory.h
${GUI_HDR_DIR}/chartdb.h
${GUI_HDR_DIR}/chartdbs.h
${GUI_HDR_DIR}/chartimg.h
${GUI_HDR_DIR}/chcanv.h
${GUI_HDR_DIR}/ChInfoWin.h
${GUI_HDR_DIR}/color_handler.h
${GUI_HDR_DIR}/comm_overflow_dlg.h
${GUI_HDR_DIR}/compass.h
${GUI_HDR_DIR}/concanv.h
${GUI_HDR_DIR}/ConfigMgr.h
${GUI_HDR_DIR}/connection_edit.h
${GUI_HDR_DIR}/connections_dialog.h
${GUI_HDR_DIR}/conn_params_panel.h
${GUI_HDR_DIR}/DetailSlider.h
${GUI_HDR_DIR}/displays.h
${GUI_HDR_DIR}/download_mgr.h
${GUI_HDR_DIR}/dychart.h
${GUI_HDR_DIR}/emboss_data.h
${GUI_HDR_DIR}/FlexHash.h
${GUI_HDR_DIR}/FontDesc.h
${GUI_HDR_DIR}/FontMgr.h
${GUI_HDR_DIR}/GoToPositionDialog.h
${GUI_HDR_DIR}/gshhs.h
${GUI_HDR_DIR}/gui_lib.h
${GUI_HDR_DIR}/IDX_entry.h
${GUI_HDR_DIR}/iENCToolbar.h
${GUI_HDR_DIR}/kml.h
${GUI_HDR_DIR}/Layer.h
${GUI_HDR_DIR}/LinkPropDlg.h
${GUI_HDR_DIR}/load_errors_dlg.h
${GUI_HDR_DIR}/MarkInfo.h
${GUI_HDR_DIR}/mbtiles.h
${GUI_HDR_DIR}/MUIBar.h
${GUI_HDR_DIR}/n0183_ctx_factory.h
${GUI_HDR_DIR}/navutil.h
${GUI_HDR_DIR}/NMEALogWindow.h
${GUI_HDR_DIR}/ocpCursor.h
${GUI_HDR_DIR}/ocpndc.h
${GUI_HDR_DIR}/ocpn_app.h
${GUI_HDR_DIR}/ocpn_frame.h
${GUI_HDR_DIR}/OCPNListCtrl.h
${GUI_HDR_DIR}/ocpn_pixel.h
${GUI_HDR_DIR}/OCPNPlatform.h
${GUI_HDR_DIR}/ocpn_print.h
${GUI_HDR_DIR}/OCPN_AUIManager.h
${GUI_HDR_DIR}/OCPNRegion.h
${GUI_HDR_DIR}/options.h
${GUI_HDR_DIR}/piano.h
${GUI_HDR_DIR}/peer_client_dlg.h
${GUI_HDR_DIR}/pluginmanager.h
${GUI_HDR_DIR}/printtable.h
${GUI_HDR_DIR}/priority_gui.h
${GUI_HDR_DIR}/Quilt.h
${GUI_HDR_DIR}/rest_server_gui.h
${GUI_HDR_DIR}/RolloverWin.h
${GUI_HDR_DIR}/route_ctx_factory.h
${GUI_HDR_DIR}/route_gui.h
${GUI_HDR_DIR}/routemanagerdialog.h
${GUI_HDR_DIR}/routeman_gui.h
${GUI_HDR_DIR}/route_point_gui.h
${GUI_HDR_DIR}/routeprintout.h
${GUI_HDR_DIR}/RoutePropDlg.h
${GUI_HDR_DIR}/RoutePropDlgImpl.h
${GUI_HDR_DIR}/S57Light.h
${GUI_HDR_DIR}/S57ObjectDesc.h
${GUI_HDR_DIR}/S57QueryDialog.h
${GUI_HDR_DIR}/S57Sector.h
${GUI_HDR_DIR}/safe_mode_gui.h
${GUI_HDR_DIR}/SendToGpsDlg.h
${GUI_HDR_DIR}/SendToPeerDlg.h
${GUI_HDR_DIR}/Station_Data.h
${GUI_HDR_DIR}/styles.h
${GUI_HDR_DIR}/svg_utils.h
${GUI_HDR_DIR}/TCDataFactory.h
${GUI_HDR_DIR}/TCDataSource.h
${GUI_HDR_DIR}/TCDS_Ascii_Harmonic.h
${GUI_HDR_DIR}/TCDS_Binary_Harmonic.h
${GUI_HDR_DIR}/TC_Error_Code.h
${GUI_HDR_DIR}/tcmgr.h
${GUI_HDR_DIR}/TCWin.h
${GUI_HDR_DIR}/thumbwin.h
${GUI_HDR_DIR}/tide_time.h
${GUI_HDR_DIR}/timers.h
${GUI_HDR_DIR}/time_textbox.h
${GUI_HDR_DIR}/toolbar.h
${GUI_HDR_DIR}/track_gui.h
${GUI_HDR_DIR}/trackprintout.h
${GUI_HDR_DIR}/TrackPropDlg.h
${GUI_HDR_DIR}/TTYScroll.h
${GUI_HDR_DIR}/TTYWindow.h
${GUI_HDR_DIR}/udev_rule_mgr.h
${GUI_HDR_DIR}/undo.h
${GUI_HDR_DIR}/update_mgr.h
${GUI_HDR_DIR}/usb_devices.h
${GUI_HDR_DIR}/viewport.h
${GUI_HDR_DIR}/waypointman_gui.h
${GUI_HDR_DIR}/WindowDestroyListener.h
${GUI_HDR_DIR}/WindowDestroyListener.h
)
list(APPEND GUI_HDRS
${GUI_S57_DIR}/include/ogr_s57.h
${GUI_S57_DIR}/include/S57ClassRegistrar.h
${GUI_S57_DIR}/include/s57.h
${GUI_S57_DIR}/include/s57RegistrarMgr.h
)
set(GUI_SRC_DIR ${CMAKE_SOURCE_DIR}/gui/src)
set(GUI_SRC
${GUI_SRC_DIR}/about.cpp
${GUI_SRC_DIR}/AboutFrame.cpp
${GUI_SRC_DIR}/AboutFrameImpl.cpp
${GUI_SRC_DIR}/ais.cpp
${GUI_SRC_DIR}/ais_info_gui.cpp
${GUI_SRC_DIR}/AISTargetAlertDialog.cpp
${GUI_SRC_DIR}/AISTargetListDialog.cpp
${GUI_SRC_DIR}/AISTargetQueryDialog.cpp
${GUI_SRC_DIR}/CanvasConfig.cpp
${GUI_SRC_DIR}/canvasMenu.cpp
${GUI_SRC_DIR}/CanvasOptions.cpp
${GUI_SRC_DIR}/catalog_mgr.cpp
${GUI_SRC_DIR}/cat_settings.cpp
${GUI_SRC_DIR}/chartdb.cpp
${GUI_SRC_DIR}/chartdbs.cpp
${GUI_SRC_DIR}/chartimg.cpp
${GUI_SRC_DIR}/chcanv.cpp
${GUI_SRC_DIR}/ChInfoWin.cpp
${GUI_SRC_DIR}/cm93.cpp
${GUI_SRC_DIR}/color_handler.cpp
${GUI_SRC_DIR}/comm_overflow_dlg.cpp
${GUI_SRC_DIR}/compass.cpp
${GUI_SRC_DIR}/concanv.cpp
${GUI_SRC_DIR}/ConfigMgr.cpp
${GUI_SRC_DIR}/connection_edit.cpp
${GUI_SRC_DIR}/connections_dialog.cpp
${GUI_SRC_DIR}/conn_params_panel.cpp
${GUI_SRC_DIR}/DetailSlider.cpp
${GUI_SRC_DIR}/displays.cpp
${GUI_SRC_DIR}/download_mgr.cpp
${GUI_SRC_DIR}/FlexHash.cpp
${GUI_SRC_DIR}/FontDesc.cpp
${GUI_SRC_DIR}/FontMgr.cpp
${GUI_SRC_DIR}/GoToPositionDialog.cpp
${GUI_SRC_DIR}/gshhs.cpp
${GUI_SRC_DIR}/gui_lib.cpp
${GUI_SRC_DIR}/IDX_entry.cpp
${GUI_SRC_DIR}/iENCToolbar.cpp
${GUI_SRC_DIR}/kml.cpp
${GUI_SRC_DIR}/Layer.cpp
${GUI_SRC_DIR}/LinkPropDlg.cpp
${GUI_SRC_DIR}/load_errors_dlg.cpp
${GUI_SRC_DIR}/MarkInfo.cpp
${GUI_SRC_DIR}/mbtiles/mbtiles.cpp
${GUI_SRC_DIR}/mbtiles/WorkerThread.cpp
${GUI_SRC_DIR}/mbtiles/WorkerThread.hpp
${GUI_SRC_DIR}/mbtiles/TileQueue.hpp
${GUI_SRC_DIR}/mbtiles/TileDescriptor.hpp
${GUI_SRC_DIR}/mbtiles/TileCache.hpp
${GUI_SRC_DIR}/MUIBar.cpp
${GUI_SRC_DIR}/navutil.cpp
${GUI_SRC_DIR}/NMEALogWindow.cpp
${GUI_SRC_DIR}/ocpCursor.cpp
${GUI_SRC_DIR}/ocpn_app.cpp
${GUI_SRC_DIR}/OCPN_AUIManager.cpp
${GUI_SRC_DIR}/ocpndc.cpp
${GUI_SRC_DIR}/ocpn_frame.cpp
${GUI_SRC_DIR}/OCPNListCtrl.cpp
${GUI_SRC_DIR}/ocpn_pixel.cpp
${GUI_SRC_DIR}/OCPNPlatform.cpp
${GUI_SRC_DIR}/ocpn_print.cpp
${GUI_SRC_DIR}/OCPNRegion.cpp
${GUI_SRC_DIR}/options.cpp
${GUI_SRC_DIR}/Osenc.cpp
${GUI_SRC_DIR}/peer_client_dlg.cpp
${GUI_SRC_DIR}/piano.cpp
${GUI_SRC_DIR}/pluginmanager.cpp
${GUI_SRC_DIR}/printtable.cpp
${GUI_SRC_DIR}/priority_gui.cpp
${GUI_SRC_DIR}/Quilt.cpp
${GUI_SRC_DIR}/rest_server_gui.cpp
${GUI_SRC_DIR}/RolloverWin.cpp
${GUI_SRC_DIR}/route_gui.cpp
${GUI_SRC_DIR}/routemanagerdialog.cpp
${GUI_SRC_DIR}/routeman_gui.cpp
${GUI_SRC_DIR}/route_point_gui.cpp
${GUI_SRC_DIR}/routeprintout.cpp
${GUI_SRC_DIR}/RoutePropDlg.cpp
${GUI_SRC_DIR}/RoutePropDlgImpl.cpp
${GUI_SRC_DIR}/s57chart.cpp
${GUI_SRC_DIR}/S57QueryDialog.cpp
${GUI_SRC_DIR}/safe_mode_gui.cpp
${GUI_SRC_DIR}/SencManager.cpp
${GUI_SRC_DIR}/SendToGpsDlg.cpp
${GUI_SRC_DIR}/SendToPeerDlg.cpp
${GUI_SRC_DIR}/shapefile_basemap.cpp
${GUI_SRC_DIR}/Station_Data.cpp
${GUI_SRC_DIR}/styles.cpp
${GUI_SRC_DIR}/svg_utils.cpp
${GUI_SRC_DIR}/TCDataFactory.cpp
${GUI_SRC_DIR}/TCDataSource.cpp
${GUI_SRC_DIR}/TCDS_Ascii_Harmonic.cpp
${GUI_SRC_DIR}/TCDS_Binary_Harmonic.cpp
${GUI_SRC_DIR}/tcmgr.cpp
${GUI_SRC_DIR}/TCWin.cpp
${GUI_SRC_DIR}/thumbwin.cpp
${GUI_SRC_DIR}/toolbar.cpp
${GUI_SRC_DIR}/track_gui.cpp
${GUI_SRC_DIR}/trackprintout.cpp
${GUI_SRC_DIR}/TrackPropDlg.cpp
${GUI_SRC_DIR}/TTYScroll.cpp
${GUI_SRC_DIR}/TTYWindow.cpp
${GUI_SRC_DIR}/udev_rule_mgr.cpp
${GUI_SRC_DIR}/undo.cpp
${GUI_SRC_DIR}/update_mgr.cpp
${GUI_SRC_DIR}/viewport.cpp
${GUI_SRC_DIR}/waypointman_gui.cpp
)
if (NOT QT_ANDROID)
list(APPEND GUI_HDRS
${GUI_HDR_DIR}/wiz_ui_proto.h
${GUI_HDR_DIR}/wiz_ui.h
)
list(APPEND GUI_SRC
${GUI_SRC_DIR}/initwiz/wiz_ui_proto.cpp
${GUI_SRC_DIR}/initwiz/wiz_ui.cpp
)
endif ()
list(APPEND GUI_SRC
${GUI_S57_DIR}/src/ogrs57datasource.cpp
${GUI_S57_DIR}/src/ogrs57layer.cpp
${GUI_S57_DIR}/src/s57classregistrar.cpp
${GUI_S57_DIR}/src/s57featuredefns.cpp
${GUI_S57_DIR}/src/s57obj.cpp
${GUI_S57_DIR}/src/s57reader.cpp
${GUI_S57_DIR}/src/s57RegistrarMgr.cpp
)
if (OCPN_USE_GL)