-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathCMakeLists.txt
995 lines (905 loc) · 43.3 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
cmake_minimum_required(VERSION 3.16)
project(jami-core
VERSION 15.3.0
LANGUAGES C CXX)
set(PACKAGE_NAME "Jami Daemon")
set (CMAKE_CXX_STANDARD 17)
set(PROJECT_LABEL "libjami")
################################################################################
# Build options
################################################################################
option(JAMI_NATPMP "Build with NAT-PMP" ON)
option(JAMI_PUPNP "Build with PUPNP" ON)
option(JAMI_PLUGIN "Build with plugin support" ON)
option(JAMI_NODEJS "Build the NODEJS binding" OFF)
option(JAMI_JNI "Build the JNI binding" OFF)
option(JAMI_DBUS "Build the DBUS binding" OFF)
option(JAMI_VIDEO "Build with video support" ON)
option(JAMI_VIDEO_ACCEL "Build video hardware acceleration support" ON)
option(BUILD_CONTRIB "Build contrib to CONTRIB_PATH" ON)
option(BUILD_EXTRA_TOOLS "Build extra tools" OFF)
option(ENABLE_ASAN "Enable address sanitization" OFF)
option(ENABLE_COVERAGE "Enable coverage (for tests)" OFF)
if(ENABLE_ASAN AND NOT MSVC)
message(STATUS "Address sanitization enabled for daemon")
# Add AddressSanitizer flags for both compiler and linker
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
endif()
if(ENABLE_COVERAGE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
endif()
include(CTest)
if(JAMI_NODEJS)
# Required for nodejs binding
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
if(NOT MSVC)
################################################################################
# Contrib
################################################################################
# Android target mapping for contrib
if (ANDROID_ABI STREQUAL "x86")
set(TARGET i686-linux-android)
elseif (ANDROID_ABI STREQUAL "x86_64")
set(TARGET x86_64-linux-android)
elseif (ANDROID_ABI STREQUAL "arm64-v8a")
set(TARGET aarch64-linux-android)
elseif (ANDROID_ABI STREQUAL "armeabi-v7a")
set(TARGET armv7a-linux-androideabi)
else()
set(TARGET ${CMAKE_LIBRARY_ARCHITECTURE})
if (NOT TARGET)
execute_process(COMMAND gcc -dumpmachine COMMAND tr -d '\n' OUTPUT_VARIABLE TARGET)
endif()
endif()
set(CONTRIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/contrib/${TARGET})
include(ProcessorCount)
ProcessorCount(NPROC)
if(NOT NPROC EQUAL 0)
set(CONTRIB_BUILD_FLAGS -j${NPROC})
endif()
if (BUILD_EXTRA_TOOLS)
set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/extras/tools/build/bin:$ENV{PATH}")
execute_process(
COMMAND ./bootstrap
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/extras/tools)
execute_process(
COMMAND make ${CONTRIB_BUILD_FLAGS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/extras/tools)
execute_process(
COMMAND make .pkg-config
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/extras/tools)
execute_process(
COMMAND make .gas
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/extras/tools)
endif()
if (JAMI_JNI)
# Generate swig binding
add_custom_command(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/bin/jni/jami_wrapper.cpp
COMMAND env PACKAGEDIR=${JAMI_JNI_PACKAGEDIR} "./make-swig.sh"
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/bin/jni/make-swig.sh
${CMAKE_CURRENT_SOURCE_DIR}/bin/jni/jni_interface.i
${CMAKE_CURRENT_SOURCE_DIR}/bin/jni/callmanager.i
${CMAKE_CURRENT_SOURCE_DIR}/bin/jni/configurationmanager.i
${CMAKE_CURRENT_SOURCE_DIR}/bin/jni/conversation.i
${CMAKE_CURRENT_SOURCE_DIR}/bin/jni/managerimpl.i
${CMAKE_CURRENT_SOURCE_DIR}/bin/jni/data_view.i
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin/jni
)
endif()
endif()
if (BUILD_CONTRIB)
if (NOT MSVC)
set(CONTRIB_BUILD_PATH ${CMAKE_CURRENT_SOURCE_DIR}/contrib/native-${TARGET})
file(MAKE_DIRECTORY ${CONTRIB_BUILD_PATH})
file(MAKE_DIRECTORY ${CONTRIB_PATH})
if (ANDROID)
# See https://developer.android.com/ndk/guides/other_build_systems
set(ENV{ANDROID_NDK} ${ANDROID_NDK})
set(ENV{ANDROID_ABI} ${ANDROID_ABI})
set(ENV{ANDROID_API} ${ANDROID_PLATFORM})
set(ENV{TOOLCHAIN} ${ANDROID_TOOLCHAIN_ROOT})
set(ENV{TARGET} ${TARGET})
set(ENV{API} ${ANDROID_PLATFORM_LEVEL})
set(ENV{CC} $ENV{TOOLCHAIN}/bin/${TARGET}$ENV{API}-clang)
set(ENV{CXX} $ENV{TOOLCHAIN}/bin/${TARGET}$ENV{API}-clang++)
set(ENV{AS} "$ENV{CC} -c")
set(ENV{AR} ${CMAKE_AR})
set(ENV{RANLIB} ${CMAKE_RANLIB})
set(ENV{STRIP} ${CMAKE_STRIP})
set(ENV{LD} $ENV{TOOLCHAIN}/bin/ld)
endif()
file(LOCK ${CONTRIB_BUILD_PATH} DIRECTORY)
execute_process(
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/contrib/bootstrap --host=${TARGET}
WORKING_DIRECTORY ${CONTRIB_BUILD_PATH})
execute_process(COMMAND make list
WORKING_DIRECTORY ${CONTRIB_BUILD_PATH})
execute_process(COMMAND make ${CONTRIB_BUILD_FLAGS}
WORKING_DIRECTORY ${CONTRIB_BUILD_PATH})
file(LOCK ${CONTRIB_BUILD_PATH} DIRECTORY RELEASE)
else()
set(SCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extras/scripts)
execute_process(
COMMAND python ${SCRIPTS_DIR}/winmake.py
WORKING_DIRECTORY ${SCRIPTS_DIR}
RESULT_VARIABLE BUILD_RESULT
)
if (BUILD_RESULT)
message(FATAL_ERROR "Contrib build failed.")
else()
message(STATUS "Contrib build successful.")
endif()
endif()
endif()
################################################################################
# Check dependencies
################################################################################
if(NOT MSVC)
include(FindPkgConfig)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
pkg_search_module (udev REQUIRED IMPORTED_TARGET libudev)
pkg_search_module (pulseaudio IMPORTED_TARGET libpulse)
pkg_search_module (alsa IMPORTED_TARGET alsa)
pkg_search_module (jack IMPORTED_TARGET libjack)
# Make sure at least one audio backend is available
if(NOT pulseaudio_FOUND AND NOT alsa_FOUND AND NOT jack_FOUND)
message(FATAL_ERROR "No audio library found. Please install PulseAudio, ALSA or JACK.")
endif()
endif()
endif()
################################################################################
# Source groups
################################################################################
# compat, src source group
if(MSVC)
add_subdirectory("compat")
endif()
add_subdirectory("src")
source_group("Source Files" FILES ${Source_Files})
source_group("Source Files\\client" FILES ${Source_Files__client})
source_group("Source Files\\config" FILES ${Source_Files__config})
source_group("Source Files\\connectivity" FILES ${Source_Files__connectivity})
source_group("Source Files\\connectivity\\security" FILES ${Source_Files__security})
source_group("Source Files\\connectivity\\sip" FILES ${Source_Files__sip})
source_group("Source Files\\jami" FILES ${Source_Files__jami})
source_group("Source Files\\hooks" FILES ${Source_Files__hooks})
source_group("Source Files\\im" FILES ${Source_Files__im})
source_group("Source Files\\jamidht" FILES ${Source_Files__jamidht})
source_group("Source Files\\jamidht\\eth\\libdevcore" FILES ${Source_Files__jamidht__eth__libdevcore})
source_group("Source Files\\jamidht\\eth\\libdevcrypto" FILES ${Source_Files__jamidht__eth__libdevcrypto})
source_group("Source Files\\jamidht\\swarm" FILES ${Source_Files__jamidht__swarm})
source_group("Source Files\\media" FILES ${Source_Files__media})
source_group("Source Files\\media\\audio" FILES ${Source_Files__media__audio})
source_group("Source Files\\media\\audio\\audio-processing" FILES ${Source_Files__media__audio__audio_processing})
source_group("Source Files\\media\\audio\\audio-processing" FILES ${Source_Files__media__audio__webrtc})
source_group("Source Files\\media\\audio\\audio-processing" FILES ${Source_Files__media__audio__speexdsp})
source_group("Source Files\\media\\audio\\sound" FILES ${Source_Files__media__audio__sound})
if(JAMI_VIDEO)
source_group("Source Files\\media\\video" FILES ${Source_Files__media__video})
endif()
source_group("Source Files\\plugin" FILES ${Source_Files__plugin})
if(MSVC)
source_group("Source Files\\media\\audio\\portaudio" FILES ${Source_Files__media__audio__portaudio})
if(JAMI_VIDEO)
source_group("Source Files\\media\\video\\winvideo" FILES ${Source_Files__media__video__winvideo})
endif()
endif()
list (APPEND ALL_FILES
${Source_Files}
${Source_Files__client}
${Source_Files__config}
${Source_Files__connectivity}
${Source_Files__jami}
${Source_Files__hooks}
${Source_Files__im}
${Source_Files__jamidht}
${Source_Files__jamidht__eth__libdevcore}
${Source_Files__jamidht__eth__libdevcrypto}
${Source_Files__jamidht__swarm}
${Source_Files__media}
${Source_Files__media__audio}
${Source_Files__media__audio__sound}
${Source_Files__media__audio__audio_processing}
${Source_Files__security}
${Source_Files__sip}
)
if (JAMI_VIDEO)
list (APPEND ALL_FILES ${Source_Files__media__video})
endif()
if (JAMI_PLUGIN)
list (APPEND ALL_FILES ${Source_Files__plugin})
endif()
if (ANDROID)
list (APPEND ALL_FILES ${ALL_FILES}
${CMAKE_CURRENT_SOURCE_DIR}/src/media/video/androidvideo/video_device_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/media/video/androidvideo/video_device_monitor_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/media/audio/opensl/audio_player.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/media/audio/opensl/audio_recorder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/media/audio/opensl/opensllayer.cpp
)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
if (JAMI_VIDEO)
list (APPEND ALL_FILES ${ALL_FILES}
${CMAKE_CURRENT_SOURCE_DIR}/src/media/video/v4l2/video_device_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/media/video/v4l2/video_device_monitor_impl.cpp
)
endif()
if (pulseaudio_FOUND)
list (APPEND ALL_FILES ${ALL_FILES}
${CMAKE_CURRENT_SOURCE_DIR}/src/media/audio/pulseaudio/audiostream.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/media/audio/pulseaudio/pulselayer.cpp
)
endif()
if (alsa_FOUND)
list (APPEND ALL_FILES ${ALL_FILES}
${CMAKE_CURRENT_SOURCE_DIR}/src/media/audio/alsa/alsalayer.cpp
)
endif()
if (jack_FOUND)
list (APPEND ALL_FILES ${ALL_FILES}
${CMAKE_CURRENT_SOURCE_DIR}/src/media/audio/jack/jacklayer.cpp
)
endif()
elseif (APPLE)
if (IOS)
list (APPEND ALL_FILES ${ALL_FILES}
${CMAKE_CURRENT_SOURCE_DIR}/src/media/video/iosvideo/video_device_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/media/video/iosvideo/video_device_monitor_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/media/audio/coreaudio/ios/corelayer.mm
)
else()
list (APPEND ALL_FILES ${ALL_FILES}
${CMAKE_CURRENT_SOURCE_DIR}/src/media/video/osxvideo/video_device_impl.mm
${CMAKE_CURRENT_SOURCE_DIR}/src/media/video/osxvideo/video_device_monitor_impl.mm
${CMAKE_CURRENT_SOURCE_DIR}/src/media/audio/coreaudio/osx/corelayer.mm
${CMAKE_CURRENT_SOURCE_DIR}/src/media/audio/coreaudio/osx/audiodevice.cpp
)
endif()
elseif(MSVC)
list (APPEND ALL_FILES ${ALL_FILES}
"${Source_Files__media__audio__portaudio}"
"${Source_Files__media__audio__webrtc}"
"${Source_Files__media__audio__speexdsp}"
)
if(JAMI_VIDEO)
list (APPEND ALL_FILES ${ALL_FILES}
"${Source_Files__media__video__uwpvideo}"
"${Source_Files__media__video__winvideo}"
)
endif()
endif()
add_library(${PROJECT_NAME} STATIC ${ALL_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "daemon")
target_compile_definitions(${PROJECT_NAME} PRIVATE
PACKAGE_NAME="${PACKAGE_NAME}"
PACKAGE_VERSION="${PROJECT_VERSION}"
PACKAGE="jami"
LIBJAMI_BUILD
HAVE_RINGNS=1
ASIO_STANDALONE
MSGPACK_NO_BOOST
)
target_compile_definitions(${PROJECT_NAME} PUBLIC
ASIO_STANDALONE
MSGPACK_NO_BOOST
)
if (JAMI_VIDEO)
target_compile_definitions(${PROJECT_NAME} PRIVATE ENABLE_VIDEO)
if (JAMI_VIDEO_ACCEL)
target_compile_definitions(${PROJECT_NAME} PRIVATE RING_ACCEL)
endif()
endif()
if (JAMI_PLUGIN)
target_compile_definitions(${PROJECT_NAME} PRIVATE ENABLE_PLUGIN)
endif()
if (JAMI_NATPMP)
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_LIBNATPMP)
endif()
if (ANDROID)
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_OPENSL)
elseif (APPLE)
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_COREAUDIO)
target_link_libraries(${PROJECT_NAME} PRIVATE "-framework AVFoundation -framework CoreAudio -framework CoreVideo -framework VideoToolbox -framework AudioUnit -lcompression")
elseif (MSVC)
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_PORTAUDIO)
endif()
target_include_directories(${PROJECT_NAME} PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/.;"
"${CMAKE_CURRENT_SOURCE_DIR}/src/config;"
"${CMAKE_CURRENT_SOURCE_DIR}/src/connectivity;"
"${CMAKE_CURRENT_SOURCE_DIR}/src/connectivity/security;"
"${CMAKE_CURRENT_SOURCE_DIR}/src/connectivity/sip;"
"${CMAKE_CURRENT_SOURCE_DIR}/src/client;"
"${CMAKE_CURRENT_SOURCE_DIR}/src/hooks;"
"${CMAKE_CURRENT_SOURCE_DIR}/src/im;"
"${CMAKE_CURRENT_SOURCE_DIR}/src/media;"
"${CMAKE_CURRENT_SOURCE_DIR}/src/jamidht;"
"${CMAKE_CURRENT_SOURCE_DIR}/src/jamidht/eth;"
PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/src;"
"${CMAKE_CURRENT_SOURCE_DIR}/src/jami;"
)
if(MSVC)
################################################################################
# Target
################################################################################
include("CMake/Utils.cmake")
# Only generate Release configuration
set(CMAKE_CONFIGURATION_TYPES "Release" CACHE STRING "Limited configurations" FORCE)
use_props(${PROJECT_NAME} "${CMAKE_CONFIGURATION_TYPES}" "${DEFAULT_CXX_PROPS}")
################################################################################
# Include necessary .cmake file (need to init use_props first)
################################################################################
include("CMake/Default.cmake")
include("CMake/DefaultCXX.cmake")
# Supress generation of ZERO_CHECK
set(CMAKE_SUPPRESS_REGENERATION true)
################################################################################
# Output directory
################################################################################
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
set_target_properties(${PROJECT_NAME} PROPERTIES
OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_SOURCE_DIR}/build/lib"
)
endif()
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
set_target_properties(${PROJECT_NAME} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE "FALSE"
)
endif()
################################################################################
# Include directories
################################################################################
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
target_include_directories(${PROJECT_NAME} PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/compat/msvc;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/sndfile/src;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/openssl/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/asio/asio/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/restinio/dev;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/fmt/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/llhttp/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/natpmp/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/msgpack-c/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/opendht/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/libarchive/libarchive;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/jsoncpp/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/yaml-cpp/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjlib/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjnath/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjlib-util/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/third_party;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/speexdsp/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/webrtc-audio-processing;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/portaudio/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjmedia/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/libgit2/include;"
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/dhtnet/include;"
)
endif()
################################################################################
# Compile definitions
################################################################################
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
target_compile_definitions(${PROJECT_NAME} PRIVATE
"_WIN32_WINNT=0x0A00;"
"STATIC_GETOPT;"
"LIBARCHIVE_STATIC;"
"OPENDHT_PROXY_CLIENT;"
"OPENDHT_PROXY_SERVER;"
"OPENDHT_PUSH_NOTIFICATIONS;"
"NATPMP_STATICLIB;"
"NDEBUG;"
"_USE_MATH_DEFINES;"
"_SCL_SECURE_NO_WARNINGS;"
"_CRT_SECURE_NO_WARNINGS;"
"NOMINMAX;"
"HAVE_CONFIG_H;"
"WIN32_LEAN_AND_MEAN;"
"WEBRTC_WIN;"
"WEBRTC_AUDIO_PROCESSING_ONLY_BUILD;"
"WEBRTC_NS_FLOAT;"
)
endif()
################################################################################
# Compile and link options
################################################################################
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
target_compile_options(${PROJECT_NAME} PRIVATE
/O2;
/Oi;
${DEFAULT_CXX_RUNTIME_LIBRARY};
/Gy;
/MP;
/Oy-;
/sdl-;
/W0;
/FC;
/FS
/nologo;
/Zi;
/wd4996;
/wd4503;
/wd4180;
/wd4244;
/wd4267;
/Zc:__cplusplus;
${DEFAULT_CXX_EXCEPTION_HANDLING}
)
endif()
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
target_link_options(${PROJECT_NAME} PRIVATE
/MACHINE:X64;
/OPT:REF;
/OPT:ICF
/VERBOSE:LIB;
/NODEFAULTLIB:libcmtd;
/NODEFAULTLIB:libcmt;
/OPT:NOLBR;
/OPT:NOICF;
/LTCG
)
endif()
################################################################################
# Dependencies
################################################################################
set(libAdditionalDependencies "${CMAKE_STATIC_LINKER_FLAGS} /LTCG
ws2_32.lib
advapi32.lib
Secur32.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/lib/libavcodec.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/lib/libavdevice.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/lib/libavfilter.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/lib/libavformat.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/lib/libavutil.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/lib/libswresample.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/lib/libswscale.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/libx264.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/libvpx.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/libopus.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/libmfx.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/libgnutls.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/lib_json.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/opendht/build/Release/libopendht.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/argon2/vs2015/Argon2Ref/vs2015/build/Argon2Ref.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/secp256k1.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/yaml-cpp/build/Release/libyaml-cppmd.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/libupnp.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/natpmp/build/Release/natpmp.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/archive_static.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsip-core-x86_64-x64-vc15-Release.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsip-simple-x86_64-x64-vc15-Release.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsua2-lib-x86_64-x64-vc15-Release.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsua-lib-x86_64-x64-vc15-Release.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsip-ua-x86_64-x64-vc15-Release.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjmedia/lib/pjmedia-x86_64-x64-vc15-Release.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjlib-util/lib/pjlib-util-x86_64-x64-vc15-Release.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjlib/lib/pjlib-x86_64-x64-vc15-Release.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjnath/lib/pjnath-x86_64-x64-vc15-Release.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/fmt/msvc/Release/fmt.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/llhttp/build/Release/llhttp.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/openssl/libcrypto.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/openssl/libssl.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/speexdsp/lib/libspeexdsp.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/webrtc-audio-processing/build/Release/webrtc-audio-processing.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/portaudio/build/Release/portaudio_static_x64.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/libgit2/build/Release/git2.lib
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/dhtnet/build/Release/dhtnet.lib
/ignore:4006"
)
set ( CMAKE_STATIC_LINKER_FLAGS ${libAdditionalDependencies} )
else()
include (GNUInstallDirs)
message("Contrib path: ${CONTRIB_PATH}")
list(APPEND CMAKE_FIND_ROOT_PATH ${CONTRIB_PATH})
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
list(APPEND CMAKE_PREFIX_PATH ${CONTRIB_PATH})
find_package (yaml-cpp CONFIG REQUIRED)
pkg_search_module (jsoncpp REQUIRED IMPORTED_TARGET jsoncpp)
pkg_search_module (fmt REQUIRED IMPORTED_TARGET fmt)
pkg_search_module (webrtcap IMPORTED_TARGET webrtc-audio-processing)
pkg_search_module (gnutls REQUIRED IMPORTED_TARGET gnutls)
pkg_search_module (opendht REQUIRED IMPORTED_TARGET opendht)
pkg_search_module (dhtnet REQUIRED IMPORTED_TARGET dhtnet)
pkg_search_module (git2 REQUIRED IMPORTED_TARGET libgit2)
pkg_search_module (secp256k1 REQUIRED IMPORTED_TARGET libsecp256k1)
pkg_search_module (pjproject REQUIRED IMPORTED_TARGET libpjproject)
pkg_search_module (avformat REQUIRED IMPORTED_TARGET libavformat)
pkg_search_module (avdevice REQUIRED IMPORTED_TARGET libavdevice)
pkg_search_module (avfilter REQUIRED IMPORTED_TARGET libavfilter)
pkg_search_module (avcodec REQUIRED IMPORTED_TARGET libavcodec)
pkg_search_module (swresample REQUIRED IMPORTED_TARGET libswresample)
pkg_search_module (swscale REQUIRED IMPORTED_TARGET libswscale)
pkg_search_module (avutil REQUIRED IMPORTED_TARGET libavutil)
pkg_search_module (speexdsp REQUIRED IMPORTED_TARGET speexdsp)
if (JAMI_PLUGIN)
if (APPLE)
pkg_search_module (archive REQUIRED IMPORTED_TARGET minizip)
else()
pkg_search_module (archive REQUIRED IMPORTED_TARGET libarchive)
endif()
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE
PkgConfig::dhtnet
PkgConfig::opendht
PkgConfig::pjproject
PkgConfig::git2
PkgConfig::gnutls
PkgConfig::avformat
PkgConfig::avdevice
PkgConfig::avfilter
PkgConfig::avcodec
PkgConfig::swresample
PkgConfig::swscale
PkgConfig::jsoncpp
PkgConfig::secp256k1
PUBLIC
PkgConfig::fmt
PkgConfig::avutil
)
if (TARGET yaml-cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE yaml-cpp)
else()
target_link_libraries(${PROJECT_NAME} PRIVATE yaml-cpp::yaml-cpp)
endif()
target_compile_options(${PROJECT_NAME} PRIVATE
-fvisibility=hidden
-Wall -Wextra
-Wnon-virtual-dtor
-Wno-deprecated
-Wno-deprecated-declarations
-Wno-unknown-pragmas
)
target_compile_definitions(${PROJECT_NAME} PRIVATE
JAMI_DATADIR="${JAMI_DATADIR}"
PJ_AUTOCONF=1
)
if (BUILD_TESTING)
target_compile_definitions(${PROJECT_NAME} PRIVATE DEBUG)
endif()
if (ANDROID)
target_link_libraries(${PROJECT_NAME} PRIVATE OpenSLES log)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::udev)
if (pulseaudio_FOUND)
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_PULSE)
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::pulseaudio)
endif()
if (alsa_FOUND)
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_ALSA)
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::alsa)
endif()
if (jack_FOUND)
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_JACK)
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::jack)
endif()
elseif (APPLE)
target_link_libraries(${PROJECT_NAME} PRIVATE resolv)
endif()
if (JAMI_PLUGIN)
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::archive)
endif()
if (webrtcap_FOUND)
target_sources(${PROJECT_NAME} PRIVATE ${Source_Files__media__audio__webrtc} )
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::webrtcap)
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_WEBRTC_AP)
endif()
if (speexdsp_FOUND)
target_sources(${PROJECT_NAME} PRIVATE ${Source_Files__media__audio__speexdsp} )
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::speexdsp)
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_SPEEXDSP)
endif()
install (TARGETS ${PROJECT_NAME})
if (JAMI_NODEJS)
# Build nodejs binding
include (UseSWIG)
find_package(SWIG 4.2 COMPONENTS javascript REQUIRED)
file(GLOB NODEJS_INTERFACE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/bin/nodejs/*.i)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/bin/nodejs/jami_wrapper.cpp
COMMAND ${SWIG_EXECUTABLE} -v -c++ -javascript -node -o jami_wrapper.cpp nodejs_interface.i
DEPENDS
${NODEJS_INTERFACE_FILES}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin/nodejs
)
# Generate binding.gyp
# We need to pass the link flags to node-gyp
set(_gyp_flags "")
get_target_property(_linked_libs ${PROJECT_NAME} LINK_LIBRARIES)
foreach(LIB IN LISTS _linked_libs)
if ("${LIB}" MATCHES "^PkgConfig::")
string(REPLACE "PkgConfig::" "" PKG_NAME ${LIB})
string(APPEND _gyp_flags " ${${PKG_NAME}_LDFLAGS}")
elseif ("${LIB}" MATCHES ".so$")
get_filename_component(LIB_DIRECTORY ${LIB} DIRECTORY)
get_filename_component(LIB_NAME_WE ${LIB} NAME_WE)
string(REPLACE "lib" "" LIB_NAME_WE ${LIB_NAME_WE})
string(APPEND _gyp_flags " -L${LIB_DIRECTORY} -l${LIB_NAME_WE}")
elseif (TARGET ${LIB})
# TODO generate cmake targets automatically
#string(APPEND _gyp_flags " $<TARGET_FILE:${LIB}>")
else()
string(APPEND _gyp_flags " -l${LIB}")
endif()
endforeach()
list(REVERSE _gyp_flags)
list(REMOVE_DUPLICATES _gyp_flags)
list(REVERSE _gyp_flags)
foreach(item ${_gyp_flags})
if (NOT "${QUOTED_JSON_LIST}" STREQUAL "")
set(QUOTED_JSON_LIST "${QUOTED_JSON_LIST},")
endif()
set(QUOTED_JSON_LIST "${QUOTED_JSON_LIST}\"${item}\"")
endforeach()
string(REPLACE ";" "," _gyp_flags_str ${QUOTED_JSON_LIST})
set(JAMI_LINK_LIBRARIES ${_gyp_flags_str})
set(JAMI_LINK_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR})
configure_file(
${CMAKE_SOURCE_DIR}/bin/nodejs/binding.gyp.in
${CMAKE_SOURCE_DIR}/bin/nodejs/binding.gyp
)
# Build nodejs binding
add_custom_target(jamid
ALL
COMMAND node-gyp rebuild --target=v18.19.1 --arch=x64
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/bin/nodejs/binding.gyp
${CMAKE_CURRENT_SOURCE_DIR}/bin/nodejs/callback.h
${CMAKE_CURRENT_SOURCE_DIR}/bin/nodejs/jami_wrapper.cpp
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin/nodejs
)
add_dependencies(jamid ${PROJECT_NAME})
endif()
if (JAMI_JNI)
# Build jni binding
add_library(${PROJECT_NAME}-jni SHARED ${CMAKE_CURRENT_SOURCE_DIR}/bin/jni/jami_wrapper.cpp)
target_link_directories(${PROJECT_NAME}-jni PRIVATE ${CONTRIB_PATH}/lib)
target_link_libraries(${PROJECT_NAME}-jni ${PROJECT_NAME} android log)
target_compile_options(${PROJECT_NAME}-jni PRIVATE
-fvisibility=hidden
-Wall -Wextra
-Wnon-virtual-dtor
-Wno-deprecated
-Wno-deprecated-declarations
-Wno-unknown-pragmas
-Wno-unused-function
-Wno-unused-parameter
)
target_link_options(${PROJECT_NAME}-jni PRIVATE
-Wl,-Bsymbolic
-Wall -Wextra
)
endif()
if (JAMI_DBUS)
find_program(DBusXml2Cpp sdbus-c++-xml2cpp REQUIRED)
pkg_search_module (DBusCpp REQUIRED IMPORTED_TARGET sdbus-c++)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/net.jami.daemon.service.in
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/cx.ring.Ring.service
@ONLY)
set(DBUS_XML_FILES
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/cx.ring.Ring.CallManager.xml
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/cx.ring.Ring.ConfigurationManager.xml
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/cx.ring.Ring.Instance.xml
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/cx.ring.Ring.PresenceManager.xml
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/cx.ring.Ring.VideoManager.xml
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/cx.ring.Ring.PluginManagerInterface.xml
)
set(DBUS_ADAPTOR_FILES
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/dbuscallmanager.adaptor.h
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/dbusconfigurationmanager.adaptor.h
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/dbusinstance.adaptor.h
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/dbuspresencemanager.adaptor.h
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/dbusvideomanager.adaptor.h
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/dbuspluginmanagerinterface.adaptor.h
)
set(DBUS_FILES
${CMAKE_CURRENT_SOURCE_DIR}/bin/dbus/main.cpp
)
# XML adaptors
foreach(DBUS_XML_FILE ${DBUS_XML_FILES})
list(FIND DBUS_XML_FILES ${DBUS_XML_FILE} DBUS_XML_FILE_INDEX)
list(GET DBUS_ADAPTOR_FILES ${DBUS_XML_FILE_INDEX} DBUS_ADAPTOR_FILE)
add_custom_command(
OUTPUT ${DBUS_ADAPTOR_FILE}
COMMAND ${DBusXml2Cpp} ${DBUS_XML_FILE} --adaptor=${DBUS_ADAPTOR_FILE}
DEPENDS ${DBUS_XML_FILE}
)
endforeach()
# Jamid
add_executable(jamid
${DBUS_FILES}
${DBUS_ADAPTOR_FILES}
)
target_link_libraries(jamid ${PROJECT_NAME} PkgConfig::DBusCpp)
install (TARGETS jamid DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})
endif()
if (BUILD_TESTING)
pkg_search_module(Cppunit REQUIRED IMPORTED_TARGET cppunit)
file(COPY test/unitTest/actors DESTINATION ${CMAKE_BINARY_DIR})
add_library(ut_library STATIC test/unitTest/common.cpp)
target_link_libraries(ut_library
PUBLIC
${PROJECT_NAME}
${CMAKE_THREAD_LIBS_INIT}
PkgConfig::Cppunit
PkgConfig::opendht
PkgConfig::pjproject
PkgConfig::git2
PkgConfig::archive
PkgConfig::gnutls
PkgConfig::avformat
PkgConfig::avdevice
PkgConfig::avfilter
PkgConfig::avcodec
PkgConfig::swresample
PkgConfig::swscale
PkgConfig::jsoncpp
PkgConfig::fmt
PkgConfig::secp256k1
)
if (TARGET yaml-cpp)
target_link_libraries(ut_library PRIVATE yaml-cpp)
else()
target_link_libraries(ut_library PRIVATE yaml-cpp::yaml-cpp)
endif()
target_include_directories(ut_library PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/test;"
"${CMAKE_CURRENT_SOURCE_DIR}/test/unitTest;"
)
target_compile_options(ut_library PUBLIC
-fvisibility=hidden
-Wall -Wextra
-Wnon-virtual-dtor
-Wno-deprecated
-Wno-deprecated-declarations
-Wno-unknown-pragmas
)
target_compile_definitions(ut_library PUBLIC
JAMI_DATADIR="${JAMI_DATADIR}"
PJ_AUTOCONF=1
HAVE_RINGNS=1
ASIO_STANDALONE
MSGPACK_NO_BOOST
DEBUG
)
if (JAMI_PLUGIN)
target_compile_definitions(ut_library PUBLIC ENABLE_PLUGIN)
endif()
if (JAMI_VIDEO)
target_compile_definitions(ut_library PUBLIC ENABLE_VIDEO)
endif()
add_executable(ut_bootstrap test/unitTest/swarm/bootstrap.cpp)
target_link_libraries(ut_bootstrap ut_library)
add_test(NAME bootstrap COMMAND ut_bootstrap)
add_executable(ut_conversationRepository test/unitTest/conversationRepository/conversationRepository.cpp)
target_link_libraries(ut_conversationRepository ut_library)
add_test(NAME conversationRepository COMMAND ut_conversationRepository)
add_executable(ut_revoke test/unitTest/revoke/revoke.cpp)
target_link_libraries(ut_revoke ut_library)
add_test(NAME revoke COMMAND ut_revoke)
add_executable(ut_syncHistory test/unitTest/syncHistory/syncHistory.cpp)
target_link_libraries(ut_syncHistory ut_library)
add_test(NAME syncHistory COMMAND ut_syncHistory)
add_executable(ut_base64 test/unitTest/base64/base64.cpp)
target_link_libraries(ut_base64 ut_library)
add_test(NAME base64 COMMAND ut_base64)
if (JAMI_VIDEO)
add_executable(ut_ice_sdp_parser test/unitTest/ice/ice_sdp_parser.cpp)
target_link_libraries(ut_ice_sdp_parser ut_library)
add_test(NAME ice_sdp_parser COMMAND ut_ice_sdp_parser)
add_executable(ut_conference test/unitTest/call/conference.cpp)
target_link_libraries(ut_conference ut_library)
add_test(NAME conference COMMAND ut_conference)
add_executable(ut_test_media_frame test/unitTest/media/test_media_frame.cpp)
target_link_libraries(ut_test_media_frame ut_library)
add_test(NAME test_media_frame COMMAND ut_test_media_frame)
add_executable(ut_test_video_scaler test/unitTest/media/video/test_video_scaler.cpp)
target_link_libraries(ut_test_video_scaler ut_library)
add_test(NAME test_video_scaler COMMAND ut_test_video_scaler)
add_executable(ut_testVideo_input test/unitTest/media/video/testVideo_input.cpp)
target_link_libraries(ut_testVideo_input ut_library)
add_test(NAME testVideo_input COMMAND ut_testVideo_input)
add_executable(ut_test_media_filter test/unitTest/media/test_media_filter.cpp)
target_link_libraries(ut_test_media_filter ut_library)
add_test(NAME test_media_filter COMMAND ut_test_media_filter)
add_executable(ut_test_media_player test/unitTest/media/test_media_player.cpp)
target_link_libraries(ut_test_media_player ut_library)
add_test(NAME test_media_player COMMAND ut_test_media_player)
endif()
add_executable(ut_scheduler test/unitTest/scheduler.cpp)
target_link_libraries(ut_scheduler ut_library)
add_test(NAME scheduler COMMAND ut_scheduler)
add_executable(ut_testAccount_factory test/unitTest/account_factory/testAccount_factory.cpp)
target_link_libraries(ut_testAccount_factory ut_library)
add_test(NAME testAccount_factory COMMAND ut_testAccount_factory)
add_executable(ut_call test/unitTest/call/call.cpp)
target_link_libraries(ut_call ut_library)
add_test(NAME call COMMAND ut_call)
add_executable(ut_recorder test/unitTest/call/recorder.cpp)
target_link_libraries(ut_recorder ut_library)
add_test(NAME recorder COMMAND ut_recorder)
add_executable(ut_migration test/unitTest/account_archive/migration.cpp)
target_link_libraries(ut_migration ut_library)
add_test(NAME migration COMMAND ut_migration)
add_executable(ut_accountArchive test/unitTest/account_archive/account_archive.cpp)
target_link_libraries(ut_accountArchive ut_library)
add_test(NAME accountArchive COMMAND ut_accountArchive)
add_executable(ut_mapUtils test/unitTest/map_utils/testMap_utils.cpp)
target_link_libraries(ut_mapUtils ut_library)
add_test(NAME mapUtils COMMAND ut_mapUtils)
add_executable(ut_sipBasicCalls test/unitTest/sip_account/sip_basic_calls.cpp)
target_link_libraries(ut_sipBasicCalls ut_library)
add_test(NAME sipBasicCalls COMMAND ut_sipBasicCalls)
add_executable(ut_sipSrtp test/unitTest/sip_account/sip_srtp.cpp)
target_link_libraries(ut_sipSrtp ut_library)
add_test(NAME sipSrtp COMMAND ut_sipSrtp)
add_executable(ut_fileTransfer test/unitTest/fileTransfer/fileTransfer.cpp)
target_link_libraries(ut_fileTransfer ut_library)
add_test(NAME fileTransfer COMMAND ut_fileTransfer)
add_executable(ut_fileutils test/unitTest/fileutils/testFileutils.cpp)
target_link_libraries(ut_fileutils ut_library)
add_test(NAME fileutils COMMAND ut_fileutils)
add_executable(ut_holdResume test/unitTest/media_negotiation/hold_resume.cpp)
target_link_libraries(ut_holdResume ut_library)
add_test(NAME holdResume COMMAND ut_holdResume)
add_executable(ut_autoAnswer test/unitTest/media_negotiation/auto_answer.cpp)
target_link_libraries(ut_autoAnswer ut_library)
add_test(NAME autoAnswer COMMAND ut_autoAnswer)
add_executable(ut_mediaNegotiation test/unitTest/media_negotiation/media_negotiation.cpp)
target_link_libraries(ut_mediaNegotiation ut_library)
add_test(NAME mediaNegotiation COMMAND ut_mediaNegotiation)
add_executable(ut_stringUtils test/unitTest/string_utils/testString_utils.cpp)
target_link_libraries(ut_stringUtils ut_library)
add_test(NAME stringUtils COMMAND ut_stringUtils)
add_executable(ut_utf8_utils test/unitTest/utf8_utils/testUtf8_utils.cpp)
target_link_libraries(ut_utf8_utils ut_library)
add_test(NAME utf8_utils COMMAND ut_utf8_utils)
add_executable(ut_presence test/unitTest/presence/presence.cpp)
target_link_libraries(ut_presence ut_library)
add_test(NAME presence COMMAND ut_presence)
add_executable(ut_typers test/unitTest/conversation/typers.cpp test/unitTest/conversation/conversationcommon.cpp)
target_link_libraries(ut_typers ut_library)
add_test(NAME typers COMMAND ut_typers)
add_executable(ut_conversationCall test/unitTest/conversation/call.cpp test/unitTest/conversation/conversationcommon.cpp)
target_link_libraries(ut_conversationCall ut_library)
add_test(NAME conversationCall COMMAND ut_conversationCall)
add_executable(ut_conversation test/unitTest/conversation/conversation.cpp test/unitTest/conversation/conversationcommon.cpp)
target_link_libraries(ut_conversation ut_library)
add_test(NAME conversation COMMAND ut_conversation)
add_executable(ut_conversationRequest test/unitTest/conversation/conversationRequest.cpp test/unitTest/conversation/conversationcommon.cpp)
target_link_libraries(ut_conversationRequest ut_library)
add_test(NAME conversationRequest COMMAND ut_conversationRequest)
add_executable(ut_conversationMembersEvent test/unitTest/conversation/conversationMembersEvent.cpp test/unitTest/conversation/conversationcommon.cpp)
target_link_libraries(ut_conversationMembersEvent ut_library)
add_test(NAME conversationMembersEvent COMMAND ut_conversationMembersEvent)
add_executable(ut_conversationFetchSent test/unitTest/conversation/conversationFetchSent.cpp test/unitTest/conversation/conversationcommon.cpp)
target_link_libraries(ut_conversationFetchSent ut_library)
add_test(NAME conversationFetchSent COMMAND ut_conversationFetchSent)
add_executable(ut_test_media_encoder test/unitTest/media/test_media_encoder.cpp)
target_link_libraries(ut_test_media_encoder ut_library)
add_test(NAME test_media_encoder COMMAND ut_test_media_encoder)
add_executable(ut_test_media_decoder test/unitTest/media/test_media_decoder.cpp)
target_link_libraries(ut_test_media_decoder ut_library)
add_test(NAME test_media_decoder COMMAND ut_test_media_decoder)
add_executable(ut_test_resampler test/unitTest/media/audio/test_resampler.cpp)
target_link_libraries(ut_test_resampler ut_library)
add_test(NAME test_resampler COMMAND ut_test_resampler)
add_executable(ut_test_audio_frame_resizer test/unitTest/media/audio/test_audio_frame_resizer.cpp)
target_link_libraries(ut_test_audio_frame_resizer ut_library)
add_test(NAME test_audio_frame_resizer COMMAND ut_test_audio_frame_resizer)
if (JAMI_PLUGIN)
add_executable(ut_plugins test/unitTest/plugins/plugins.cpp)
target_link_libraries(ut_plugins ut_library)
add_test(NAME plugins COMMAND ut_plugins)
endif()
endif()
endif()