-
Notifications
You must be signed in to change notification settings - Fork 59
/
CMakeLists.txt
809 lines (671 loc) · 32.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
if(${CMAKE_VERSION} VERSION_GREATER "3.26")
cmake_minimum_required(VERSION 3.5.0)
else()
cmake_minimum_required(VERSION 3.0.2)
endif()
set_property( GLOBAL PROPERTY ALLOW_DUPLICATE_CUSTOM_TARGETS ON )
project( sirikali )
set( PGR_VERSION "1.7.2" )
set( COPYRIGHT_YEARS "2016-2024" )
file(WRITE ${PROJECT_BINARY_DIR}/VERSION_INFO "${PGR_VERSION}")
set( CMAKE_CXX_STANDARD 14 )
option(BUILD_WITH_QT6 "Build with Qt 6" OFF)
if(BUILD_WITH_QT6)
find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED )
else()
find_package(Qt6 COMPONENTS Core QUIET)
if(Qt6_FOUND)
set(BUILD_WITH_QT6 ON)
find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED)
else()
find_package(Qt5 COMPONENTS Core QUIET)
if(Qt5_FOUND)
set(BUILD_WITH_QT6 OFF)
find_package(Qt5 COMPONENTS Core Widgets Network REQUIRED)
else()
message( FATAL_ERROR "-- Failed to find Qt5 or Qt6")
endif()
endif()
endif()
set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS OFF)
MESSAGE( STATUS "Setting C++ version to C++14" )
if(${CMAKE_VERSION} VERSION_LESS "3.1.0")
message("Warning your cmake version is too old(<3.1.0) and code my not compile")
add_definitions(-std=c++14)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_definitions(-Qunused-arguments)
endif()
include_directories( ${PROJECT_BINARY_DIR} )
INCLUDE( GNUInstallDirs )
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY )
add_custom_target( uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake )
INCLUDE(CMakeDependentOption)
INCLUDE(FindPkgConfig)
if( WIN32 )
add_definitions( -D_DEFAULT_SOURCE )
else()
add_definitions( -D_DEFAULT_SOURCE -fstack-protector-all --param ssp-buffer-size=4 )
endif()
include_directories( ${PROJECT_BINARY_DIR} )
if( LIB_SUFFIX )
set( CMAKE_INSTALL_LIBDIR "${LIB_SUFFIX}" )
set( CMAKE_INSTALL_FULL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${LIB_SUFFIX}" )
endif()
pkg_check_modules( PWQUALITY pwquality )
if( PWQUALITY_FOUND )
find_file( header_pwquality pwquality.h PATHS ${PWQUALITY_INCLUDE_DIRS} )
find_library( library_pwquality pwquality )
if( library_pwquality )
if( header_pwquality )
file( WRITE ${PROJECT_BINARY_DIR}/can_build_pwquality.h "#define BUILD_PWQUALITY 1\n" )
file( APPEND ${PROJECT_BINARY_DIR}/can_build_pwquality.h "extern \"C\"\n{\n#include <${header_pwquality}>\n}" )
else()
file( WRITE ${PROJECT_BINARY_DIR}/can_build_pwquality.h "#define BUILD_PWQUALITY 0\n" )
endif()
else( library_pwquality )
file( WRITE ${PROJECT_BINARY_DIR}/can_build_pwquality.h "#define BUILD_PWQUALITY 0\n" )
endif()
else()
file( WRITE ${PROJECT_BINARY_DIR}/can_build_pwquality.h "#define BUILD_PWQUALITY 0\n" )
endif()
if( APPLE )
file( WRITE ${PROJECT_BINARY_DIR}/locale_path.h "\n#define TRANSLATION_PATH \"${CMAKE_INSTALL_PREFIX}/sirikali.app/Contents/Resources/\"\n")
else()
file( WRITE ${PROJECT_BINARY_DIR}/locale_path.h "\n#define TRANSLATION_PATH \"${CMAKE_INSTALL_FULL_DATADIR}/sirikali/translations/\"\n")
endif()
file( WRITE ${PROJECT_BINARY_DIR}/install_prefix.h "\n#define INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}/\"\n" )
if( NOT DEFINED INTERNAL_LXQT_WALLET )
set( INTERNAL_LXQT_WALLET "false" )
endif()
if(NOT DEFINED NONETWORKSUPPORT)
set( NONETWORKSUPPORT "true" )
endif()
if( WIN32 )
set( INTERNAL_LXQT_WALLET "true" )
else()
find_file( GCRYPT_INCLUDE_FILE gcrypt.h )
find_path( GCRYPT_INCLUDE_PATH gcrypt.h )
add_definitions( -I${GCRYPT_INCLUDE_PATH} )
find_library( GCRYPT_LIBRARY gcrypt )
if( NOT GCRYPT_INCLUDE_FILE )
MESSAGE( FATAL_ERROR "could not find gcrypt header file" )
else()
MESSAGE( STATUS "found gcrypt header file at: ${GCRYPT_INCLUDE_FILE}" )
endif()
if( NOT GCRYPT_LIBRARY )
MESSAGE( FATAL_ERROR "could not find gcrypt library" )
else()
get_filename_component( GCRYPT_LIBRARY_PATH ${GCRYPT_LIBRARY} DIRECTORY )
MESSAGE( STATUS "found gcrypt library at: ${GCRYPT_LIBRARY}" )
MESSAGE( STATUS "adding library search path of: ${GCRYPT_LIBRARY_PATH}" )
endif()
endif()
if(BUILD_WITH_QT6)
if( UNIX AND NOT APPLE )
find_package( Qt6 COMPONENTS Core Widgets Network DBus REQUIRED )
message( STATUS "Found Qt6Widgets, version ${Qt6Widgets_VERSION}" )
message( STATUS "Found Qt6Core, version ${Qt6Core_VERSION}" )
message( STATUS "Found Qt6Network, version ${Qt6Network_VERSION}" )
message( STATUS "Found Qt6DBus, version ${Qt6DBus_VERSION}" )
else()
find_package( Qt6 COMPONENTS Core Widgets Network REQUIRED )
message( STATUS "Found Qt6Widgets, version ${Qt6Widgets_VERSION}" )
message( STATUS "Found Qt6Core, version ${Qt6Core_VERSION}" )
message( STATUS "Found Qt6Network, version ${Qt6Network_VERSION}" )
endif()
SET (QTVERSION "${Qt6Core_VERSION}" )
else()
if( UNIX AND NOT APPLE )
find_package( Qt5 COMPONENTS Core Widgets Network DBus REQUIRED )
message( STATUS "Found Qt5Widgets, version ${Qt5Widgets_VERSION}" )
message( STATUS "Found Qt5Core, version ${Qt5Core_VERSION}" )
message( STATUS "Found Qt5Network, version ${Qt5Network_VERSION}" )
message( STATUS "Found Qt5DBus, version ${Qt5DBus_VERSION}" )
else()
find_package( Qt5 COMPONENTS Core Widgets Network REQUIRED )
message( STATUS "Found Qt5Widgets, version ${Qt5Widgets_VERSION}" )
message( STATUS "Found Qt5Core, version ${Qt5Core_VERSION}" )
message( STATUS "Found Qt5Network, version ${Qt5Network_VERSION}" )
endif()
SET (QTVERSION "${Qt5Core_VERSION}" )
endif()
if( BUILD_FLATPAK )
file( WRITE ${PROJECT_BINARY_DIR}/flatpak.h "\n#define FLATPAK 1\n" )
else()
file( WRITE ${PROJECT_BINARY_DIR}/flatpak.h "\n#define FLATPAK 0\n" )
endif()
#pkg_check_modules( MCHUNGU_TASK mhogomchungu_task )
file( WRITE ${PROJECT_BINARY_DIR}/version.h "
#ifndef THIS_VERSION
#define THIS_VERSION \"${PGR_VERSION}.git_tag\"
#endif
\n
#ifndef SIRIKALI_VERSION
#define SIRIKALI_VERSION
#define VERSION_STRING \"Version : ${PGR_VERSION}.git_tag (Compiled with Qt ${QTVERSION})\\nCopyright: ${COPYRIGHT_YEARS} Francis Banyikwa,[email protected]\\nLicense : GPLv2+\"
#endif
\n" )
file(WRITE ${PROJECT_BINARY_DIR}/network_support.h "\n#define HAS_NETWORK_SUPPORT 1\n")
if( MCHUNGU_TASK_FOUND )
message( STATUS "---------------------------------------------------------------------------" )
message( STATUS "mhogomchungu_task library will be provided by an external library" )
message( STATUS "---------------------------------------------------------------------------" )
include_directories( "${MCHUNGU_TASK_INCLUDEDIR}" )
link_directories( "${MCHUNGU_TASK_LIBDIR}" )
else()
message( STATUS "---------------------------------------------------------------------------" )
message( STATUS "mhogomchungu_task library will be provided by an internal library" )
message( STATUS "---------------------------------------------------------------------------" )
include_directories( src/3rdParty/tasks )
ADD_SUBDIRECTORY( src/3rdParty/tasks )
endif()
if( INTERNAL_LXQT_WALLET )
message( STATUS "---------------------------------------------------------------------------" )
message( STATUS "lxqt wallet support will be provided by an internal library" )
message( STATUS "---------------------------------------------------------------------------" )
ADD_SUBDIRECTORY( src/3rdParty/lxqt_wallet )
include_directories( ${PROJECT_SOURCE_DIR}/src/3rdParty/lxqt_wallet/frontend )
include_directories( ${PROJECT_BINARY_DIR}/src/3rdParty/lxqt_wallet/frontend )
else()
pkg_check_modules( LXQT_WALLET lxqt-wallet )
if( NOT LXQT_WALLET_FOUND )
message( STATUS "ERROR: could not find lxqt_wallet package" )
message( STATUS "---------------------------------------------------------------------------" )
message( STATUS "lxqt wallet support will be provided by an internal library" )
message( STATUS "---------------------------------------------------------------------------" )
include_directories( ${PROJECT_SOURCE_DIR}/src/3rdParty/lxqt_wallet/frontend )
include_directories( ${PROJECT_BINARY_DIR}/src/3rdParty/lxqt_wallet/frontend )
ADD_SUBDIRECTORY( src/3rdParty/lxqt_wallet )
else()
if( LXQT_WALLET_VERSION VERSION_GREATER "3.1.0" )
include_directories( ${LXQT_WALLET_INCLUDEDIR} )
link_directories( ${LXQT_WALLET_LIBDIR} )
message( STATUS "---------------------------------------------------------------------------" )
message( STATUS "lxqt wallet support will be provided by an external library" )
message( STATUS "---------------------------------------------------------------------------" )
else()
message( STATUS "---------------------------------------------------------------------------" )
message( FATAL_ERROR "---------------------------------------------------------------------------\nInstalled version of lxqt_wallet is too old(<3.2.0)\nPlease install a more receant version from: https://github.com/lxqt/lxqt_wallet\n---------------------------------------------------------------------------" )
endif()
endif()
endif()
set( UI_FILES src/sirikali.ui
src/keydialog.ui
src/dialogmsg.ui
src/plugin.ui
src/createbackendwindow.ui
src/favorites2.ui
src/readonlywarning.ui
src/dialogok.ui
src/help.ui
src/filemanager.ui
src/debugwindow.ui
src/configfileoption.ui
src/configoptions.ui
src/checkforupdateswindow.ui
src/engines/options.ui
src/engines/customcreateoptions.ui
src/engines/gocryptfscreateoptions.ui
src/engines/ecryptfscreateoptions.ui
src/engines/securefscreateoptions.ui
src/engines/encfscreateoptions.ui
src/engines/cryfscreateoptions.ui
src/engines/fscryptcreateoptions.ui
)
set( MOC_FILES src/configoptions.h
src/configfileoption.h
src/dialogok.h
src/checkforupdates.h
src/help.h
src/createbackendwindow.h
src/sirikali.h
src/oneinstance.h
src/keydialog.h
src/dialogmsg.h
src/plugin.h
src/favorites2.h
src/readonlywarning.h
src/filemanager.h
src/mountinfo.h
src/debugwindow.h
src/checkforupdateswindow.h
src/engines/options.h
src/engines/customcreateoptions.h
src/engines/gocryptfscreateoptions.h
src/engines/ecryptfscreateoptions.h
src/engines/securefscreateoptions.h
src/engines/encfscreateoptions.h
src/engines/cryfscreateoptions.h
src/engines/fscryptcreateoptions.h
)
set( SRC src/dialogok.cpp
src/main.cpp
src/systemsignalhandler.cpp
src/crypto.cpp
src/debugwindow.cpp
src/configoptions.cpp
src/configfileoption.cpp
src/sirikali.cpp
src/checkforupdateswindow.cpp
src/keydialog.cpp
src/siritask.cpp
src/help.cpp
src/themes.cpp
src/createbackendwindow.cpp
src/engines.cpp
src/oneinstance.cpp
src/mountinfo.cpp
src/utility.cpp
src/dialogmsg.cpp
src/favorites.cpp
src/favorites2.cpp
src/checkforupdates.cpp
src/plugin.cpp
src/tablewidget.cpp
src/readonlywarning.cpp
src/secrets.cpp
src/filemanager.cpp
src/utility2.cpp
src/win.cpp
src/processManager.cpp
src/settings.cpp
src/engines/options.cpp
src/engines/cryfs.cpp
src/engines/ecryptfs.cpp
src/engines/gocryptfs.cpp
src/engines/securefs.cpp
src/engines/sshfs.cpp
src/engines/customcreateoptions.cpp
src/engines/encfs.cpp
src/engines/unknown.cpp
src/engines/custom.cpp
src/engines/gocryptfscreateoptions.cpp
src/engines/ecryptfscreateoptions.cpp
src/engines/securefscreateoptions.cpp
src/engines/encfscreateoptions.cpp
src/engines/cryfscreateoptions.cpp
src/engines/fscrypt.cpp
src/engines/fscryptcreateoptions.cpp
src/engines/cryptomator.cpp
)
set( CMAKE_INCLUDE_CURRENT_DIR ON )
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )
INCLUDE_DIRECTORIES( ${GCRYPT_INCLUDE_PATH} )
if(BUILD_WITH_QT6)
SET( TRAY_RC_SRCS "src/icon.qrc" )
set( CMAKE_AUTOMOC ON )
set( CMAKE_AUTORCC ON )
set( CMAKE_AUTOUIC ON )
if( APPLE )
add_executable( SiriKali MACOSX_BUNDLE ${MOC_FILES} ${UI_FILES} ${SRC} ${TRAY_RC_SRCS} ${PROJECT_SOURCE_DIR}/icons/256x256/sirikali.icns )
set_target_properties( SiriKali PROPERTIES MACOSX_BUNDLE ON )
set_target_properties( SiriKali PROPERTIES COMPILE_FLAGS "-Wextra -Wall -s -fPIC -pedantic")
else()
if( WIN32 )
set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_CURRENT_SOURCE_DIR}/src/appicon.rc" )
add_executable( sirikali WIN32 ${MOC_FILES} ${UI_FILES} ${SRC} ${TRAY_RC_SRCS} ${APP_ICON_RESOURCE_WINDOWS} )
set_target_properties( sirikali PROPERTIES COMPILE_FLAGS "-Wextra -Wall -s -pedantic")
else()
add_executable( sirikali ${MOC_FILES} ${UI_FILES} ${SRC} ${TRAY_RC_SRCS} )
set_target_properties( sirikali PROPERTIES COMPILE_FLAGS "-Wextra -Wall -s -fPIC -pedantic")
endif()
endif()
else()
QT5_WRAP_UI( UI ${UI_FILES} )
QT5_WRAP_CPP( MOC ${MOC_FILES} )
QT5_ADD_RESOURCES( TRAY_RC_SRCS src/icon.qrc )
if( APPLE )
add_executable( SiriKali MACOSX_BUNDLE ${MOC} ${UI} ${SRC} ${TRAY_RC_SRCS} ${PROJECT_SOURCE_DIR}/icons/256x256/sirikali.icns )
set_target_properties( SiriKali PROPERTIES MACOSX_BUNDLE ON )
set_target_properties( SiriKali PROPERTIES COMPILE_FLAGS "-Wextra -Wall -s -fPIC -pedantic")
else()
if( WIN32 )
set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_CURRENT_SOURCE_DIR}/src/appicon.rc" )
add_executable( sirikali WIN32 ${MOC} ${UI} ${SRC} ${TRAY_RC_SRCS} ${APP_ICON_RESOURCE_WINDOWS} )
set_target_properties( sirikali PROPERTIES COMPILE_FLAGS "-Wextra -Wall -s -pedantic")
else()
add_executable( sirikali ${MOC} ${UI} ${SRC} ${TRAY_RC_SRCS} )
set_target_properties( sirikali PROPERTIES COMPILE_FLAGS "-Wextra -Wall -s -fPIC -pedantic")
endif()
endif()
endif()
link_directories( ${GCRYPT_LIBRARY_PATH} )
if(BUILD_WITH_QT6)
if( WIN32 )
TARGET_LINK_LIBRARIES( sirikali ${Qt6Widgets_LIBRARIES} ${Qt6Core_LIBRARIES} ${Qt6Widgets_LIBRARIES} ${Qt6Network_LIBRARIES} mhogomchungu_task lxqt-wallet )
endif()
if( APPLE )
TARGET_LINK_LIBRARIES( SiriKali ${Qt6Widgets_LIBRARIES} ${Qt6Core_LIBRARIES} ${Qt6Widgets_LIBRARIES} ${Qt6Network_LIBRARIES} ${library_pwquality} ${GCRYPT_LIBRARY} mhogomchungu_task lxqt-wallet -L${GCRYPT_LIBRARY_PATH})
endif()
if( UNIX AND NOT APPLE )
TARGET_LINK_LIBRARIES( sirikali ${Qt6DBus_LIBRARIES} ${Qt6Widgets_LIBRARIES} ${Qt6Core_LIBRARIES} ${Qt6Widgets_LIBRARIES} ${Qt6Network_LIBRARIES} ${library_pwquality} ${GCRYPT_LIBRARY} mhogomchungu_task lxqt-wallet -L${GCRYPT_LIBRARY_PATH} -Wl,-znow)
endif()
else()
if( WIN32 )
TARGET_LINK_LIBRARIES( sirikali ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES} mhogomchungu_task lxqt-wallet )
endif()
if( APPLE )
TARGET_LINK_LIBRARIES( SiriKali ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES} ${library_pwquality} ${GCRYPT_LIBRARY} mhogomchungu_task lxqt-wallet -L${GCRYPT_LIBRARY_PATH})
endif()
if( UNIX AND NOT APPLE )
TARGET_LINK_LIBRARIES( sirikali ${Qt5DBus_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES} ${library_pwquality} ${GCRYPT_LIBRARY} mhogomchungu_task lxqt-wallet -L${GCRYPT_LIBRARY_PATH} -Wl,-znow)
endif()
endif()
if(BUILD_WITH_QT6)
message( STATUS "---------------------------------------------------------------------------" )
message( STATUS "Building using Qt6" )
message( STATUS "---------------------------------------------------------------------------\n\n" )
else()
message( STATUS "---------------------------------------------------------------------------" )
message( STATUS "Building using Qt5" )
message( STATUS "---------------------------------------------------------------------------\n\n" )
endif()
if( WIN32 )
ADD_SUBDIRECTORY( src/sirikali_cppcryptfs )
endif()
if( WIN32 )
set_target_properties( sirikali PROPERTIES COMPILE_FLAGS "-Wextra -Wall -s -pedantic" )
else()
if( APPLE )
set_target_properties( SiriKali PROPERTIES COMPILE_FLAGS "-Wextra -Wall -s -fPIC -pedantic" )
else()
set_target_properties( sirikali PROPERTIES COMPILE_FLAGS "-Wextra -Wall -s -fPIC -pedantic" )
endif()
endif()
file( WRITE ${PROJECT_BINARY_DIR}/siriPolkit.h "\n#define siriPolkitPath \"${CMAKE_INSTALL_PREFIX}/bin/sirikali.pkexec\"" )
if( APPLE )
SET( plugin_dest_dir SiriKali.app/Contents )
SET( qtconf_dest_dir SiriKali.app/Contents/Resources )
SET( APPS "\${CMAKE_INSTALL_PREFIX}/SiriKali.app" )
set_target_properties( SiriKali
PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/src/MacOSXBundleInfo.plist.in"
MACOSX_BUNDLE_BUNDLE_NAME "SiriKali"
MACOSX_BUNDLE_COPYRIGHT "(c)${COPYRIGHT_YEARS},Francis Banyikwa,[email protected]"
MACOSX_BUNDLE_BUNDLE_VERSION "${PGR_VERSION}"
MACOSX_BUNDLE_GUI_IDENTIFIER "com.crypto.SiriKali"
MACOSX_BUNDLE_SHORT_VERSION_STRING "${PGR_VERSION}"
MACOSX_BUNDLE_LONG_VERSION_STRING "${PGR_VERSION}"
MACOSX_BUNDLE_ICON_FILE sirikali.icns
)
install( TARGETS SiriKali BUNDLE DESTINATION . COMPONENT Runtime )
file( COPY icons/256x256/sirikali.icns DESTINATION "sirikali.app/Contents/Resources/" )
file( COPY translations/fr_FR.qm DESTINATION "sirikali.app/Contents/Resources/translations/" )
file( COPY translations/ru_RU.qm DESTINATION "sirikali.app/Contents/Resources/translations/" )
file( COPY translations/es_ES.qm DESTINATION "sirikali.app/Contents/Resources/translations/" )
file( COPY translations/en_US.qm DESTINATION "sirikali.app/Contents/Resources/translations/" )
file( COPY translations/zh_CN.qm DESTINATION "sirikali.app/Contents/Resources/translations/" )
file( COPY translations/de_DE.qm DESTINATION "sirikali.app/Contents/Resources/translations/" )
#file( COPY translations/es_MX.qm DESTINATION "sirikali.app/Contents/Resources/translations/" )
file( COPY changelog DESTINATION "sirikali.app/Contents/Resources/" )
else()
if( BUILD_FLATPAK )
set_target_properties( sirikali PROPERTIES OUTPUT_NAME io.github.mhogomchungu.sirikali )
install( TARGETS sirikali RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install( FILES src/flatpak/io.github.mhogomchungu.sirikali.metainfo.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo )
install( FILES icons/256x256/io.github.mhogomchungu.sirikali.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps/ )
install( FILES icons/48x48/io.github.mhogomchungu.sirikali.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps/ )
install( FILES src/flatpak/io.github.mhogomchungu.sirikali.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications )
install( FILES translations/fr_FR.qm DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/sirikali/translations )
install( FILES translations/ru_RU.qm DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/sirikali/translations )
install( FILES translations/es_ES.qm DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/sirikali/translations )
install( FILES translations/en_US.qm DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/sirikali/translations )
install( FILES translations/zh_CN.qm DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/sirikali/translations )
#install( FILES translations/es_MX.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/sirikali/translations )
install( FILES translations/de_DE.qm DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/sirikali/translations )
install( FILES src/sirikali.1.gz DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/man/man1/ )
else()
install( TARGETS sirikali RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
install( FILES icons/256x256/sirikali.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps/ )
install( FILES icons/48x48/sirikali.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps/ )
install( FILES src/sirikali.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps )
install( FILES src/sirikali.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons )
install( FILES translations/fr_FR.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/sirikali/translations )
install( FILES translations/ru_RU.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/sirikali/translations )
install( FILES translations/es_ES.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/sirikali/translations )
install( FILES translations/en_US.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/sirikali/translations )
install( FILES translations/zh_CN.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/sirikali/translations )
#install( FILES translations/es_MX.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/sirikali/translations )
install( FILES translations/de_DE.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/sirikali/translations )
install( FILES src/sirikali.1.gz DESTINATION ${CMAKE_INSTALL_DATADIR}/man/man1/ )
install( FILES src/sirikali.pkexec.1.gz DESTINATION ${CMAKE_INSTALL_DATADIR}/man/man1/ )
install( FILES src/sirikali.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo/ )
endif()
endif()
if( NOT APPLE )
#install( FILES sirikali.png DESTINATION share/icons/hicolor/32x32/apps )
if( NOT BUILD_FLATPAK )
# desktop file section
file( WRITE ${PROJECT_BINARY_DIR}/io.github.mhogomchungu.sirikali.desktop
"[Desktop Entry]
Comment[en_US]=Manage Encrypted Volumes Hosted In Folders
Comment=Manage Encrypted Volumes Hosted In Folders
Exec=${CMAKE_INSTALL_FULL_BINDIR}/sirikali -d %U
GenericName[en_US]=Encrypted Folder Manager
GenericName=Encrypted Folder Manager
Icon=sirikali
Name[en_US]=SiriKali
Name=SiriKali
NoDisplay=false
StartupNotify=true
Terminal=false
Type=Application
Categories=Security;Utility;Qt;X-MandrivaLinux-System-FileTools;\n")
install( FILES ${PROJECT_BINARY_DIR}/io.github.mhogomchungu.sirikali.desktop
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
if( UNIX AND NOT APPLE )
if( "${POLKIT_SUPPORT}" STREQUAL "" )
SET( POLKIT_SUPPORT "true" )
endif()
if( POLKIT_SUPPORT )
ADD_SUBDIRECTORY( src/siripolkit )
endif()
endif()
file( WRITE ${PROJECT_BINARY_DIR}/org.sirikali.pkexec.policy
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE policyconfig PUBLIC
\"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN\"
\"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd\">
<policyconfig>
<action id=\"org.sirikali.pkexec\">
<message>Authentication is required to complete requested operation.</message>
<icon_name>sirikali</icon_name>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key=\"org.freedesktop.policykit.exec.path\">${CMAKE_INSTALL_PREFIX}/bin/sirikali.pkexec</annotate>
</action>
</policyconfig>
")
if( UNIX AND NOT APPLE )
if( "${POLKIT_SUPPORT}" STREQUAL "" )
SET( POLKIT_SUPPORT "true" )
endif()
if( POLKIT_SUPPORT )
if( NOT BUILD_FLATPAK )
install ( FILES ${PROJECT_BINARY_DIR}/org.sirikali.pkexec.policy DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/polkit-1/actions )
endif()
endif()
endif()
endif()
endif()
set( OutputBaseFilename "SiriKali-${PGR_VERSION}.setup" )
if(OUTPUT_BASE_NAME)
set( OutputBaseFilename ${OUTPUT_BASE_NAME})
endif()
if( WIN32 )
if( BUILD_WITH_QT6 )
file( WRITE ${PROJECT_BINARY_DIR}/sirikali_windows_installer_Qt6.iss
"
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName \"SiriKali\"
#define MyAppVersion \"${PGR_VERSION}\"
#define MyAppPublisher \"Francis Banyikwa\"
#define MyAppURL \"https://mhogomchungu.github.io/sirikali\"
#define MyAppExeName \"sirikali.exe\"
#define MyLibrariesLocation \"${LIBRARIES_LOCATION}\"
#define MyEXELocation \"${PROJECT_BINARY_DIR}\\sirikali.exe\"
#define MyEXELocation1 \"${PROJECT_BINARY_DIR}\\src\\sirikali_cppcryptfs\\sirikali_cppcryptfs.exe\"
#define MyOutPutPath \"${OUTPUT_PATH}\"
#define MySourcesPath \"${SOURCE_PATH}\"
[Setup]
AppId={{677BCC48-2AC2-4CBC-B826-A94324C26988}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\\{#MyAppName}
LicenseFile={#MySourcesPath}\\LICENSE.txt
OutputDir={#MyOutPutPath}
SetupIconFile={#MySourcesPath}\\icons\\256x256\\sirikali.ico
Compression=lzma
SolidCompression=yes
DisableProgramGroupPage=yes
OutputBaseFilename=${OutputBaseFilename}
[Tasks]
Name: \"desktopicon\"; Description: \"{cm:CreateDesktopIcon}\"; GroupDescription: \"{cm:AdditionalIcons}\"; Flags: unchecked
Name: \"quicklaunchicon\"; Description: \"{cm:CreateQuickLaunchIcon}\"; GroupDescription: \"{cm:AdditionalIcons}\"; Flags: unchecked; OnlyBelowVersion: 0,6.1
[Files]
Source: {#MyEXELocation}; DestDir: {app}; Flags: ignoreversion
Source: {#MyEXELocation1}; DestDir: {app}; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\*.dll; DestDir: {app} ; Flags: ignoreversion
Source: {#MySourcesPath}\\LICENSE.txt; DestDir: {app}; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\iconengines\\* ; DestDir: {app}\\iconengines; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\imageformats\\*; DestDir: {app}\\imageformats; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\styles\\*; DestDir: {app}\\styles; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\extra\\bsdtar\\*; DestDir: {app}\\extra\\bsdtar; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\platforms\\*; DestDir: {app}\\platforms; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\generic\\*; DestDir: {app}\\generic; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\tls\\*; DestDir: {app}\\tls; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\networkinformation\\*; DestDir: {app}\\networkinformation; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\translations\\*; DestDir: {app}\\translations; Flags: ignoreversion
Source: {#MySourcesPath}\\translations\\*.qm; DestDir: {app}\\translations; Flags: ignoreversion
Source: {#MySourcesPath}\\icons\\256x256\\sirikali.ico; DestDir: {app}\\icons; Flags: ignoreversion
; NOTE: Don't use \"Flags: ignoreversion\" on any shared system files
[Icons]
Name: \"{commonprograms}\\{#MyAppName}\"; Filename: \"{app}\\{#MyAppExeName}\"; IconFilename: \"{app}\\icons\\sirikali.ico\"; WorkingDir: \"{app}\"
;Name: \"{commonprograms}\\Uninstall {#MyAppName}\"; Filename: \"{uninstallexe}\"; IconFilename: \"{app}\\icons\\sirikali.ico\"; WorkingDir: \"{app}\"
Name: \"{commondesktop}\\{#MyAppName}\"; Filename: \"{app}\\{#MyAppExeName}\"; IconFilename: \"{app}\\icons\\sirikali.ico\"; WorkingDir: \"{app}\"; Tasks: desktopicon
Name: \"{userappdata}\\Microsoft\\Internet Explorer\\Quick Launch\\{#MyAppName}\"; Filename: \"{app}\\{#MyAppExeName}\"; IconFilename: \"{app}\\icons\\sirikali.ico\"; WorkingDir: \"{app}\"; Tasks: quicklaunchicon
[Run]
Filename: \"{app}\\{#MyAppExeName}\"; Description: \"{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}\"; Flags: nowait postinstall skipifsilent
[Languages]
Name: \"english\"; MessagesFile: \"compiler:Default.isl\"
Name: \"brazilianportuguese\"; MessagesFile: \"compiler:Languages\\BrazilianPortuguese.isl\"
Name: \"catalan\"; MessagesFile: \"compiler:Languages\\Catalan.isl\"
Name: \"corsican\"; MessagesFile: \"compiler:Languages\\Corsican.isl\"
Name: \"czech\"; MessagesFile: \"compiler:Languages\\Czech.isl\"
Name: \"danish\"; MessagesFile: \"compiler:Languages\\Danish.isl\"
Name: \"dutch\"; MessagesFile: \"compiler:Languages\\Dutch.isl\"
Name: \"finnish\"; MessagesFile: \"compiler:Languages\\Finnish.isl\"
Name: \"french\"; MessagesFile: \"compiler:Languages\\French.isl\"
Name: \"german\"; MessagesFile: \"compiler:Languages\\German.isl\"
Name: \"hebrew\"; MessagesFile: \"compiler:Languages\\Hebrew.isl\"
Name: \"italian\"; MessagesFile: \"compiler:Languages\\Italian.isl\"
Name: \"japanese\"; MessagesFile: \"compiler:Languages\\Japanese.isl\"
Name: \"norwegian\"; MessagesFile: \"compiler:Languages\\Norwegian.isl\"
Name: \"polish\"; MessagesFile: \"compiler:Languages\\Polish.isl\"
Name: \"portuguese\"; MessagesFile: \"compiler:Languages\\Portuguese.isl\"
Name: \"russian\"; MessagesFile: \"compiler:Languages\\Russian.isl\"
Name: \"slovenian\"; MessagesFile: \"compiler:Languages\\Slovenian.isl\"
Name: \"spanish\"; MessagesFile: \"compiler:Languages\\Spanish.isl\"
Name: \"turkish\"; MessagesFile: \"compiler:Languages\\Turkish.isl\"
Name: \"ukrainian\"; MessagesFile: \"compiler:Languages\\Ukrainian.isl\"
")
else()
file( WRITE ${PROJECT_BINARY_DIR}/sirikali_windows_installer_Qt5.iss
"
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName \"SiriKali\"
#define MyAppVersion \"${PGR_VERSION}\"
#define MyAppPublisher \"Francis Banyikwa\"
#define MyAppURL \"https://mhogomchungu.github.io/sirikali\"
#define MyAppExeName \"sirikali.exe\"
#define MyLibrariesLocation \"${LIBRARIES_LOCATION}\"
#define MyEXELocation \"${PROJECT_BINARY_DIR}\\sirikali.exe\"
#define MyEXELocation1 \"${PROJECT_BINARY_DIR}\\src\\sirikali_cppcryptfs\\sirikali_cppcryptfs.exe\"
#define MyOutPutPath \"${OUTPUT_PATH}\"
#define MySourcesPath \"${SOURCE_PATH}\"
[Setup]
AppId={{677BCC48-2AC2-4CBC-B826-A94324C26988}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\\{#MyAppName}
LicenseFile={#MySourcesPath}\\LICENSE.txt
OutputDir={#MyOutPutPath}
SetupIconFile={#MySourcesPath}\\icons\\256x256\\sirikali.ico
Compression=lzma
SolidCompression=yes
DisableProgramGroupPage=yes
OutputBaseFilename=${OutputBaseFilename}
[Tasks]
Name: \"desktopicon\"; Description: \"{cm:CreateDesktopIcon}\"; GroupDescription: \"{cm:AdditionalIcons}\"; Flags: unchecked
Name: \"quicklaunchicon\"; Description: \"{cm:CreateQuickLaunchIcon}\"; GroupDescription: \"{cm:AdditionalIcons}\"; Flags: unchecked; OnlyBelowVersion: 0,6.1
[Files]
Source: {#MyEXELocation}; DestDir: {app}; Flags: ignoreversion
Source: {#MyEXELocation1}; DestDir: {app}; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\*.dll; DestDir: {app} ; Flags: ignoreversion
Source: {#MySourcesPath}\\LICENSE.txt; DestDir: {app}; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\bearer\\* ; DestDir: {app}\\bearer; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\iconengines\\* ; DestDir: {app}\\iconengines; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\imageformats\\*; DestDir: {app}\\imageformats; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\styles\\*; DestDir: {app}\\styles; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\extra\\bsdtar\\*; DestDir: {app}\\extra\\bsdtar; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\platforms\\*; DestDir: {app}\\platforms; Flags: ignoreversion
Source: {#MyLibrariesLocation}\\translations\\*; DestDir: {app}\\translations; Flags: ignoreversion
Source: {#MySourcesPath}\\translations\\*.qm; DestDir: {app}\\translations; Flags: ignoreversion
Source: {#MySourcesPath}\\icons\\256x256\\sirikali.ico; DestDir: {app}\\icons; Flags: ignoreversion
; NOTE: Don't use \"Flags: ignoreversion\" on any shared system files
[Icons]
Name: \"{commonprograms}\\{#MyAppName}\"; Filename: \"{app}\\{#MyAppExeName}\"; IconFilename: \"{app}\\icons\\sirikali.ico\"; WorkingDir: \"{app}\"
;Name: \"{commonprograms}\\Uninstall {#MyAppName}\"; Filename: \"{uninstallexe}\"; IconFilename: \"{app}\\icons\\sirikali.ico\"; WorkingDir: \"{app}\"
Name: \"{commondesktop}\\{#MyAppName}\"; Filename: \"{app}\\{#MyAppExeName}\"; IconFilename: \"{app}\\icons\\sirikali.ico\"; WorkingDir: \"{app}\"; Tasks: desktopicon
Name: \"{userappdata}\\Microsoft\\Internet Explorer\\Quick Launch\\{#MyAppName}\"; Filename: \"{app}\\{#MyAppExeName}\"; IconFilename: \"{app}\\icons\\sirikali.ico\"; WorkingDir: \"{app}\"; Tasks: quicklaunchicon
[Run]
Filename: \"{app}\\{#MyAppExeName}\"; Description: \"{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}\"; Flags: nowait postinstall skipifsilent
[Languages]
Name: \"english\"; MessagesFile: \"compiler:Default.isl\"
Name: \"brazilianportuguese\"; MessagesFile: \"compiler:Languages\\BrazilianPortuguese.isl\"
Name: \"catalan\"; MessagesFile: \"compiler:Languages\\Catalan.isl\"
Name: \"corsican\"; MessagesFile: \"compiler:Languages\\Corsican.isl\"
Name: \"czech\"; MessagesFile: \"compiler:Languages\\Czech.isl\"
Name: \"danish\"; MessagesFile: \"compiler:Languages\\Danish.isl\"
Name: \"dutch\"; MessagesFile: \"compiler:Languages\\Dutch.isl\"
Name: \"finnish\"; MessagesFile: \"compiler:Languages\\Finnish.isl\"
Name: \"french\"; MessagesFile: \"compiler:Languages\\French.isl\"
Name: \"german\"; MessagesFile: \"compiler:Languages\\German.isl\"
Name: \"hebrew\"; MessagesFile: \"compiler:Languages\\Hebrew.isl\"
Name: \"italian\"; MessagesFile: \"compiler:Languages\\Italian.isl\"
Name: \"japanese\"; MessagesFile: \"compiler:Languages\\Japanese.isl\"
Name: \"norwegian\"; MessagesFile: \"compiler:Languages\\Norwegian.isl\"
Name: \"polish\"; MessagesFile: \"compiler:Languages\\Polish.isl\"
Name: \"portuguese\"; MessagesFile: \"compiler:Languages\\Portuguese.isl\"
Name: \"russian\"; MessagesFile: \"compiler:Languages\\Russian.isl\"
Name: \"slovenian\"; MessagesFile: \"compiler:Languages\\Slovenian.isl\"
Name: \"spanish\"; MessagesFile: \"compiler:Languages\\Spanish.isl\"
Name: \"turkish\"; MessagesFile: \"compiler:Languages\\Turkish.isl\"
Name: \"ukrainian\"; MessagesFile: \"compiler:Languages\\Ukrainian.isl\"
")
endif()
endif()