-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
1610 lines (1427 loc) · 47.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
cmake_minimum_required (VERSION 3.7.2 FATAL_ERROR)
if (APPLE)
#
# The following variables define the portability and compatability attributes of the Mac macOS build
# they are choosen with care and should not be changed without good cause.
#
# Among other things these options are chosen to match the portability and compatability options of the
# Qt framework dylibs which can be checked as follows:
#
# otool -l <binary> | grep -A3 LC_VERSION_MIN_MACOSX
#
set (CMAKE_OSX_DEPLOYMENT_TARGET 10.12
CACHE STRING "Earliest version of macOS supported
Earliest version we can support with Qt 5.12, C++11 & libc++ is 10.13.
Do not override this if you intend to build an official deployable installer.")
set (CMAKE_OSX_SYSROOT /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
CACHE STRING "Mac OS X SDK to build with
Change this to the newest SDK available that you can install on your system (>10.14 preferred).
Do not override this if you intend to build an official deployable installer.")
endif (APPLE)
project (jtdx C CXX Fortran)
#
# CMake policies
#
if (POLICY CMP0020)
cmake_policy (SET CMP0020 NEW) # link to Qt winmain on Windows
endif (POLICY CMP0020)
if (POLICY CMP0043)
cmake_policy (SET CMP0043 NEW) # ignore COMPILE_DEFINITIONS_<CONFIG>
endif (POLICY CMP0043)
if (POLICY CMP0063)
cmake_policy (SET CMP0063 NEW) # honour visibility properties for all library types
endif (POLICY CMP0063)
if (POLICY CMP0071)
cmake_policy (SET CMP0071 NEW) # run automoc and autouic on generated sources
endif (POLICY CMP0071)
include (${PROJECT_SOURCE_DIR}/CMake/VersionCompute.cmake)
message (STATUS "Building ${CMAKE_PROJECT_NAME}-${wsjtx_VERSION}")
#
# project information
#
set (PROJECT_NAME "JTDX")
if (WIN32)
set (PROJECT_VENDOR "Igor Chernikov, UA3DJY and Arvo Jarve, ES1JA")
set (PROJECT_CONTACT "Igor Chernikov <[email protected]>, Arvo Jarve <[email protected]>")
set (PROJECT_COPYRIGHT "Copyright (C) 2016-2020 by Igor Chernikov, UA3DJY and Arvo Jarve, ES1JA.")
else ()
set (PROJECT_VENDOR "Igor Chernikov, UA3DJY and Arvo Järve, ES1JA")
set (PROJECT_CONTACT "Igor Chernikov <[email protected]>, Arvo Järve <[email protected]>")
set (PROJECT_COPYRIGHT "Copyright (C) 2016-2020 by Igor Chernikov, UA3DJY and Arvo Järve, ES1JA.")
endif (WIN32)
set (PROJECT_HOMEPAGE http://sourceforge.net/projects/jtdx/)
set (PROJECT_MANUAL index.php/videos-guides)
set (PROJECT_MANUAL_DIRECTORY_URL http://sourceforge.net/projects/jtdx/)
set (PROJECT_SAMPLES_URL http://jtdx.tech/public_html/downloads/)
set (PROJECT_SAMPLES_UPLOAD_DEST frs.sourceforge.net:/home/frs/project/wsjt/)
set (PROJECT_SUMMARY_DESCRIPTION "${PROJECT_NAME} - Digital Modes for Amateur Radio.")
set (PROJECT_DESCRIPTION "JTDX: Digital Modes for Weak Signal Communications in Amateur Radio")
#set (CMAKE_PROJECT_DESCRIPTION ${PROJECT_DESCRIPTION})
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/Modules ${CMAKE_MODULE_PATH})
# make sure that the default configuration is a RELEASE
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE RELEASE CACHE STRING
"Choose the type of build, options are: None Debug Release."
FORCE)
endif (NOT CMAKE_BUILD_TYPE)
if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]")
set (is_debug_build 1)
endif ()
#
# Options & features
#
# Some of these directly effect compilation by being defined in
# wsjtx_config.h.in which makes them available to the C/C++
# pre-processor.
#
include (CMakeDependentOption)
# Allow the developer to select if Dynamic or Static libraries are built
OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
# Set the LIB_TYPE variable to STATIC
SET (LIB_TYPE STATIC)
if (BUILD_SHARED_LIBS)
# User wants to build Dynamic Libraries, so change the LIB_TYPE variable to CMake keyword 'SHARED'
set (LIB_TYPE SHARED)
endif (BUILD_SHARED_LIBS)
option (UPDATE_TRANSLATIONS "Update source translation translations/*.ts
files (WARNING: make clean will delete the source .ts files! Danger!)")
option (WSJT_SHARED_RUNTIME "Debugging option that allows running from a shared Cloud directory.")
option (WSJT_QDEBUG_TO_FILE "Redirect Qt debuging messages to a trace file.")
option (WSJT_TRACE_CAT "Debugging option that turns on CAT diagnostics.")
option (WSJT_TRACE_CAT_POLLS "Debugging option that turns on CAT diagnostics during polling.")
option (WSJT_HAMLIB_TRACE "Debugging option that turns on minimal Hamlib internal diagnostics.")
option (WSJT_SOFT_KEYING "Apply a ramp to CW keying envelope to reduce transients." ON)
option (WSJT_SKIP_MANPAGES "Skip *nix manpage generation.")
option (WSJT_GENERATE_DOCS "Generate documentation files." ON)
option (WSJT_RIG_NONE_CAN_SPLIT "Allow split operation with \"None\" as rig.")
option (WSJT_TRACE_UDP "Debugging option that turns on UDP message protocol diagnostics.")
option (WSJT_BUILD_UTILS "Build simulators and code demonstrators." ON)
option (JTDX_DEBUG_TO_FILE "Write debu to jtdx_debug.txt.")
CMAKE_DEPENDENT_OPTION (WSJT_HAMLIB_VERBOSE_TRACE "Debugging option that turns on full Hamlib internal diagnostics." OFF WSJT_HAMLIB_TRACE OFF)
CMAKE_DEPENDENT_OPTION (WSJT_QDEBUG_IN_RELEASE "Leave Qt debugging statements in Release configuration." OFF
"NOT is_debug_build" OFF)
CMAKE_DEPENDENT_OPTION (WSJT_ENABLE_EXPERIMENTAL_FEATURES "Enable features not fully ready for public releases." ON
is_debug_build OFF)
CMAKE_DEPENDENT_OPTION (WSJT_CREATE_WINMAIN
"The wsjtx target is normally built as GUI executable with a WinMain entry point on Windows,
if you want a console application instead then set this option to OFF.
If you just want to see the debug output from the application then the easiest way is to
attach a debugger which will then receive the console output inside its console." ON
"WIN32" OFF)
set (PROJECT_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
if (NOT PROJECT_ARCHITECTURE)
# This is supposed to happen already on Windows
if (CMAKE_SIZEOF_VOID_P MATCHES 8)
set (PROJECT_ARCHITECTURE "x64")
else ()
set (PROJECT_ARCHITECTURE "$ENV{PROCESSOR_ARCHITECTURE}")
endif ()
endif (NOT PROJECT_ARCHITECTURE)
message (STATUS "******************************************************")
message (STATUS "Building for for: ${CMAKE_SYSTEM_NAME}-${PROJECT_ARCHITECTURE}")
message (STATUS "******************************************************")
#
# install locations
#
if (APPLE)
set (CMAKE_INSTALL_BINDIR ${CMAKE_PROJECT_NAME}.app/Contents/MacOS)
set (CMAKE_INSTALL_DATAROOTDIR ${CMAKE_PROJECT_NAME}.app/Contents/Resources)
endif ()
include (GNUInstallDirs)
set (PLUGIN_DESTINATION ${CMAKE_INSTALL_LIBDIR}/plugins)
set (QT_CONF_DESTINATION ${CMAKE_INSTALL_BINDIR})
if (WIN32)
set (PLUGIN_DESTINATION plugins)
elseif (APPLE)
set (PLUGIN_DESTINATION ${CMAKE_INSTALL_BINDIR}/../PlugIns)
set (QT_CONF_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR})
endif ()
set (WSJT_PLUGIN_DESTINATION ${PLUGIN_DESTINATION} CACHE PATH "Path for plugins")
set (WSJT_QT_CONF_DESTINATION ${QT_CONF_DESTINATION} CACHE PATH "Path for the qt.conf file")
#
# Project sources
#
set (wsjt_qt_CXXSRCS
qt_helpers.cpp
MetaDataRegistry.cpp
NetworkServerLookup.cpp
revision_utils.cpp
WFPalette.cpp
Radio.cpp
NonInheritingProcess.cpp
IARURegions.cpp
Bands.cpp
Modes.cpp
FrequencyList.cpp
StationList.cpp
FrequencyLineEdit.cpp
FrequencyDeltaLineEdit.cpp
CandidateKeyFilter.cpp
ForeignKeyDelegate.cpp
LiveFrequencyValidator.cpp
GetUserId.cpp
TraceFile.cpp
AudioDevice.cpp
Transceiver.cpp
TransceiverBase.cpp
EmulateSplitTransceiver.cpp
TransceiverFactory.cpp
PollingTransceiver.cpp
HamlibTransceiver.cpp
TCITransceiver.cpp
HRDTransceiver.cpp
DXLabSuiteCommanderTransceiver.cpp
NetworkMessage.cpp
MessageClient.cpp
LettersSpinBox.cpp
HelpTextWindow.cpp
SampleDownloader.cpp
SampleDownloader/DirectoryDelegate.cpp
SampleDownloader/Directory.cpp
SampleDownloader/FileNode.cpp
SampleDownloader/RemoteFile.cpp
DisplayManual.cpp
FrequencyDelegate.cpp
FrequencyDeltaDelegate.cpp
)
set (wsjt_qtmm_CXXSRCS
Audio/BWFFile.cpp
)
set (jt9_CXXSRCS
lib/ipcomm.cpp
)
set (wsjtx_CXXSRCS
logbook/adif.cpp
logbook/countrydat.cpp
logbook/logbook.cpp
qsohistory.cpp
psk_reporter.cpp
Modulator.cpp
Detector.cpp
logqso.cpp
displaytext.cpp
decodedtext.cpp
getfile.cpp
soundout.cpp
soundin.cpp
meterwidget.cpp
signalmeter.cpp
plotter.cpp
widegraph.cpp
about.cpp
WsprTxScheduler.cpp
mainwindow.cpp
Configuration.cpp
main.cpp
eqsl.cpp
wsprnet.cpp
WSPRBandHopping.cpp
JTDXMessageBox.cpp
JTDXDateTime.cpp
)
set (wsjt_CXXSRCS
lib/crc10.cpp
lib/crc12.cpp
lib/crc14.cpp
)
# deal with a GCC v6 UB error message
set_source_files_properties (
lib/crc10.cpp
lib/crc12.cpp
lib/crc14.cpp
PROPERTIES COMPILE_FLAGS -fpermissive)
if (WIN32)
set (wsjt_CXXSRCS
${wsjt_CXXSRCS}
killbyname.cpp
)
set (wsjt_qt_CXXSRCS
${wsjt_qt_CXXSRCS}
OmniRigTransceiver.cpp
)
endif (WIN32)
set (wsjt_FSRCS
lib/afc10.f90
lib/afc65b.f90
lib/afc9.f90
lib/agcc.f90
lib/ft4/agccft4.f90
lib/agccft8.f90
lib/azdist.f90
lib/baddata.f90
lib/baseline.f90
lib/bpdecode144.f90
lib/bpdecode174.f90
lib/ft8v2/bpdecode174_91.f90
lib/ccf2.f90
lib/ccf65.f90
lib/chkcall.f90
lib/chkcrc12a.f90
lib/ft8v2/chkcrc14a.f90
lib/chkfalse.f90
lib/chkfalse8.f90
lib/chkflscall.f90
lib/chkftrsd.f90
lib/chkgrid.f90
lib/chkhist.f90
lib/chklong8.f90
lib/chkmsg.f90
lib/chkspecial8.f90
lib/chkss10.f90
lib/chkss2.f90
lib/cqcall3.f90
lib/crc.f90
lib/cwfilter.f90
lib/datacor.f90
lib/db.f90
lib/decode9.f90
lib/decode10.f90
lib/decode65a.f90
lib/decode65b.f90
lib/decoder.f90
lib/deg2grid.f90
lib/delbraces.f90
lib/demod64a.f90
lib/determ.f90
lib/downsam10.f90
lib/downsam9.f90
lib/downsam9s.f90
lib/encode174.f90
lib/ft8v2/encode174_91.f90
lib/encode232.f90
lib/entail.f90
lib/extract.f90
lib/extract_call.f90
lib/fano232.f90
lib/fchisq.f90
lib/fchisq10.f90
lib/fchisq65.f90
lib/fftw3mod.f90
lib/fil3.f90
lib/fil3c.f90
lib/fil4.f90
lib/filbig.f90
lib/fillhash.f90
lib/filt8.f90
lib/filterscq.f90
lib/filterscq2.f90
lib/filtersde.f90
lib/filtersfree.f90
lib/filtersstd.f90
lib/fix_contest_msg.f90
lib/flat2.f90
lib/flat4.f90
lib/fmtmsg.f90
lib/four2a.f90
lib/foxgen.f90
lib/ft4/ft4_baseline.f90
lib/ft4_decode.f90
lib/ft4_mod1.f90
lib/ft4/ft4_downsample.f90
lib/ft4/ft4sim.f90
lib/ft8_decode.f90
lib/ft8_downsample.f90
lib/ft8_mod1.f90
lib/ft8apset.f90
lib/ft8b.f90
lib/ft8mf1.f90
lib/ft8mfcq.f90
lib/ft8s.f90
lib/ft8sd.f90
lib/ft8sd1.f90
lib/ft8sim.f90
lib/ft8sim_gfsk.f90
lib/fqso_first.f90
lib/ft4/gen_ft4wave.f90
lib/gen_ft8wave.f90
lib/gen_ft8wavesub.f90
lib/gen10.f90
lib/gen65.f90
lib/gen9.f90
lib/ft4/genft4.f90
lib/genft8.f90
lib/genft8sd.f90
lib/genft8refsig.f90
lib/genwspr.f90
lib/geodist.f90
lib/ft4/get_ft4_bitmetrics.f90
lib/ft4/getcandidates4.f90
lib/gfsk_pulse.f90
lib/graycode.f90
lib/graycode65.f90
lib/grayline.f90
lib/grid2deg.f90
lib/hash.f90
lib/hashing.f90
lib/hintdx73.f90
lib/hintdx739.f90
lib/hintdx7310.f90
lib/hintdxcq.f90
lib/hintdxgrid.f90
lib/hintdxgrid9.f90
lib/hintdxgrid10.f90
lib/hintdxr.f90
lib/hintdxr9.f90
lib/hintdxr10.f90
lib/hintdxrr.f90
lib/hintdxrr9.f90
lib/hintdxrr10.f90
lib/hintdyn.f90
lib/hintdyncq.f90
lib/hintrxcq.f90
lib/hintrxgrid.f90
lib/hintrxgrid9.f90
lib/hintrxgrid10.f90
lib/hintwidecq.f90
lib/hintwidedx.f90
lib/image.f90
lib/indexx.f90
lib/init_random_seed.f90
lib/interleave63.f90
lib/interleave9.f90
lib/inter_wspr.f90
lib/iso_c_utilities.f90
lib/jplsubs.f
lib/jt65_decode.f90
lib/jt65_mod2.f90
lib/jt65_mod4.f90
lib/jt65_mod5.f90
lib/jt65_mod6.f90
lib/jt65_mod8.f90
lib/jt65_mod9.f90
lib/jt65_mod10.f90
lib/jt65_mod11.f90
lib/jt10_decode.f90
lib/jt9_decode.f90
lib/jt9s_decode.f90
lib/jt9_mod1.f90
lib/jt9fano.f90
lib/mixlpf.f90
lib/morse.f90
lib/move.f90
lib/msgparser.f90
lib/options.f90
lib/osd174.f90
lib/ft8v2/osd174_91.f90
lib/ft4/osd4_174_91.f90
lib/wsprd/osdwspr.f90
lib/packjt.f90
lib/ft8v2/packjt77.f90
lib/ft8v2/packjt77sd.f90
lib/partint.f90
lib/ft4/partintft4.f90
lib/partintft8.f90
lib/pctile.f90
lib/peakdt10.f90
lib/peakdt9.f90
lib/peakup.f90
lib/polyfit.f90
lib/process_dd.f90
lib/prog_args.f90
lib/readwav.f90
lib/rms_augap.f90
lib/savec2.f90
lib/sec_midn.f90
lib/searchcalls.f90
lib/shell.f90
lib/sleep_msec.f90
lib/slope.f90
lib/smo.f90
lib/softsym.f90
lib/softsym9s.f90
lib/softsym10.f90
lib/splitmsg.f90
lib/splitmsgdupe.f90
lib/splitdupecq.f90
lib/splitmsgcq.f90
lib/stdmsg.f90
lib/subtract9.f90
lib/subtract9s.f90
lib/subtract10.f90
lib/subtract65.f90
lib/ft4/subtractft4.f90
lib/ft8v2/subtractft8.f90
lib/sun.f90
lib/symspec.f90
lib/symspec10.f90
lib/symspec2.f90
lib/symspec65.f90
lib/ft4/sync4d.f90
lib/sync10.f90
lib/sync65.f90
lib/sync8.f90
lib/sync8d.f90
lib/sync9.f90
lib/sync9s.f90
lib/timer_C_wrapper.f90
lib/timer_impl.f90
lib/timer_module.f90
# lib/timf2.f90
lib/to_contest_msg.f90
lib/tone8.f90
lib/tone8myc.f90
lib/tonesd.f90
lib/twkfreq.f90
lib/twkfreq1.f90
lib/wav12.f90
lib/wavhdr.f90
lib/xcor.f90
lib/watterson.f90
lib/wavhdr.f90
lib/wqencode.f90
lib/wspr_downsample.f90
lib/zplot9.f90
)
set (ka9q_CSRCS
lib/ftrsd/decode_rs.c
lib/ftrsd/encode_rs.c
lib/ftrsd/init_rs.c
)
set_source_files_properties (${ka9q_CSRCS} PROPERTIES COMPILE_FLAGS -Wno-sign-compare)
set (wsjt_CSRCS
${ka9q_CSRCS}
lib/ftrsd/ftrsd2.c
lib/sgran.c
lib/gran.c
lib/igray.c
lib/init_random_seed.c
lib/wsprd/nhash.c
lib/tab.c
lib/usleep.c
lib/wisdom.c
lib/wrapkarn.c
)
set (wsjt_qt_UISRCS
wf_palette_design_dialog.ui
)
set (wsprsim_CSRCS
lib/wsprd/wsprsim.c
lib/wsprd/wsprsim_utils.c
lib/wsprd/wsprd_utils.c
lib/wsprd/fano.c
lib/wsprd/tab.c
lib/wsprd/nhash.c
)
set (wsprd_CSRCS
lib/wsprd/wsprd.c
lib/wsprd/wsprsim_utils.c
lib/wsprd/wsprd_utils.c
lib/wsprd/fano.c
lib/wsprd/jelinek.c
lib/wsprd/tab.c
lib/wsprd/nhash.c
lib/init_random_seed.c
)
set (wsjtx_UISRCS
mainwindow.ui
about.ui
widegraph.ui
logqso.ui
Configuration.ui
)
set (message_aggregator_CXXSRCS
MessageServer.cpp
MessageAggregator.cpp
)
set (UDPDaemon_CXXSRCS
NetworkMessage.cpp
MessageServer.cpp
Radio.cpp
UDPDaemon.cpp
)
set (all_CXXSRCS
${wsjt_CXXSRCS}
${wsjt_qt_CXXSRCS}
${wsjt_qtmm_CXXSRCS}
${jt9_CXXSRCS}
${wsjtx_CXXSRCS}
${message_aggregator_CXXSRCS}
${UDPDaemon_CXXSRCS}
)
set (all_C_and_CXXSRCS
${wsjt_CSRCS}
${wsprsim_CSRCS}
${wsprd_CSRCS}
${all_CXXSRCS}
)
set (message_aggregator_STYLESHEETS
qss/default.qss
)
set (TOP_LEVEL_RESOURCES
cty.dat
lotw-user-activity.csv
icons/Darwin/jtdx.iconset/icon_128x128.png
contrib/decpasses.png
contrib/dtrange.png
)
set (PALETTE_FILES
Palettes/Banana.pal
Palettes/Blue1.pal
Palettes/Blue2.pal
Palettes/Blue3.pal
Palettes/Brown.pal
Palettes/Cyan1.pal
Palettes/Cyan2.pal
Palettes/Cyan3.pal
Palettes/Default.pal
Palettes/Default16.pal
Palettes/Digipan.pal
Palettes/Fldigi.pal
Palettes/Gray1.pal
Palettes/Gray2.pal
Palettes/Green1.pal
Palettes/Green2.pal
Palettes/Jungle.pal
Palettes/Linrad.pal
Palettes/Negative.pal
Palettes/Orange.pal
Palettes/Pink.pal
Palettes/Rainbow.pal
Palettes/Scope.pal
Palettes/Sunburst.pal
Palettes/VK4BDJ.pal
Palettes/YL2KF.pal
Palettes/Yellow1.pal
Palettes/Yellow2.pal
Palettes/ZL1FZ.pal
)
if (APPLE)
set (WSJTX_ICON_FILE ${CMAKE_PROJECT_NAME}.icns)
set (ICONSRCS
icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_16x16.png
icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/[email protected]
icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_32x32.png
icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/[email protected]
icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_128x128.png
icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/[email protected]
icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_256x256.png
icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/[email protected]
icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_512x512.png
icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/[email protected]
)
add_custom_command (
OUTPUT ${WSJTX_ICON_FILE}
COMMAND iconutil -c icns --output "${CMAKE_BINARY_DIR}/${WSJTX_ICON_FILE}" "${CMAKE_SOURCE_DIR}/icons/Darwin/${CMAKE_PROJECT_NAME}.iconset"
DEPENDS ${ICONSRCS}
COMMENT "Building Icons"
)
else ()
set (WSJTX_ICON_FILE icons/windows-icons/jtdx.ico)
endif (APPLE)
set_source_files_properties (${WSJTX_ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
if (WSJT_QDEBUG_IN_RELEASE)
# context info in Qt message handler in release configuration
set_property (DIRECTORY APPEND PROPERTY
COMPILE_DEFINITIONS $<$<NOT:$<CONFIG:Debug>>:QT_MESSAGELOGCONTEXT>
)
else (WSJT_QDEBUG_IN_RELEASE)
# disable Qt trace and warning messages from release configurations
set_property (DIRECTORY APPEND PROPERTY
COMPILE_DEFINITIONS $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG_OUTPUT;QT_NO_WARNING_OUTPUT>
)
endif (WSJT_QDEBUG_IN_RELEASE)
set_property (SOURCE ${all_C_and_CXXSRCS} APPEND_STRING PROPERTY COMPILE_FLAGS " -include wsjtx_config.h")
set_property (SOURCE ${all_C_and_CXXSRCS} APPEND PROPERTY OBJECT_DEPENDS wsjtx_config.h)
if (WIN32)
# generate the OmniRig COM interface source
find_program (DUMPCPP dumpcpp)
if (DUMPCPP-NOTFOUND)
message (FATAL_ERROR "dumpcpp tool not found")
endif (DUMPCPP-NOTFOUND)
execute_process (
COMMAND ${DUMPCPP} -getfile {4FE359C5-A58F-459D-BE95-CA559FB4F270}
OUTPUT_VARIABLE AXSERVER
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string (STRIP "${AXSERVER}" AXSERVER)
if (NOT AXSERVER)
message (FATAL_ERROR "You need to install OmniRig on this computer")
endif (NOT AXSERVER)
string (REPLACE "\"" "" AXSERVER ${AXSERVER})
file (TO_CMAKE_PATH ${AXSERVER} AXSERVERSRCS)
endif (WIN32)
#
# decide on platform specifc packing and fixing up
#
if (APPLE)
set (WSJTX_BUNDLE_VERSION ${wsjtx_VERSION})
# make sure CMAKE_INSTALL_PREFIX ends in /
string (LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
math (EXPR LEN "${LEN} -1" )
string (SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
if (NOT "${ENDCH}" STREQUAL "/")
set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
endif ()
endif (APPLE)
#
# find some useful tools
#
include (CheckTypeSize)
include (CheckSymbolExists)
include (generate_version_info)
find_program(CTAGS ctags)
find_program(ETAGS etags)
#
# Boost
#
if (WIN32)
set (Boost_USE_STATIC_LIBS OFF)
endif ()
find_package (Boost 1.63 REQUIRED)
#
# OpenMP
#
find_package (OpenMP)
#
# fftw3 single precision library
#
find_package (FFTW3 COMPONENTS single threads REQUIRED)
#
# libhamlib setup
#
#set (hamlib_STATIC 1)
find_package (Hamlib REQUIRED)
find_program (RIGCTL_EXE rigctl)
find_program (RIGCTLD_EXE rigctld)
find_program (RIGCTLCOM_EXE rigctlcom)
check_type_size (CACHE_ALL HAMLIB_OLD_CACHING)
check_symbol_exists (rig_set_cache_timeout_ms "hamlib/rig.h" HAVE_HAMLIB_CACHING)
find_package (Usb REQUIRED)
#
# Qt5 setup
#
# Widgets finds its own dependencies.
find_package (Qt5 COMPONENTS Widgets SerialPort Multimedia LinguistTools WebSockets REQUIRED)
if (WIN32)
add_definitions (-DQT_NEEDS_QTMAIN)
find_package (Qt5AxContainer REQUIRED)
endif (WIN32)
#
# sub-directories
#
add_subdirectory (samples)
if (WSJT_GENERATE_DOCS)
add_subdirectory (doc)
endif (WSJT_GENERATE_DOCS)
#
# C & C++ setup
#
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fexceptions -frtti")
if (NOT APPLE)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas")
if (${OPENMP_FOUND})
if (OpenMP_C_FLAGS)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
endif ()
endif ()
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fdata-sections -ffunction-sections")
set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -fdata-sections -ffunction-sections")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fdata-sections -ffunction-sections")
set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -fdata-sections -ffunction-sections")
endif (NOT APPLE)
if (WIN32)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-keep-inline-dllexport")
endif (WIN32)
if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
else ()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=gnu++11 -pthread")
endif ()
#
# Fortran setup
#
set (General_FFLAGS "-Wall -Wno-conversion -fno-second-underscore")
# FFLAGS depend on the compiler
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
if (Fortran_COMPILER_NAME MATCHES "gfortran.*")
# gfortran
# CMake compiler test is supposed to do this but doesn't yet
if (CMAKE_OSX_DEPLOYMENT_TARGET)
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif (CMAKE_OSX_DEPLOYMENT_TARGET)
if (CMAKE_OSX_SYSROOT)
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT}")
endif (CMAKE_OSX_SYSROOT)
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -fbounds-check -funroll-all-loops -fno-f2c ${General_FFLAGS}")
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fbounds-check -fno-f2c ${General_FFLAGS}")
elseif (Fortran_COMPILER_NAME MATCHES "ifort.*")
# ifort (untested)
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -f77rtl ${General_FFLAGS}")
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -f77rtl ${General_FFLAGS}")
elseif (Fortran_COMPILER_NAME MATCHES "g77")
# g77
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -funroll-all-loops -fno-f2c -m32 ${General_FFLAGS}")
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fbounds-check -fno-f2c -m32 ${General_FFLAGS}")
else (Fortran_COMPILER_NAME MATCHES "gfortran.*")
message ("CMAKE_Fortran_COMPILER full path: " ${CMAKE_Fortran_COMPILER})
message ("Fortran compiler: " ${Fortran_COMPILER_NAME})
message ("No optimized Fortran compiler flags are known, we just try -O3...")
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O3 ${General_FFLAGS}")
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fbounds-check ${General_FFLAGS}")
endif (Fortran_COMPILER_NAME MATCHES "gfortran.*")
#
# Linker setup
#
if (NOT APPLE)
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
set (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} -Wl,--gc-sections")
endif (NOT APPLE)
#
# setup and test Fortran C/C++ interaction
#
include (FortranCInterface)
FortranCInterface_VERIFY (CXX)
FortranCInterface_HEADER (FC.h MACRO_NAMESPACE "FC_" SYMBOL_NAMESPACE "FC_"
SYMBOLS
grayline
)
#
# sort out pre-requisites
#
#
# Setup RPATH so that built executable targets will run in both the
# build tree and the install location without having to set a
# (DYLD|LD)_LIBRARY_PATH override.
#
# use the full RPATH of the build tree
set (CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH, it will still be used
# later on in the install phase
set (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
# add the automaticaly determined parts of the RPATH which point to
# directories outside of the build tree to the install RPATH
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# the RPATH to be used when installing, but only if it's not a system
# directory
# list (FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" isSystemDir)
# if ("${isSystemDir}" STREQUAL "-1")
# set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
# endif ("${isSystemDir}" STREQUAL "-1")
set (QT_NEED_RPATH FALSE)
if (NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
set (QT_NEED_RPATH TRUE)
endif ()
#
# stuff only qmake can tell us
#
get_target_property (QMAKE_EXECUTABLE Qt5::qmake LOCATION)
function (QUERY_QMAKE VAR RESULT)
exec_program (${QMAKE_EXECUTABLE} ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output)
if (NOT return_code)
file (TO_CMAKE_PATH "${output}" output)
set (${RESULT} ${output} PARENT_SCOPE)
endif (NOT return_code)
message (STATUS "Asking qmake for ${RESULT} and got ${output}")
endfunction (QUERY_QMAKE)
query_qmake (QT_INSTALL_PLUGINS QT_PLUGINS_DIR)
query_qmake (QT_INSTALL_IMPORTS QT_IMPORTS_DIR)
query_qmake (QT_HOST_DATA QT_DATA_DIR)
set (QT_MKSPECS_DIR ${QT_DATA_DIR}/mkspecs)
# Tell CMake to run moc when necessary
set (CMAKE_AUTOMOC ON)
# don't use Qt "keywords" signal, slot, emit in generated files to
# avoid compatability issue with other libraries
# ADD_DEFINITIONS (-DQT_NO_KEYWORDS)
# ADD_DEFINITIONS (-DUNICODE) #as per qmake
# As moc files are generated in the binary dir, tell CMake to always
# look for includes there:
set (CMAKE_INCLUDE_CURRENT_DIR ON)
# project definitions
add_definitions (-DQT5 -DCMAKE_BUILD -DBIGSYM=1)
if (CMAKE_HOST_UNIX)
add_definitions (-DUNIX)
elseif (CMAKE_HOST_WIN32)
add_definitions (-DWIN32)
endif ()
#
# source navigation
#
set (sources
${CMAKE_SOURCE_DIR}/*
${CMAKE_SOURCE_DIR}/logbook/*
${CMAKE_SOURCE_DIR}/lib/*
)
add_custom_target (ctags COMMAND ${CTAGS} -o ${CMAKE_SOURCE_DIR}/tags -R ${sources})
add_custom_target (etags COMMAND ${ETAGS} -o ${CMAKE_SOURCE_DIR}/TAGS -R ${sources})
# Qt i18n
set (LANGUAGES
en_US
ru_RU
et_EE
es_ES
hr_HR
hu_HU
fr_FR
it_IT
lv_LV
nl_NL
pl_PL
pt_PT
pt_BR
zh_HK
zh_CN
ja_JP
ca_ES
da_DK
sv_SE
)
foreach (lang_ ${LANGUAGES})
file (TO_NATIVE_PATH translations/jtdx_${lang_}.ts ts_)
list (APPEND TS_FILES ${ts_})
endforeach ()
if (UPDATE_TRANSLATIONS)
message (STATUS "UPDATE_TRANSLATIONS option is set.")
qt5_create_translation (
QM_FILES ${wsjt_qt_UISRCS} ${wsjtx_UISRCS} ${wsjt_qt_CXXSRCS} ${wsjtx_CXXSRCS}
${TS_FILES}
OPTIONS -source-language en_US
)
else ()
qt5_add_translation (QM_FILES ${TS_FILES})
endif ()
add_custom_target (translations DEPENDS ${QM_FILES})
set_property (DIRECTORY PROPERTY CLEAN_NO_CUSTOM TRUE)
# do this after i18n to stop lupdate walking the boost tree which it
# chokes on
if (Boost_FOUND)
include_directories (${Boost_INCLUDE_DIRS})
endif ()
# embedded resources
function (add_resources resources path)
foreach (resource_file_ ${ARGN})
get_filename_component (name_ ${resource_file_} NAME)