forked from OpenCPN/OpenCPN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
1108 lines (932 loc) · 38.6 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 <anton@martchukov.com>
## 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)
# This should be 2.8.0 to have FindGTK2 module
IF (COMMAND cmake_policy)
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
# TODO: Should PREFIX be set as well?
# 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, libwxgtk2.8-0 (>= 2.8.7.1), libglu1-mesa (>= 7.0.0), libgl1-mesa-glx (>= 7.0.0), zlib1g, bzip2, libsdl1.2debian, libtinyxml2.6.2")
SET (PACKAGE_RECS "xcalib")
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")
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")
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 "wxWidgets-wxcontainer MesaGLw libbz2")
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 "armel")
ENDIF (CMAKE_SYSTEM_PROCESSOR MATCHES "arm*")
MESSAGE (STATUS "*** Build Architecture is ${ARCH}")
SET(PACKAGE_RELEASE "1" CACHE STRING "Package release number")
MESSAGE (STATUS "*** Staging to build ${PACKAGE_NAME} ${PACKAGE_VERSION} ***")
SET(wxWidgets_USE_LIBS base core net xml html adv aui)
FIND_PACKAGE(OpenGL REQUIRED)
IF(OPENGL_GLU_FOUND)
SET(wxWidgets_USE_LIBS ${wxWidgets_USE_LIBS} gl )
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
MESSAGE (STATUS "Found OpenGL..." )
MESSAGE (STATUS " Lib: " ${OPENGL_LIBRARIES})
MESSAGE (STATUS " Include: " ${OPENGL_INCLUDE_DIR})
ELSE(OPENGL_GLU_FOUND)
MESSAGE (STATUS "OpenGL not found..." )
ENDIF(OPENGL_GLU_FOUND)
# 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)
INCLUDE(${wxWidgets_USE_FILE})
# Search for wxWidgets 2.9
STRING(REGEX MATCHALL "2.9" wx_Version "${wxWidgets_INCLUDE_DIRS}")
MESSAGE (STATUS "")
MESSAGE (STATUS "*** Staging to build ${PACKAGE_NAME} ***")
#SET(CMAKE_BUILD_TYPE Debug)
IF (PREFIX)
SET(CMAKE_INSTALL_PREFIX ${PREFIX})
ENDIF (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)
ADD_DEFINITIONS( "-Wall -Wno-unused -fexceptions -rdynamic" )
ADD_DEFINITIONS( " -g -fno-strict-aliasing")
ENDIF(NOT WIN32)
# Add some definitions to satisfy MS
ADD_DEFINITIONS(-DUSE_GLU_TESS)
IF(WIN32)
ADD_DEFINITIONS(-D__MSVC__)
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE)
ADD_DEFINITIONS(-DPSAPI_VERSION=1)
ENDIF(WIN32)
# 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}/")
FIND_PACKAGE(GTK2 2.6)
IF (GTK2_FOUND)
MESSAGE (STATUS "Found GTK2")
ADD_DEFINITIONS(-DocpnUSE_GTK_OPTIMIZE)
ADD_DEFINITIONS(-DocpnHAS_GTK)
INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
SET(EXTRA_LIBS ${EXTRA_LIBS} ${GTK2_LIBRARIES})
# Add a definition to satisfy some linux system builds, avoiding Apple builds
IF (NOT WIN32 AND NOT APPLE)
ADD_DEFINITIONS("`pkg-config --cflags --libs gtk+-2.0`")
ENDIF (NOT WIN32 AND NOT APPLE)
ELSE(GTK2_FOUND)
MESSAGE (STATUS "GTK2 Not found...")
ENDIF (GTK2_FOUND)
FIND_PACKAGE(Gettext REQUIRED)
IF(UNIX)
FIND_PACKAGE(BZip2 REQUIRED)
INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR})
FIND_PACKAGE(ZLIB REQUIRED)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
FIND_PACKAGE(TinyXML)
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
)
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/concanv.h
include/cutil.h
include/georef.h
include/navutil.h
include/routeman.h
include/routemanagerdialog.h
include/routeprop.h
include/statwin.h
include/tcmgr.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/chartsymbols.h
include/razdsparser.h
include/styles.h
include/toolbar.h
include/compasswin.h
include/geodesic.h
include/datastream.h
include/multiplexer.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/concanv.cpp
src/cutil.c
src/georef.c
src/navutil.cpp
src/routeman.cpp
src/routemanagerdialog.cpp
src/routeprop.cpp
src/statwin.cpp
src/tcmgr.cpp
src/thumbwin.cpp
src/options.cpp
src/gshhs.cpp
src/kml.cpp
src/undo.cpp
src/about.cpp
src/ais.cpp
src/pluginmanager.cpp
src/gpxdocument.cpp
src/wxJSON/jsonwriter.cpp
src/wxJSON/jsonreader.cpp
src/wxJSON/jsonval.cpp
src/chartsymbols.cpp
src/razdsparser.cpp
src/styles.cpp
src/toolbar.cpp
src/compasswin.cpp
src/geodesic.cpp
src/datastream.cpp
src/multiplexer.cpp
)
IF(wx_Version MATCHES "2.9")
ELSE(wx_Version MATCHES "2.9")
SET(HDRS ${HDRS} include/scrollingdialog.h )
SET(SRCS ${SRCS} src/scrollingdialog.cpp)
ENDIF(wx_Version MATCHES "2.9")
SET( PACKAGE_HEADERS "" )
SET(SRC_TINYXML
src/tinyxml.cpp
src/tinyxmlerror.cpp
src/tinyxmlparser.cpp
include/tinyxml.h
)
IF(TINYXML_FOUND)
message (STATUS "Building with tinyxml includes")
INCLUDE_DIRECTORIES(${TINYXML_INCLUDE_DIR})
ADD_DEFINITIONS(-DTIXML_USE_STL)
ELSE(TINYXML_FOUND)
message (STATUS "tinyxml library not found")
SET(SRCS ${SRCS} ${SRC_TINYXML})
ADD_DEFINITIONS(-DTIXML_USE_STL)
ENDIF(TINYXML_FOUND)
OPTION (USE_S57 "Enable S57 ENC support" ON)
IF (USE_S57)
message (STATUS "S57 ENC support: enabled")
ADD_DEFINITIONS(-DUSE_S57)
SET(SRC_S57ENC
include/s52plib.h
include/s52utils.h
include/s57chart.h
include/mygeom.h
src/s52cnsy.cpp
src/s52plib.cpp
src/s52utils.cpp
src/s57chart.cpp
src/cm93.cpp
src/mygeom.cpp
include/cm93.h
src/tri.c
src/myiso8211/ddffielddefn.cpp
src/myiso8211/ddfmodule.cpp
src/myiso8211/ddfrecord.cpp
src/myiso8211/ddfsubfielddefn.cpp
src/myiso8211/ddffield.cpp
src/myiso8211/ddfutils.cpp
src/mygdal/cpl_config.h
src/mygdal/gdal_priv.h
src/mygdal/cpl_conv.h
src/mygdal/iso8211.h
src/mygdal/cpl_csv.h
src/mygdal/ogr_api.h
src/mygdal/cpl_error.h
src/mygdal/ogr_attrind.h
src/mygdal/cpl_list.h
src/mygdal/cpl_minixml.h
src/mygdal/ogr_feature.h
src/mygdal/cpl_multiproc.h
src/mygdal/ogr_geometry.h
src/mygdal/cpl_odbc.h
src/mygdal/ogr_p.h
src/mygdal/ogr_core.h
src/mygdal/cpl_port.h
src/mygdal/ogr_s57.h
src/mygdal/cpl_string.h
src/mygdal/ogr_spatialref.h
src/mygdal/cpl_vsi.h
src/mygdal/ogrsf_frmts.h
src/mygdal/gdal.h
src/mygdal/s57.h
src/mygdal/gdal_frmts.h
src/mygdal/ddfrecordindex.cpp
src/mygdal/cpl_conv.cpp
src/mygdal/cpl_csv.cpp
src/mygdal/cpl_error.cpp
src/mygdal/cpl_findfile.cpp
src/mygdal/cpl_minixml.cpp
src/mygdal/cpl_path.cpp
src/mygdal/cpl_string.cpp
src/mygdal/cpl_vsisimple.cpp
src/mygdal/cplgetsymbol.cpp
src/mygdal/ograssemblepolygon.cpp
src/mygdal/ogrcurve.cpp
src/mygdal/ogrfeature.cpp
src/mygdal/ogrfeaturedefn.cpp
src/mygdal/ogrfielddefn.cpp
src/mygdal/ogrgeometry.cpp
src/mygdal/ogrgeometrycollection.cpp
src/mygdal/ogrgeometryfactory.cpp
src/mygdal/ogrlinearring.cpp
src/mygdal/ogrlinestring.cpp
src/mygdal/ogrmultilinestring.cpp
src/mygdal/ogrmultipoint.cpp
src/mygdal/ogrmultipolygon.cpp
src/mygdal/ogrpoint.cpp
src/mygdal/ogrpolygon.cpp
src/mygdal/ogrs57datasource.cpp
src/mygdal/ogrlayer.cpp
src/mygdal/ogrs57layer.cpp
src/mygdal/ogrutils.cpp
src/mygdal/s57classregistrar.cpp
src/mygdal/s57featuredefns.cpp
src/mygdal/s57reader.cpp
src/mygdal/gdal_misc.cpp
)
ADD_LIBRARY(S57ENC ${SRC_S57ENC})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/mygdal)
SET(EXTRA_LIBS ${EXTRA_LIBS} S57ENC)
ELSE (USE_S57)
message (STATUS "S57 ENC support: disabled")
ENDIF (USE_S57)
OPTION (USE_GARMINHOST "Enable Garmin Host Mode support" ON)
IF (USE_GARMINHOST)
message (STATUS "Garmin Host Mode support: enabled")
ADD_DEFINITIONS(-DUSE_GARMINHOST)
SET(SRC_GARMINHOST
src/garmin/jeeps/gpsapp.c
src/garmin/jeeps/gpscom.c
src/garmin/jeeps/gpsmath.c
src/garmin/jeeps/gpsmem.c
src/garmin/jeeps/gpsprot.c
src/garmin/jeeps/gpsread.c
src/garmin/jeeps/gpsdevice.c
src/garmin/jeeps/gpsdevice_ser.c
src/garmin/jeeps/gpsdevice_usb.c
src/garmin/jeeps/gpsrqst.c
src/garmin/jeeps/gpssend.c
src/garmin/jeeps/gpsserial.c
src/garmin/jeeps/gpsutil.c
src/garmin/jeeps/gpsusbread.c
src/garmin/jeeps/gpsusbsend.c
src/garmin/jeeps/gpsusbcommon.c
src/garmin/jeeps/garmin_wrapper_utils.c
src/garmin/jeeps/garmin_wrapper.cpp
src/garmin/jeeps/garmin_gps.h
src/garmin/jeeps/garmin_wrapper.h
src/garmin/jeeps/gpsapp.h
src/garmin/jeeps/gpsdatum.h
src/garmin/jeeps/gpsfmt.h
src/garmin/jeeps/gpsmath.h
src/garmin/jeeps/gpsport.h
src/garmin/jeeps/gpsprot.h
src/garmin/jeeps/gpsrqst.h
src/garmin/jeeps/gpsserial.h
src/garmin/jeeps/gpsusbint.h
src/garmin/jeeps/garminusb.h
src/garmin/jeeps/garmin_wrapper_utils.h
src/garmin/jeeps/gpscom.h
src/garmin/jeeps/gpsdevice.h
src/garmin/jeeps/gpsinput.h
src/garmin/jeeps/gpsmem.h
src/garmin/jeeps/gpsproj.h
src/garmin/jeeps/gpsread.h
src/garmin/jeeps/gpssend.h
src/garmin/jeeps/gpsusbcommon.h
src/garmin/jeeps/gpsutil.h
)
IF(WIN32)
SET(SRC_GARMINHOST ${SRC_GARMINHOST} src/garmin/jeeps/gpsusbwin.c)
ENDIF(WIN32)
ADD_LIBRARY(GARMINHOST ${SRC_GARMINHOST})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/garmin/jeeps)
SET(EXTRA_LIBS ${EXTRA_LIBS} GARMINHOST)
IF(WIN32)
ADD_DEFINITIONS(-D__WIN32__)
ENDIF(WIN32)
ELSE (USE_GARMINHOST)
message (STATUS "Garmin Host Mode support: disabled")
ENDIF (USE_GARMINHOST)
#TODO
#dnl
#dnl Use OpenGL tesselator or Internal tesselator
#dnl
#tess_internal=false
#tess_glu=true
#AC_ARG_WITH(tess_internal,
# [[ --with-tess-internal use Internal Polygon Tesselator]],
# [tess_internal=true]
# )
#
#if [[ "$tess_internal" = "false" ]] ; then
# dnl Look for and qualify an external GLU library
# echo "checking for useable OpenGLU Library"
# AC_CHECK_LIB(GLU, gluNewTess, true, dnl here true is just a nop
# AC_MSG_ERROR([*** libGLU not found. Run configure using --with-tess-internal.]))
#
# GL_LIBS="-lGL -lGLU"
# AC_SUBST(GL_LIBS)
#
# GL_CFLAGS="-DUSE_GLU_TESS"
# AC_SUBST(GL_CFLAGS)
#fi
# If we build for windows systems, we also include the resource file
# containing the manifest, icon and other resources
IF(WIN32)
SET(SRCS ${SRCS} src/opencpn.rc)
ENDIF(WIN32)
# Various data files
SET(gshhs
data/gshhs/poly-c-1.dat
data/gshhs/poly-i-1.dat
data/gshhs/poly-l-1.dat
data/gshhs/wdb_borders_c.b
data/gshhs/wdb_borders_i.b
data/gshhs/wdb_borders_l.b
data/gshhs/wdb_rivers_c.b
data/gshhs/wdb_rivers_i.b
data/gshhs/wdb_rivers_l.b
)
SET(uiData
src/bitmaps/styles.xml
src/bitmaps/toolicons_journeyman.png
src/bitmaps/toolicons_journeyman_flat.png
src/bitmaps/toolicons_traditional.png
)
IF (USE_S57)
SET(s57data
data/s57data/attdecode.csv
data/s57data/S52RAZDS.RLE
data/s57data/s57attributes.csv
data/s57data/s57expectedinput.csv
data/s57data/s57objectclasses.csv
data/s57data/rastersymbols-dark.png
data/s57data/rastersymbols-day.png
data/s57data/rastersymbols-dusk.png
data/s57data/chartsymbols.xml
)
ENDIF (USE_S57)
SET(tcData
data/tcdata/HARMONIC
data/tcdata/HARMONIC.IDX
data/tcdata/README.harmonics
)
IF(APPLE)
INCLUDE_DIRECTORIES(/usr/X11/include /usr/X11/include/GL)
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}")
SET(CMAKE_CXX_FLAGS "-O2 -arch ${ARCH}")
SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -arch ${ARCH}")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "-O2 -arch ${ARCH}")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -arch ${ARCH}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O3 -arch ${ARCH}")
SET(CMAKE_EXE_LINKER_FLAGS "-O2 -arch ${ARCH}")
SET(CMAKE_SHARED_LINKER_FLAGS "-O2 -arch ${ARCH}")
SET(CMAKE_MODULE_LINKER_FLAGS "-O2 -arch ${ARCH}")
SET(SRCS ${SRCS}
include/macutils.h
src/macutils.c
)
ENDIF(APPLE)
IF(WIN32)
IF(MSVC)
SET(CMAKE_C_FLAGS_DEBUG "/MDd /Ob0 /Od /D_DEBUG /Zi /RTC1" )
SET(CMAKE_C_FLAGS_MINSIZEREL "/MD /O1 /Ob1 /D NDEBUG")
SET(CMAKE_C_FLAGS_RELEASE "/MD /O2 /Ob2 /D NDEBUG")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/MD /O2 /Ob1 /D NDEBUG /Zi")
SET(CMAKE_CXX_FLAGS_DEBUG "/MDd /Ob0 /Od /D_DEBUG /Zi /RTC1")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MD /O1 /Ob1 /D NDEBUG")
SET(CMAKE_CXX_FLAGS_RELEASE "/MD /O2 /Ob2 /D NDEBUG")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /O2 /Ob1 /D NDEBUG" /Zi )
ENDIF(MSVC)
ADD_EXECUTABLE(${PACKAGE_NAME} WIN32 ${HDRS} ${SRCS})
ENDIF(WIN32)
IF(APPLE)
SET_SOURCE_FILES_PROPERTIES(
${gshhs} PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/gshhs )
SET_SOURCE_FILES_PROPERTIES(
${uiData} PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/uidata )
SET_SOURCE_FILES_PROPERTIES(
${s57data} PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/s57data )
SET_SOURCE_FILES_PROPERTIES(
${tcData} PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/tcdata )
SET_SOURCE_FILES_PROPERTIES(
data/license.txt PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport )
FILE(GLOB SOUND_FILES ${CMAKE_SOURCE_DIR}/data/sounds/*)
FOREACH (_currentSoundFile ${SOUND_FILES})
SET_SOURCE_FILES_PROPERTIES(
${_currentSoundFile} PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/sounds )
ENDFOREACH (_currentSoundFile )
SET_SOURCE_FILES_PROPERTIES(
data/doc/help_web.html PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/doc )
SET_SOURCE_FILES_PROPERTIES(
buildosx/opencpn.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources )
SET_SOURCE_FILES_PROPERTIES(
buildosx/MainMenu.xib PROPERTIES MACOSX_PACKAGE_LOCATION Resources/English.lproj )
SET(MACOSX_BUNDLE_ICON_FILE opencpn.icns)
ADD_EXECUTABLE(${PACKAGE_NAME} MACOSX_BUNDLE
${HDRS}
${SRCS}
${gshhs}
${uiData}
${s57data}
${tcData}
data/license.txt
${SOUND_FILES}
data/doc/help_web.html
buildosx/opencpn.icns
buildosx/MainMenu.xib
)
INSTALL(TARGETS
${PACKAGE_NAME}
BUNDLE DESTINATION ${PREFIX_BIN} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
TARGET_LINK_LIBRARIES(${PACKAGE_NAME}
${wxWidgets_LIBRARIES}
NMEA0183
${EXTRA_LIBS}
)
ENDIF(APPLE)
IF(UNIX AND NOT APPLE)
ADD_EXECUTABLE(${PACKAGE_NAME} ${HDRS} ${SRCS})
ENDIF(UNIX AND NOT APPLE)
If(NOT APPLE)
TARGET_LINK_LIBRARIES(${PACKAGE_NAME}
${wxWidgets_LIBRARIES}
NMEA0183
${EXTRA_LIBS}
)
ENDIF(NOT APPLE)
IF(WIN32)
TARGET_LINK_LIBRARIES(${PACKAGE_NAME}
setupapi.lib
gdiplus.lib
glu32.lib
Psapi.lib
)
ENDIF(WIN32)
IF(UNIX)
TARGET_LINK_LIBRARIES(${PACKAGE_NAME}
${OPENGL_LIBRARIES}
${GETTEXT_LIBRARY}
${BZIP2_LIBRARIES}
${ZLIB_LIBRARY}
)
IF(TINYXML_FOUND)
TARGET_LINK_LIBRARIES(${PACKAGE_NAME} ${TINYXML_LIBRARIES} )
ENDIF(TINYXML_FOUND)
ENDIF(UNIX)
# Certain older Cmake FindGTK2 modules ( e.g. cmake-2.8.0-2) do not yield all of the required link libraries
# So, add them manually. These declarations may be redundant in some architectures, but do no harm.
IF(UNIX)
TARGET_LINK_LIBRARIES( ${PACKAGE_NAME} dl )
ENDIF(UNIX)
IF(GTK2_FOUND)
TARGET_LINK_LIBRARIES( ${PACKAGE_NAME} gobject-2.0 )
ENDIF(GTK2_FOUND)
IF(NOT APPLE)
IF(WIN32)
INSTALL(TARGETS ${PACKAGE_NAME} RUNTIME DESTINATION ".")
ENDIF(WIN32)
IF(UNIX AND NOT APPLE)
INSTALL(TARGETS ${PACKAGE_NAME} RUNTIME DESTINATION ${PREFIX_BIN} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ENDIF(UNIX AND NOT APPLE)
IF(WIN32)
SET(PREFIX_PKGDATA ".")
ENDIF(WIN32)
INSTALL(FILES ${gshhs} DESTINATION ${PREFIX_PKGDATA}/gshhs PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES ${uiData} DESTINATION ${PREFIX_PKGDATA}/uidata PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
IF (USE_S57)
INSTALL(FILES ${s57data} DESTINATION ${PREFIX_PKGDATA}/s57data PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
ENDIF (USE_S57)
INSTALL(FILES ${tcData} DESTINATION ${PREFIX_PKGDATA}/tcdata PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES data/license.txt DESTINATION ${PREFIX_PKGDATA} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES data/copyright DESTINATION ${PREFIX_DATA}/doc/${PACKAGE_NAME} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES data/changelog.Debian.gz DESTINATION ${PREFIX_DATA}/doc/${PACKAGE_NAME} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(DIRECTORY data/sounds/ DESTINATION ${PREFIX_PKGDATA}/sounds )
INSTALL(DIRECTORY data/doc/ DESTINATION ${PREFIX_PKGDATA}/doc )
IF(UNIX)
INSTALL(FILES data/opencpn.png DESTINATION ${PREFIX_DATA}/icons/hicolor/48x48/apps PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES src/bitmaps/other_svg_src/opencpn.svg DESTINATION ${PREFIX_DATA}/icons/hicolor/scalable/apps PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES data/opencpn.desktop DESTINATION ${PREFIX_DATA}/applications PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ )
ENDIF(UNIX)
ENDIF(NOT APPLE)
# Fix up time_t definition
# Checks for 32-bit version. And always use 32-bit time_t for compatibility
#uninstall-local:
# rm -fr $(DESTDIR)$(pkgdatadir)/wvsdata/*
# rm -fr $(DESTDIR)$(pkgdatadir)/gshhs/*
# rm -fr $(DESTDIR) $(pkgdatadir)/s57data/*
# rm -fr $(DESTDIR)$(pkgdatadir)/tcdata/*
# rmdir $(DESTDIR)$(pkgdatadir)/wvsdata
# rmdir $(DESTDIR)$(pkgdatadir)/gshhs
# rmdir $(DESTDIR)$(pkgdatadir)/s57data
# rmdir $(DESTDIR)$(pkgdatadir)/tcdata
# rmdir $(DESTDIR)$(pkgdatadir)
#
FIND_PROGRAM(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
IF (GETTEXT_XGETTEXT_EXECUTABLE)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_SOURCE_DIR}/po/${PACKAGE_NAME}.pot.dummy
COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} --force-po --package-name=${PACKAGE_NAME} --package-version="${PACKAGE_VERSION}" --output=${CMAKE_SOURCE_DIR}/po/${PACKAGE_NAME}.pot --keyword=_ --width=80 --files-from=${CMAKE_SOURCE_DIR}/po/POTFILES.in
DEPENDS ${CMAKE_SOURCE_DIR}/po/POTFILES.in ${CMAKE_SOURCE_DIR}/po/${PACKAGE_NAME}.pot
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "pot-update [${PACKAGE_NAME}]: Generated pot file."
)
ADD_CUSTOM_TARGET(pot-update COMMENT "pot-update: Done." DEPENDS ${CMAKE_SOURCE_DIR}/po/${PACKAGE_NAME}.pot.dummy)
ENDIF(GETTEXT_XGETTEXT_EXECUTABLE )
MACRO(GETTEXT_UPDATE_PO _potFile)
SET(_poFiles ${_potFile})
GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
FOREACH (_currentPoFile ${ARGN})
GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE)
GET_FILENAME_COMPONENT(_poBasename ${_absFile} NAME_WE)
ADD_CUSTOM_COMMAND(
OUTPUT ${_absFile}.dummy
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --width=80 --strict --quiet --update --backup=none --no-location -s ${_absFile} ${_absPotFile}
DEPENDS ${_absPotFile} ${_absFile}
COMMENT "po-update [${_poBasename}]: Updated po file."
)
SET(_poFiles ${_poFiles} ${_absFile}.dummy)
ENDFOREACH (_currentPoFile )
ADD_CUSTOM_TARGET(po-update COMMENT "po-update: Done." DEPENDS ${_poFiles})
ENDMACRO(GETTEXT_UPDATE_PO)
IF (GETTEXT_MSGMERGE_EXECUTABLE)
FILE(GLOB PACKAGE_PO_FILES ${CMAKE_SOURCE_DIR}/po/*.po)
GETTEXT_UPDATE_PO(${CMAKE_SOURCE_DIR}/po/${PACKAGE_NAME}.pot ${PACKAGE_PO_FILES})
ENDIF(GETTEXT_MSGMERGE_EXECUTABLE)
SET(_gmoFiles)
MACRO(GETTEXT_BUILD_MO _poFile _lang)
GET_FILENAME_COMPONENT(_absFile ${_poFile} ABSOLUTE)
GET_FILENAME_COMPONENT(_poBasename ${_absFile} NAME_WE)
SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_poBasename}.mo)
ADD_CUSTOM_COMMAND(
OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_absFile}
DEPENDS ${_absFile}
COMMENT "i18n [${_poBasename}]: Created mo file."
)
IF(APPLE)
INSTALL(FILES ${_gmoFile} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/OpenCPN.app/Contents/Resources/${_lang}.lproj RENAME ${PACKAGE_NAME}.mo )
ELSE(APPLE)
INSTALL(FILES ${_gmoFile} DESTINATION ${PREFIX_DATA}/locale/${_lang}/LC_MESSAGES RENAME ${PACKAGE_NAME}.mo PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
ENDIF(APPLE)
SET(_gmoFiles ${_gmoFiles} ${_gmoFile})
ENDMACRO(GETTEXT_BUILD_MO)
if(GETTEXT_MSGFMT_EXECUTABLE)
GETTEXT_BUILD_MO(po/opencpn_cs_CZ.po cs)
GETTEXT_BUILD_MO(po/opencpn_da_DK.po da)
GETTEXT_BUILD_MO(po/opencpn_de_DE.po de)
GETTEXT_BUILD_MO(po/opencpn_es_ES.po es)
GETTEXT_BUILD_MO(po/opencpn_fr_FR.po fr)
GETTEXT_BUILD_MO(po/opencpn_it_IT.po it)
GETTEXT_BUILD_MO(po/opencpn_nl_NL.po nl)
GETTEXT_BUILD_MO(po/opencpn_pl_PL.po pl)
GETTEXT_BUILD_MO(po/opencpn_ru_RU.po ru)
GETTEXT_BUILD_MO(po/opencpn_sv_SE.po sv)
GETTEXT_BUILD_MO(po/opencpn_et_ET.po et)
GETTEXT_BUILD_MO(po/opencpn_pt_PT.po pt_PT)
GETTEXT_BUILD_MO(po/opencpn_pt_BR.po pt_BR)
GETTEXT_BUILD_MO(po/opencpn_nb_NO.po nb_NO)
GETTEXT_BUILD_MO(po/opencpn_tr_TR.po tr_TR)
GETTEXT_BUILD_MO(po/opencpn_fi_FI.po fi_FI)
GETTEXT_BUILD_MO(po/opencpn_el_GR.po el_GR)
GETTEXT_BUILD_MO(po/opencpn_zh_TW.po zh_TW)
GETTEXT_BUILD_MO(po/opencpn_hu_HU.po hu_HU)
GETTEXT_BUILD_MO(po/opencpn_gl_ES.po gl_ES)
GETTEXT_BUILD_MO(po/opencpn_ca_ES.po ca_ES)
ADD_CUSTOM_TARGET(i18n COMMENT "i18n: Done." DEPENDS ${_gmoFiles})
#ADD_DEPENDENCIES(i18n ${PACKAGE_PO_FILES})
ADD_DEPENDENCIES(${PACKAGE_NAME} i18n)
ENDIF(GETTEXT_MSGFMT_EXECUTABLE)
# On Windows builds, copy the wxWidgets dlls and to the executable directory
IF(WIN32 AND NOT UNIX)
INSTALL(DIRECTORY wxWidgets/ DESTINATION "." )
INSTALL(DIRECTORY buildwin/vc10/ DESTINATION ".\\\\vc10" )
#INSTALL(DIRECTORY buildwin/NSIS_Unicode/Bitmaps/ DESTINATION ".\\\\NSISBmps" ) #Gunther
ENDIF(WIN32 AND NOT UNIX)
MESSAGE (STATUS "")
IF(NOT SKIP_PLUGINS)
add_subdirectory (plugins)
ENDIF(NOT SKIP_PLUGINS)
# build a CPack driven installer package
#include (InstallRequiredSystemLibraries)
SET(CPACK_PACKAGE_NAME "OpenCPN")
SET(CPACK_PACKAGE_VENDOR "opencpn.org")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenCPN ${PACKAGE_VERSION}")
SET(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION})
SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
SET(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_CURRENT_BINARY_DIR};${PACKAGE_NAME};ALL;/")
SET(CPACK_PACKAGE_EXECUTABLES ${PACKAGE_NAME} "OpenCPN")
IF(WIN32 AND NOT UNIX)
# There is a bug in NSI that does not handle full unix paths properly. Make
# sure there is at least one set of four (4) backlasshes.
SET(CPACK_NSIS_INSTALLED_ICON_NAME "opencpn.exe")
SET(CPACK_NSIS_PACKAGE_NAME_LC "opencpn")
# These lines set the name of the Windows Start Menu shortcut and the icon that goes with it
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_NAME} ${PACKAGE_VERSION}")
SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/src/bitmaps\\\\opencpn.ico")
SET(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_setup" )
SET(CPACK_NSIS_DIR "${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode") #Gunther
SET(CPACK_BUILDWIN_DIR "${CMAKE_SOURCE_DIR}/buildwin") #Gunther
# Install the VC100 Redistributable
SET(vc10_redist "vcredist_x86.exe")
STRING( REPLACE "/" "\\\\" Temp_vc10_redist ${vc10_redist} )
GET_FILENAME_COMPONENT( VC10_FILE_NAME ${vc10_redist} NAME )
SET( CPACK_NSIS_EXTRA_INSTALL_COMMANDS ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
"ExecWait '\\\"$INSTDIR\\\\vc10\\\\${VC10_FILE_NAME}\\\" /q /norestart' $0\\n"
" Remove folder\\n RMDir /r \\\"$INSTDIR\\\\vc10\\\"\\n\\n" )
ELSE(WIN32 AND NOT UNIX)
SET(CPACK_PACKAGE_INSTALL_DIRECTORY ${PACKAGE_NAME})
SET(CPACK_STRIP_FILES "bin/opencpn.exe")
SET(CPACK_SOURCE_STRIP_FILES "")
SET(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}_${PACKAGE_VERSION}-${PACKAGE_RELEASE}_${ARCH}" )
ENDIF(WIN32 AND NOT UNIX)
#SET(CPACK_PACKAGE_EXECUTABLES ${PACKAGE_NAME})
#SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${PACKAGE_NAME} ${PACKAGE_VERSION}")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/data/license.txt")
#SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/data/README")
#SET(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/data/Welcome.txt")
IF (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/README")
# MESSAGE(STATUS "Using generic cpack package description file.")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README")
ENDIF ()
SET(CPACK_SOURCE_GENERATOR "TGZ")
# The following components are regex's to match anywhere (unless anchored)
# in absolute path + filename to find files or directories to be excluded
# from source tarball.
set(CPACK_SOURCE_IGNORE_FILES