forked from dongmingdmdm/OpenCPN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
2138 lines (1843 loc) · 77.8 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:
# - cross platform compiling
# - test with Win & OSX
# USE_GLU_TESS
# USE_GLU_DLL
# I also find it deficient in some areas. For instance, I cannot make it output a VS project with certain compile switches set as desired, namely /MT vs /MD. This means I must manually set this and other compiler options after the CMake step. Sometimes I forget. Grrr...
# set /MT for Release build, and /MTd for debug.
# define minimum cmake version
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2)
IF (COMMAND cmake_policy)
CMAKE_POLICY(SET CMP0002 OLD)
CMAKE_POLICY(SET CMP0003 OLD)
CMAKE_POLICY(SET CMP0005 OLD)
CMAKE_POLICY(SET CMP0011 OLD)
ENDIF (COMMAND cmake_policy)
PROJECT(OpenCPN)
SET(CMAKE_VERBOSE_MAKEFILE ON)
IF(APPLE)
SET(PACKAGE_NAME OpenCPN)
ELSE(APPLE)
SET(PACKAGE_NAME opencpn)
ENDIF(APPLE)
INCLUDE( ${CMAKE_SOURCE_DIR}/VERSION.cmake )
SET(PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )
#Red Hat: /etc/redhat-release
#Slackware: /etc/slackware-version
#Slamd64: /etc/slamd64-version
#Gentoo: /etc/gentoo-release
#Ubuntu: /etc/debian_version
# Based on code from nohal
IF (NOT WIN32)
# default
SET (ARCH "i386")
SET (LIB_INSTALL_DIR "lib")
IF (EXISTS /etc/debian_version)
SET (PACKAGE_FORMAT "DEB")
SET (PACKAGE_DEPS "libc6, libwxgtk3.0-0, wx3.0-i18n, libglu1-mesa (>= 7.0.0), libgl1-mesa-glx (>= 7.0.0), zlib1g, bzip2, libtinyxml2.6.2, libportaudio2")
SET (PACKAGE_RECS "xcalib,xdg-utils")
SET (LIB_INSTALL_DIR "lib")
IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET (ARCH "amd64")
# SET (LIB_INSTALL_DIR "lib64")
ELSE (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET (ARCH "i386")
ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET(TENTATIVE_PREFIX "/usr/local")
ENDIF (EXISTS /etc/debian_version)
IF (EXISTS /etc/redhat-release)
SET (PACKAGE_FORMAT "RPM")
# SET (PACKAGE_DEPS "wxGTK mesa-libGLU mesa-libGL gettext zlib bzip2 portaudio")
IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET (ARCH "x86_64")
SET (LIB_INSTALL_DIR "lib64")
ELSE (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET (ARCH "i386")
SET (LIB_INSTALL_DIR "lib")
ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
ENDIF (EXISTS /etc/redhat-release)
IF (EXISTS /etc/suse-release OR EXISTS /etc/SuSE-release)
SET (PACKAGE_FORMAT "RPM")
# SET (PACKAGE_DEPS "libwx_baseu-2_8-0-wxcontainer MesaGLw libbz2-1 portaudio")
IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET (ARCH "x86_64")
SET (LIB_INSTALL_DIR "lib64")
ELSE (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET (ARCH "i386")
SET (LIB_INSTALL_DIR "lib")
ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
ENDIF (EXISTS /etc/suse-release OR EXISTS /etc/SuSE-release)
IF (EXISTS /etc/gentoo-release)
SET (LIB_INSTALL_DIR "lib${LIB_SUFFIX}")
ENDIF (EXISTS /etc/gentoo-release)
IF(APPLE)
IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
# IF (CMAKE_OSX_64)
SET(ARCH "x86_64")
# ENDIF (CMAKE_OSX_64)
ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
ENDIF()
ELSE (NOT WIN32)
# On WIN32 probably CMAKE_SIZEOF_VOID_P EQUAL 8, but we don't use it at all now...
SET (ARCH "i386")
ENDIF (NOT WIN32)
IF (CMAKE_SYSTEM_PROCESSOR MATCHES "arm*")
SET (ARCH "armhf")
ENDIF (CMAKE_SYSTEM_PROCESSOR MATCHES "arm*")
IF (ARCH MATCHES "armhf")
ADD_DEFINITIONS(-DARMHF)
ENDIF (ARCH MATCHES "armhf")
MESSAGE (STATUS "*** Build Architecture is ${ARCH}")
SET(PACKAGE_RELEASE "1" CACHE STRING "Package release number")
MESSAGE (STATUS "*** Staging to build ${PACKAGE_NAME} ${PACKAGE_VERSION} ***")
#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 -DBUNDLE_DOCS=BLAH -DBUNDLE_TCDATA=BLAH -DBUNDLE_GSHHS=BLAH ..
IF(APPLE OR WIN32)
IF(NOT BUNDLE_DOCS)
SET (BUNDLE_DOCS "ON")
ENDIF(NOT BUNDLE_DOCS)
IF(NOT BUNDLE_GSHHS)
SET (BUNDLE_GSHHS "CRUDE")
ENDIF(NOT BUNDLE_GSHHS)
IF(NOT BUNDLE_TCDATA)
SET (BUNDLE_TCDATA "ON")
ENDIF(NOT BUNDLE_TCDATA)
ENDIF(APPLE OR WIN32)
IF(BUNDLE_DOCS MATCHES "ON")
MESSAGE (STATUS "*** Package will include documentation ***")
IF(UNIX AND NOT APPLE)
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_docs ON")
ENDIF(UNIX AND NOT APPLE)
ELSE(BUNDLE_DOCS MATCHES "ON")
MESSAGE (STATUS "*** Package will NOT include documentation ***")
IF(UNIX AND NOT APPLE)
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_docs OFF")
ENDIF(UNIX AND NOT APPLE)
ENDIF(BUNDLE_DOCS MATCHES "ON")
IF(BUNDLE_GSHHS MATCHES "NONE|MIN|CRUDE|LOW|INTERMEDIATE|HIGH|FULL")
# Possible values: NONE (default), MIN (=Only crude polygons, no borders/rivers), CRUDE, LOW, INTERMEDIATE, HIGH, FULL
MESSAGE (STATUS "*** Package will include GSHHS basechart level: ${BUNDLE_GSHHS} ***")
IF(UNIX AND NOT APPLE)
IF(BUNDLE_GSHHS MATCHES "NONE")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_min OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_crude OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_low OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_intermediate OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_high OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_full OFF")
ENDIF(BUNDLE_GSHHS MATCHES "NONE")
IF(BUNDLE_GSHHS MATCHES "MIN")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_min ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_crude OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_low OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_intermediate OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_high OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_full OFF")
ENDIF(BUNDLE_GSHHS MATCHES "MIN")
IF(BUNDLE_GSHHS MATCHES "CRUDE")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_min ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_crude ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_low OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_intermediate OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_high OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_full OFF")
ENDIF(BUNDLE_GSHHS MATCHES "CRUDE")
IF(BUNDLE_GSHHS MATCHES "LOW")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_min ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_crude ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_low ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_intermediate OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_high OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_full OFF")
ENDIF(BUNDLE_GSHHS MATCHES "LOW")
IF(BUNDLE_GSHHS MATCHES "INTERMEDIATE")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_min ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_crude ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_low ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_intermediate ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_high OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_full OFF")
ENDIF(BUNDLE_GSHHS MATCHES "INTERMEDIATE")
IF(BUNDLE_GSHHS MATCHES "HIGH")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_min ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_crude ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_low ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_intermediate ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_high ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_full OFF")
ENDIF(BUNDLE_GSHHS MATCHES "HIGH")
IF(BUNDLE_GSHHS MATCHES "FULL")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_min ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_crude ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_low ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_intermediate ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_high ON")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_full ON")
ENDIF(BUNDLE_GSHHS MATCHES "FULL")
ENDIF(UNIX AND NOT APPLE)
ELSE(BUNDLE_GSHHS MATCHES "NONE|MIN|CRUDE|LOW|INTERMEDIATE|HIGH|FULL")
SET(BUNDLE_GSHHS "NONE")
MESSAGE (STATUS "*** Package will NOT include GSHHS data ***")
IF(UNIX AND NOT APPLE)
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_min OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_crude OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_low OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_intermediate OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_high OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_gshhs_full OFF")
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_tcdata OFF")
ENDIF(UNIX AND NOT APPLE)
ENDIF(BUNDLE_GSHHS MATCHES "NONE|MIN|CRUDE|LOW|INTERMEDIATE|HIGH|FULL")
IF(BUNDLE_TCDATA MATCHES "ON")
MESSAGE (STATUS "*** Package will include tide and current data ***")
IF(UNIX AND NOT APPLE)
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_tcdata ON")
ENDIF(UNIX AND NOT APPLE)
ELSE(BUNDLE_TCDATA MATCHES "ON")
MESSAGE (STATUS "*** Package will NOT include tide and current data ***")
IF(UNIX AND NOT APPLE)
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%define _include_tcdata OFF")
ENDIF(UNIX AND NOT APPLE)
ENDIF(BUNDLE_TCDATA MATCHES "ON")
# To build for android, use this cmake invocation..
#$cmake -DUSE_GARMINHOST=OFF -D_wx_selected_config=androideabi-qt
#-DCMAKE_TOOLCHAIN_FILE=../buildandroid/build_android.cmake
#-DwxQt_Build=build_android_53 -DwxQt_Base=/home/dsr/Projects/wxqt/wxWidgets
#-DQt_Base /home/dsr/Qt/5.3) ..
IF(DEFINED _wx_selected_config)
MESSAGE (STATUS "selected config ${_wx_selected_config}")
IF(_wx_selected_config MATCHES "androideabi-qt")
MESSAGE (STATUS "Building for wxQt-Android")
MESSAGE (STATUS "Qt_Base: " ${Qt_Base})
MESSAGE (STATUS "wxQt_Base/Build: " ${wxQt_Base} "/" ${wxQt_Build})
SET(QT_ANDROID "ON")
SET(QT_LINUX "OFF")
SET(QT "ON")
ELSE(_wx_selected_config MATCHES "androideabi-qt")
IF(_wx_selected_config MATCHES "qt")
MESSAGE (STATUS "Building for wxQt-linux")
SET(QT_ANDROID "OFF")
SET(QT_LINUX "ON")
SET(QT "ON")
ENDIF(_wx_selected_config MATCHES "qt")
ENDIF(_wx_selected_config MATCHES "androideabi-qt")
ENDIF(DEFINED _wx_selected_config)
IF((_wx_selected_config MATCHES "qt-armv7"))
#SET(CMAKE_BUILD_TYPE Debug)
ENDIF()
IF((_wx_selected_config MATCHES "qt-armv7"))
SET(wxWidgets_USE_LIBS base core xml html adv aui)
ELSE()
SET(wxWidgets_USE_LIBS net xml html adv aui core base)
ENDIF()
OPTION (USE_GL "Enable OpenGL support" ON)
# Search for opengles, short of running a program to test the speed
# of acceleration, I simply use gles on "native linux" arm systems
IF (ARCH MATCHES "arm*" AND (NOT QT_ANDROID) )
find_path(OPENGLESv1_INCLUDE_DIR GLES/gl.h )
IF (OPENGLESv1_INCLUDE_DIR)
MESSAGE (STATUS "Found OpenGLESv1")
ADD_DEFINITIONS(-DocpnUSE_GLES)
ADD_DEFINITIONS(-DocpnUSE_GL)
ADD_DEFINITIONS(-DUSE_GLU_TESS)
SET(OPENGLES_FOUND "YES")
SET(OPENGL_FOUND "YES")
SET(wxWidgets_USE_LIBS ${wxWidgets_USE_LIBS} gl )
add_subdirectory(src/glshim)
add_subdirectory(src/glu)
SET(OPENGL_LIBRARIES "GL_static" "GLU_static" "EGL" "X11" "drm" "dri2" )
ENDIF()
ENDIF()
# Building for QT_ANDROID involves a cross-building environment,
# So the include directories, flags, etc must be stated explicitly
# without trying to locate them on the host build system.
IF(QT_ANDROID)
MESSAGE (STATUS "Using GLESv1 for Android")
ADD_DEFINITIONS(-DocpnUSE_GLES)
ADD_DEFINITIONS(-DocpnUSE_GL)
ADD_DEFINITIONS(-DUSE_GLU_TESS)
ADD_DEFINITIONS(-DARMHF)
SET(OPENGLES_FOUND "YES")
SET(OPENGL_FOUND "YES")
SET(wxWidgets_USE_LIBS ${wxWidgets_USE_LIBS} gl )
add_subdirectory(src/glshim)
add_subdirectory(src/glu)
ENDIF(QT_ANDROID)
IF ((NOT OPENGLES_FOUND) AND (NOT QT_ANDROID))
IF(USE_GL)
FIND_PACKAGE(OpenGL)
ELSE(USE_GL)
MESSAGE (STATUS "OpenGL disabled by option..." )
ENDIF(USE_GL)
IF(OPENGL_FOUND)
SET(wxWidgets_USE_LIBS gl ${wxWidgets_USE_LIBS} )
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(-DUSE_GLU_TESS)
# 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 (_currentLibFile )
MESSAGE (STATUS " Adding local GLU" )
add_subdirectory(src/glu)
SET( OPENGL_LIBRARIES "GLU_static" ${REVISED_OPENGL_LIBRARIES})
MESSAGE (STATUS " Revised GL Lib: " ${OPENGL_LIBRARIES})
ELSE(OPENGL_FOUND)
MESSAGE (STATUS "OpenGL not found..." )
ENDIF(OPENGL_FOUND)
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)
FIND_PACKAGE(wxWidgets REQUIRED)
IF(MSYS)
# this is to 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(MSYS)
INCLUDE(${wxWidgets_USE_FILE})
MESSAGE (STATUS "Found wxWidgets..." )
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 (_currentLibFile )
SET( wxWidgets_LIBRARIES ${REVISED_wxWidgets_LIBRARIES})
MESSAGE (STATUS " Revised wxWidgets Libraries: ${wxWidgets_LIBRARIES}")
ENDIF(NOT QT_ANDROID)
MESSAGE (STATUS "")
MESSAGE (STATUS "*** Staging to build ${PACKAGE_NAME} ***")
#SET(CMAKE_BUILD_TYPE Debug)
IF( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE )
ENDIF( NOT CMAKE_BUILD_TYPE )
MESSAGE (STATUS "Build type: ${CMAKE_BUILD_TYPE}")
IF (NOT CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX ${TENTATIVE_PREFIX})
ENDIF (NOT CMAKE_INSTALL_PREFIX)
MESSAGE (STATUS "*** Will install to ${CMAKE_INSTALL_PREFIX} ***")
SET(PREFIX_BIN bin)
SET(PREFIX_INCLUDE include)
SET(PREFIX_DATA share)
SET(PREFIX_PKGDATA ${PREFIX_DATA}/${PACKAGE_NAME})
SET(PREFIX_LIB "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)
# require proper c++
#ADD_DEFINITIONS( "-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_DEFINITIONS( "-Wall -Wno-unused -fexceptions -rdynamic" )
ADD_DEFINITIONS( " -g -fno-strict-aliasing")
ADD_DEFINITIONS( " -DPREFIX=\\\"${CMAKE_INSTALL_PREFIX}\\\"")
# profiling with gprof
# ADD_DEFINITIONS( -pg )
# SET(CMAKE_EXE_LINKER_FLAGS -pg)
# profiling with gcov
# ADD_DEFINITIONS( "-fprofile-arcs -ftest-coverage" )
# SET(EXTRA_LIBS ${EXTRA_LIBS} "gcov")
ENDIF(NOT WIN32 AND NOT APPLE)
IF(MINGW)
ADD_DEFINITIONS( "-Wall -Wno-unused -Wno-cpp -fexceptions" )
ADD_DEFINITIONS( " -g -fno-strict-aliasing")
ENDIF(MINGW)
IF( APPLE )
ADD_DEFINITIONS( "-Wall -Wno-unused -fexceptions -Wno-overloaded-virtual" )
ADD_DEFINITIONS( " -g -fno-strict-aliasing")
ADD_DEFINITIONS( " -Wno-deprecated -Wno-deprecated-declarations" )
ADD_DEFINITIONS( " -D_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_" )
ENDIF(APPLE)
#Enable CrashReporting for Windows (visual studio) and Linux
IF(MSVC OR (NOT APPLE AND NOT QT_ANDROID AND NOT MINGW))
OPTION (OCPN_USE_CRASHREPORT "Enable crash reporting" ON)
ELSE()
SET(OCPN_USE_CRASHREPORT FALSE)
ENDIF()
IF(OCPN_USE_CRASHREPORT)
MESSAGE (STATUS "Crash reporting enabled")
IF(MSVC)
MESSAGE (STATUS "Using Windows CrashRpt")
ADD_DEFINITIONS(-DOCPN_USE_CRASHRPT)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/buildwin/crashrpt)
SET(EXTRA_LIBS ${EXTRA_LIBS} ${CMAKE_SOURCE_DIR}/buildwin/crashrpt/CrashRpt1402.lib)
SET(CMAKE_EXE_LINKER_FLAGS /DEBUG)
ELSE(MSVC)
IF(NOT APPLE AND NOT QT_ANDROID AND NOT MINGW)
IF(CMAKE_BUILD_TYPE MATCHES "Rel*")
MESSAGE (STATUS "Using Linux crash reporting")
ADD_DEFINITIONS(-DLINUX_CRASHRPT)
ENDIF(CMAKE_BUILD_TYPE MATCHES "Rel*")
ENDIF(NOT APPLE AND NOT QT_ANDROID AND NOT MINGW)
ENDIF(MSVC)
ENDIF(OCPN_USE_CRASHREPORT)
# Add some definitions to satisfy MS
IF(MSVC)
ADD_DEFINITIONS(-D__MSVC__)
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE)
ADD_DEFINITIONS(-DPSAPI_VERSION=1)
ENDIF(MSVC)
# Location where cmake first looks for cmake modules.
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/build)
# Let cmake find additional modules private to opencpn
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/")
IF (NOT WIN32 AND NOT APPLE)
IF(QT_ANDROID)
SET(CMAKE_BUILD_TYPE Debug)
ADD_DEFINITIONS(-D__WXQT__)
ADD_DEFINITIONS(-DOCPN_USE_WRAPPER)
ADD_DEFINITIONS(-D__OCPN__ANDROID__)
ADD_DEFINITIONS(-DANDROID)
SET(CMAKE_CXX_FLAGS "-pthread -fPIC -s -O2")
## Compiler flags
# if(CMAKE_COMPILER_IS_GNUCXX)
# set(CMAKE_CXX_FLAGS "-O2") ## Optimize
set(CMAKE_EXE_LINKER_FLAGS "-s") ## Strip binary
# endif()
INCLUDE_DIRECTORIES("${Qt_Base}/android_armv7/include/QtCore")
INCLUDE_DIRECTORIES("${Qt_Base}/android_armv7/include")
INCLUDE_DIRECTORIES("${Qt_Base}/android_armv7/include/QtWidgets")
INCLUDE_DIRECTORIES("${Qt_Base}/android_armv7/include/QtGui")
INCLUDE_DIRECTORIES("${Qt_Base}/android_armv7/include/QtOpenGL")
INCLUDE_DIRECTORIES("${Qt_Base}/android_armv7/include/QtTest")
INCLUDE_DIRECTORIES( "${wxQt_Base}/${wxQt_Build}/lib/wx/include/arm-linux-androideabi-qt-unicode-static-3.1")
INCLUDE_DIRECTORIES("${wxQt_Base}/include")
ADD_DEFINITIONS(-DQT_WIDGETS_LIB)
ENDIF(QT_ANDROID)
IF(UNIX AND NOT QT_ANDROID)
INCLUDE("FindPortaudio.cmake")
IF (PORTAUDIO_FOUND)
MESSAGE (STATUS "Portaudio Found")
INCLUDE_DIRECTORIES(${PORTAUDIO_INCLUDE_DIRS})
SET(EXTRA_LIBS ${EXTRA_LIBS} ${PORTAUDIO_LIBRARIES})
ADD_DEFINITIONS(${PORTAUDIO_DEFINITIONS})
ADD_DEFINITIONS(-DOCPN_USE_PORTAUDIO)
ELSE (PORTAUDIO_FOUND)
MESSAGE (STATUS "Portaudio Not Found...")
ENDIF (PORTAUDIO_FOUND)
#SET(EXTRA_LIBS ${EXTRA_LIBS} "/usr/lib/i386-linux-gnu/libportaudio.so.2.0.0")
#ADD_DEFINITIONS(-DOCPN_USE_PORTAUDIO)
ENDIF(UNIX AND NOT QT_ANDROID)
ENDIF (NOT WIN32 AND NOT APPLE)
IF(WIN32)
OPTION(OCPN_USE_EXTERN_CURL "Use external libcurl" OFF)
ELSE(WIN32)
SET(OCPN_USE_EXTERN_CURL ON)
ENDIF(WIN32)
IF(NOT QT_ANDROID)
IF(OCPN_USE_EXTERN_CURL)
FIND_PACKAGE(CURL REQUIRED)
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
ELSE(OCPN_USE_EXTERN_CURL)
INCLUDE("Curl.cmake")
MESSAGE (STATUS "Using local curl library...")
ENDIF(OCPN_USE_EXTERN_CURL)
SET(SRC_WXCURL
src/wxcurl/base.cpp
src/wxcurl/dav.cpp
src/wxcurl/davtool.cpp
src/wxcurl/dialog.cpp
src/wxcurl/ftp.cpp
src/wxcurl/ftpparse.cpp
src/wxcurl/ftptool.cpp
src/wxcurl/http.cpp
src/wxcurl/panel.cpp
src/wxcurl/telnet.cpp
src/wxcurl/thread.cpp
src/wxcurl/utils.cpp
)
ADD_LIBRARY(WXCURL ${SRC_WXCURL})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/wxcurl)
SET(EXTRA_LIBS ${EXTRA_LIBS} WXCURL)
SET(EXTRA_LIBS ${EXTRA_LIBS} ${CURL_LIBRARIES})
MESSAGE (STATUS "wxCurl configured...")
IF(WIN32 AND OCPN_USE_EXTERN_CURL)
find_library(CURL_LIBRARY_DLL NAMES
curl
curllib
libcurl_imp
curllib_static
libcurl
PATH_SUFFIXES dll
)
INSTALL(FILES ${CURL_LIBRARY_DLL} DESTINATION ".")
ENDIF(WIN32 AND OCPN_USE_EXTERN_CURL)
ENDIF(NOT QT_ANDROID)
OPTION(OCPN_USE_SVG "Use SVG graphics" ON)
IF(OCPN_USE_SVG)
MESSAGE(STATUS "SVG support enabled...")
IF(NOT QT_ANDROID)
IF(NOT WIN32)
#Find Cairo
IF( CAIRO_INCLUDE_DIR )
# Already in cache, be silent
SET( CAIRO_FIND_QUIETLY TRUE )
ENDIF( CAIRO_INCLUDE_DIR )
FIND_PATH( CAIRO_INCLUDE_DIR cairo.h
PATHS /usr/local/include /usr/include
PATH_SUFFIXES cairo/ libcairo/ cairo/libcairo/ )
SET( CAIRO_NAMES libcairo cairo )
FIND_LIBRARY( CAIRO_LIBRARY
NAMES ${CAIRO_NAMES}
PATHS /usr/lib /usr/local/lib /usr/lib/i386-linux-gnu)
GET_FILENAME_COMPONENT( CAIRO_LIBRARY_DIR ${CAIRO_LIBRARY} PATH )
# handle the QUIETLY and REQUIRED arguments and set CAIRO_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE( "FindPackageHandleStandardArgs" )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( "CAIRO" DEFAULT_MSG CAIRO_INCLUDE_DIR CAIRO_LIBRARY )
MARK_AS_ADVANCED( CAIRO_INCLUDE_DIR CAIRO_LIBRARY )
if ( NOT CAIRO_FOUND )
message(FATAL_ERROR "Cairo component required, but not found!")
endif()
IF(NOT WIN32 AND NOT APPLE)
OPTION(OCPN_FORCE_GTK3 "Force the build to use GTK3" OFF)
IF(NOT OCPN_FORCE_GTK3)
FIND_PACKAGE(GTK2)
ENDIF(NOT OCPN_FORCE_GTK3)
IF(GTK2_FOUND)
INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
SET(GTK_LIBRARIES ${GTK2_LIBRARIES})
MESSAGE(STATUS "Building against GTK2...")
ELSE(GTK2_FOUND)
FIND_PACKAGE(GTK3)
INCLUDE_DIRECTORIES(${GTK3_INCLUDE_DIRS})
SET(GTK_LIBRARIES ${GTK3_LIBRARIES})
MESSAGE(STATUS "Building against GTK3...")
ENDIF(GTK2_FOUND)
ENDIF(NOT WIN32 AND NOT APPLE)
# Find FFMPEG - we have it disabled in our wxSVG
#set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE SWRESAMPLE AVRESAMPLE)
#unset(FFMPEG_LIBRARIES CACHE)
#find_package(FFmpeg)
#if ( NOT AVCODEC_FOUND OR NOT AVFORMAT_FOUND OR NOT AVUTIL_FOUND OR NOT SWSCALE_FOUND )
# message(FATAL_ERROR "FFmpeg component required, but not found!")
#endif()
#set(VIDEO_FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${SWSCALE_LIBRARIES})
FIND_PACKAGE(EXPAT REQUIRED)
ELSE(NOT WIN32)
#On Windows, we have our own expat
SET(EXPAT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/buildwin/expat-2.1.0/include)
INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIR})
#And cairo
SET(CAIRO_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/buildwin/gtk/include)
ENDIF(NOT WIN32)
INCLUDE_DIRECTORIES(${CAIRO_INCLUDE_DIR})
IF(APPLE)
INCLUDE_DIRECTORIES(${CAIRO_INCLUDE_DIR}/..)
ENDIF(APPLE)
#INCLUDE_DIRECTORIES(${FFMPEG_INCLUDE_DIRS})
ADD_DEFINITIONS(-DUSE_RENDER_CAIRO)
ADD_DEFINITIONS(-DocpnUSE_SVG)
IF(WIN32)
SET(SVG_LIBS
${CMAKE_SOURCE_DIR}/buildwin/gtk/cairo.lib
${CMAKE_SOURCE_DIR}/buildwin/expat-2.1.0/expat.lib
)
FILE(GLOB gtkdll_files "${CMAKE_CURRENT_SOURCE_DIR}/buildwin/gtk/*.dll")
INSTALL(FILES ${gtkdll_files} DESTINATION ".")
FILE(GLOB expatdll_files "${CMAKE_CURRENT_SOURCE_DIR}/buildwin/expat-2.1.0/*.dll")
INSTALL(FILES ${expatdll_files} DESTINATION ".")
MESSAGE(STATUS "GTK and Expat DLLs bundled into the installer package...")
ELSE(WIN32)
SET(SVG_LIBS
${CAIRO_LIBRARY}
#${FFMPEG_LIBRARIES}
${EXPAT_LIBRARIES}
${GTK_LIBRARIES}
)
ENDIF(WIN32)
SET(SRC_WXSVG
src/wxsvg/src/CSSStyleDeclaration.cpp
src/wxsvg/src/CSSValue.cpp
src/wxsvg/src/Elements_CopyConstructors.cpp
src/wxsvg/src/Elements_GetAttribute.cpp
src/wxsvg/src/Elements_GetAttributes.cpp
src/wxsvg/src/Elements_HasAttribute.cpp
src/wxsvg/src/Elements_SetAttribute.cpp
src/wxsvg/src/GetSVGDocument.cpp
src/wxsvg/src/NodeList.cpp
src/wxsvg/src/SVGAngle.cpp
src/wxsvg/src/SVGAnimateTransformElement.cpp
src/wxsvg/src/SVGAnimatedType.cpp
src/wxsvg/src/SVGAnimationElement.cpp
src/wxsvg/src/SVGCanvas.cpp
src/wxsvg/src/SVGCanvasItem.cpp
src/wxsvg/src/SVGCircleElement.cpp
src/wxsvg/src/SVGColor.cpp
src/wxsvg/src/SVGDocument.cpp
src/wxsvg/src/SVGElementInstanceList.cpp
src/wxsvg/src/SVGEllipseElement.cpp
src/wxsvg/src/SVGFEGaussianBlurElement.cpp
src/wxsvg/src/SVGFilterElement.cpp
src/wxsvg/src/SVGFitToViewBox.cpp
src/wxsvg/src/SVGImageElement.cpp
src/wxsvg/src/SVGLength.cpp
src/wxsvg/src/SVGLengthList.cpp
src/wxsvg/src/SVGLineElement.cpp
src/wxsvg/src/SVGLocatable.cpp
src/wxsvg/src/SVGMarkerElement.cpp
src/wxsvg/src/SVGMatrix.cpp
src/wxsvg/src/SVGNumberList.cpp
src/wxsvg/src/SVGPaint.cpp
src/wxsvg/src/SVGPathElement.cpp
src/wxsvg/src/SVGPathSegList.cpp
src/wxsvg/src/SVGPoint.cpp
src/wxsvg/src/SVGPointList.cpp
src/wxsvg/src/SVGPolygonElement.cpp
src/wxsvg/src/SVGPolylineElement.cpp
src/wxsvg/src/SVGPreserveAspectRatio.cpp
src/wxsvg/src/SVGRadialGradientElement.cpp
src/wxsvg/src/SVGRect.cpp
src/wxsvg/src/SVGRectElement.cpp
src/wxsvg/src/SVGSVGElement.cpp
src/wxsvg/src/SVGStringList.cpp
src/wxsvg/src/SVGStylable.cpp
src/wxsvg/src/SVGTests.cpp
src/wxsvg/src/SVGTextContentElement.cpp
src/wxsvg/src/SVGTextElement.cpp
src/wxsvg/src/SVGTransform.cpp
src/wxsvg/src/SVGTransformList.cpp
src/wxsvg/src/SVGTransformable.cpp
src/wxsvg/src/SVGUseElement.cpp
src/wxsvg/src/SVGVideoElement.cpp
src/wxsvg/src/imagsvg.cpp
#src/wxsvg/src/mediadec_ffmpeg.cpp
src/wxsvg/src/svgctrl.cpp
src/wxsvg/src/cairo/SVGCanvasCairo.cpp
src/wxsvg/src/cairo/SVGCanvasCairo.h
src/wxsvg/src/cairo/SVGCanvasImageCairo.cpp
src/wxsvg/src/cairo/SVGCanvasImageCairo.h
src/wxsvg/src/cairo/SVGCanvasPathCairo.cpp
src/wxsvg/src/cairo/SVGCanvasPathCairo.h
src/wxsvg/src/cairo/SVGCanvasTextCairo.cpp
src/wxsvg/src/cairo/SVGCanvasTextCairo.h
src/wxsvg/src/svgxml/svgxml.cpp
src/wxsvg/src/svgxml/svgxmlhelpr.cpp
)
ADD_LIBRARY(WXSVG ${SRC_WXSVG})
TARGET_LINK_LIBRARIES(WXSVG ${SVG_LIBS})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/wxsvg/include/wxSVG)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/wxsvg/include/wxSVGXML)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/wxsvg/include)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/wxsvg/src)
SET(EXTRA_LIBS ${EXTRA_LIBS} WXSVG)
ENDIF(NOT QT_ANDROID)
ENDIF(OCPN_USE_SVG)
FIND_PACKAGE(Gettext REQUIRED)
IF(UNIX)
IF(NOT QT_ANDROID) # this should be detected by the grib plugin
FIND_PACKAGE(BZip2 REQUIRED)
INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR})
FIND_PACKAGE(ZLIB REQUIRED)
FIND_PACKAGE(X11)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
FIND_PACKAGE(TinyXML)
ENDIF(NOT QT_ANDROID)
ENDIF(UNIX)
# For convenience we define the sources as a variable. You can add
# header files and cpp/c files and CMake will sort them out
SET(SRC_NMEA0183
src/nmea0183/LatLong.hpp
src/nmea0183/latlong.cpp
src/nmea0183/long.cpp
src/nmea0183/nmea0183.cpp
src/nmea0183/nmea0183.hpp
src/nmea0183/Response.hpp
src/nmea0183/response.cpp
src/nmea0183/RMB.hpp
src/nmea0183/rmb.cpp
src/nmea0183/Sentence.hpp
src/nmea0183/sentence.cpp
src/nmea0183/talkerid.cpp
src/nmea0183/RMC.HPP
src/nmea0183/rmc.cpp
src/nmea0183/hexvalue.cpp
src/nmea0183/lat.cpp
src/nmea0183/expid.cpp
src/nmea0183/wpl.hpp
src/nmea0183/wpl.cpp
src/nmea0183/rte.hpp
src/nmea0183/rte.cpp
src/nmea0183/hdt.hpp
src/nmea0183/hdt.cpp
src/nmea0183/hdg.hpp
src/nmea0183/hdg.cpp
src/nmea0183/hdm.hpp
src/nmea0183/hdm.cpp
src/nmea0183/gll.hpp
src/nmea0183/gll.cpp
src/nmea0183/vtg.hpp
src/nmea0183/vtg.cpp
src/nmea0183/gga.hpp
src/nmea0183/gga.cpp
src/nmea0183/gsv.hpp
src/nmea0183/gsv.cpp
src/nmea0183/GPwpl.cpp
src/nmea0183/GPwpl.hpp
src/nmea0183/apb.cpp
src/nmea0183/apb.hpp
src/nmea0183/xte.cpp
src/nmea0183/xte.hpp
)
ADD_LIBRARY(NMEA0183 ${SRC_NMEA0183})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/nmea0183)
#IF(NOT WIN32)
#OPTION (USE_GPSD "Enable GPSD Library" ON)
#IF (USE_GPSD)
# message (STATUS "GPSD Library support: enabled")
#
## FIND_PACKAGE(gps QUIET)
# FIND_PACKAGE(gps)
# IF (GPS_FOUND)
# message (STATUS "Building with libgps includes")
# INCLUDE_DIRECTORIES(${GPS_INCLUDE_DIR})
# ADD_DEFINITIONS(${GPS_DEFINITIONS})
# ADD_DEFINITIONS(-DBUILD_WITH_LIBGPS)
# message (STATUS "GPS library include location is ${GPS_INCLUDE_DIR}")
## SET(EXTRA_LIBS ${EXTRA_LIBS} ${GPS_LIBRARY})
# ELSE (GPS_FOUND)
# message (STATUS "Gps library not found")
# ENDIF (GPS_FOUND)
#ENDIF (USE_GPSD)
#ENDIF (NOT WIN32)
SET(HDRS
include/ocpn_types.h
include/ocpndc.h
include/chart1.h
include/bbox.h
include/ocpn_pixel.h
include/chartdb.h
include/chartdbs.h
include/chartimg.h
include/chcanv.h
include/timers.h
include/emboss_data.h
include/AISTargetQueryDialog.h
include/AIS_Bitstring.h
include/AISTargetListDialog.h
include/OCPNListCtrl.h
include/AISTargetAlertDialog.h
include/AIS_Decoder.h
include/AIS_Target_Data.h
include/CM93DSlide.h
include/GoToPositionDialog.h
include/RolloverWin.h
include/S57QueryDialog.h
include/S57ObjectDesc.h
include/S57Light.h
include/S57ClassRegistrar.h
include/MarkIcon.h
include/SendToGpsDlg.h
include/TCWin.h
include/tide_time.h
include/ChInfoWin.h
include/ocpCursor.h
include/Quilt.h
include/Hyperlink.h
include/NavObjectCollection.h
include/RoutePoint.h
include/Route.h
include/SelectItem.h
include/Select.h
include/FontMgr.h
include/FontDesc.h
include/vector2D.h
include/OCPNSoundData.h
include/OCPN_Sound.h
include/NMEALogWindow.h
include/WindowDestroyListener.h
include/TTYWindow.h
include/TTYScroll.h
include/Layer.h
include/concanv.h
include/cutil.h
include/georef.h
include/navutil.h
include/routeman.h
include/routemanagerdialog.h
include/routeprop.h
include/routeprintout.h
include/PositionParser.h
include/printtable.h
include/chartbarwin.h
include/tcmgr.h
include/Station_Data.h
include/IDX_entry.h
include/TC_Error_Code.h
include/TCDataFactory.h
include/TCDS_Ascii_Harmonic.h
include/TCDS_Binary_Harmonic.h
include/TCDataSource.h
include/thumbwin.h
include/options.h
include/gshhs.h
include/kml.h
include/undo.h
include/about.h
include/ais.h
include/pluginmanager.h
include/ocpn_plugin.h
include/gpxdocument.h
include/wx/json_defs.h
include/wx/jsonwriter.h
include/wx/jsonreader.h
include/styles.h
include/toolbar.h
include/compass.h
include/geodesic.h
include/datastream.h
include/OCPN_DataStreamEvent.h
include/ConnectionParams.h
include/OCP_DataStreamInput_Thread.h
include/dsPortType.h
include/multiplexer.h
include/OCPNRegion.h
include/LLRegion.h
include/TrackPropDlg.h
include/LinkPropDlg.h
include/viewport.h
include/canvasMenu.h
include/OCPNPlatform.h
include/S57Sector.h
)
SET(SRCS
src/chart1.cpp
src/bbox.cpp
src/ocpn_pixel.cpp
src/ocpndc.cpp
src/chartdb.cpp
src/chartdbs.cpp
src/chartimg.cpp
src/chcanv.cpp
src/ocpCursor.cpp
src/TCWin.cpp
src/S57QueryDialog.cpp
src/GoToPositionDialog.cpp
src/CM93DSlide.cpp
src/RolloverWin.cpp
src/ChInfoWin.cpp
src/AISTargetQueryDialog.cpp
src/AIS_Bitstring.cpp
src/AISTargetListDialog.cpp
src/AISTargetAlertDialog.cpp
src/AIS_Decoder.cpp
src/AIS_Target_Data.cpp
src/OCPNListCtrl.cpp
src/Quilt.cpp
src/Hyperlink.cpp
src/NavObjectCollection.cpp
src/RoutePoint.cpp
src/Route.cpp
src/SelectItem.cpp
src/Select.cpp
src/FontMgr.cpp
src/FontDesc.cpp
src/OCPNSoundData.cpp
src/OCPN_Sound.cpp
src/NMEALogWindow.cpp
src/TTYWindow.cpp
src/TTYScroll.cpp
src/SendToGpsDlg.cpp
src/Layer.cpp
src/concanv.cpp
src/cutil.cpp
src/georef.cpp
src/navutil.cpp
src/routeman.cpp
src/routemanagerdialog.cpp
src/routeprop.cpp
src/routeprintout.cpp
src/PositionParser.cpp
src/printtable.cpp
src/chartbarwin.cpp