-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
755 lines (600 loc) · 27.8 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
PROJECT(FLITr)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3)
IF(UNIX AND NOT WIN32 AND NOT APPLE)
IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib64/" AND CMAKE_SIZEOF_VOID_P EQUAL 8 )
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
ENDIF()
ENDIF(UNIX AND NOT WIN32 AND NOT APPLE)
# Set a default build type for single-configuration
# CMake generators if no build type is set.
IF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo."
FORCE)
ENDIF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
# We have some custom .cmake scripts not in the official distribution.
SET(CMAKE_MODULE_PATH "${FLITr_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
# append a "d" for debug builds
# This gets inherited by all the libraries, but not by the executables
SET(CMAKE_DEBUG_POSTFIX "d")
# compiler flags
IF(MSVC)
add_definitions(-DWIN32)
add_definitions(-D__STDC_LIMIT_MACROS)
# VS automatically defines NDEBUG in Release builds
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D _CRT_SECURE_NO_DEPRECATE /D _WIN32_WINNT=0x0501")
ELSEIF(APPLE)
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures" FORCE)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_C_LANGUAGE_STANDARD "c11")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_C_LIBRARY "libc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++ -g -march=native -mtune=native -Wall")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -g -Wall")
ELSE()
#native is only supported by recent g++ compilers
#SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -march=native -mtune=native -DNDEBUG")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -march=native -mtune=native -ffast-math -Wall -std=c++11")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG -march=native -mtune=native -ffast-math -Wall -std=c++11")
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -std=c++11")
ENDIF()
# set up FLITR_3RDPARTY_ROOT. Should be used when all dependencies are in one folder. Some Windows users prefer this.
SET(FLITR_3RDPARTY_ROOT "" CACHE PATH "Additional directory where the 3rd party dependencies can be found.")
SET(CMAKE_PREFIX_PATH ${FLITR_3RDPARTY_ROOT})
MARK_AS_ADVANCED(FORCE ${CMAKE_PREFIX_PATH})
# === find OpenCL ===
OPTION(FLITR_USE_OPENCL "Compile the code with FLITR_USE_OPENCL define and OpenCL includes and libs." OFF)
IF(FLITR_USE_OPENCL)
FIND_PACKAGE(OpenCL REQUIRED)
SET(OpenCL_LIBPATH "/usr/lib/x86_64-linux-gnu")
IF(OPENCL_FOUND)
INCLUDE_DIRECTORIES(${OpenCL_INCLUDE_DIRS})
LINK_DIRECTORIES(${OpenCL_LIBRARY})
ADD_DEFINITIONS(-DFLITR_USE_OPENCL)
MESSAGE("OpenCL include dir: ${OpenCL_INCLUDE_DIRS}")
MESSAGE("OpenCL library dir: ${OpenCL_LIBRARY}")
MESSAGE("OpenCL libraries: ${OpenCL_LIBRARIES}")
ENDIF(OPENCL_FOUND)
ENDIF(FLITR_USE_OPENCL)
# ==================
# === find OpenCV ===
OPTION(FLITR_USE_OPENCV "Compile code that uses the OpenCV library." OFF)
IF(FLITR_USE_OPENCV)
SET(OpenCV_DIR "/usr/share/OpenCV")
find_package(OpenCV 3.0.0 REQUIRED COMPONENTS core highgui imgproc) #
LINK_DIRECTORIES(/usr/local/lib)
IF(OpenCV_FOUND)
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
LINK_DIRECTORIES(${OpenCV_LIBRARY})
ADD_DEFINITIONS(-DFLITR_USE_OPENCV)
ADD_DEFINITIONS(-DCOMPILE_WITH_OPENCV)
MESSAGE("OpenCV include dir: ${OpenCV_INCLUDE_DIRS}")
MESSAGE("OpenCV libraries: ${OpenCV_LIBRARIES}")
ENDIF(OpenCV_FOUND)
ENDIF(FLITR_USE_OPENCV)
# === find Caffe ===
OPTION(FLITR_USE_CAFFE "Compile code that uses the Caffe library" OFF)
IF(FLITR_USE_CAFFE)
#Assign <Caffe_DIR> to a directory containing one of the above files, [CaffeConfig.cmake] or [caffe-config.cmake].
#SET(Caffe_DIR "/home/dumisani/dev/caffe/build/install/share/Caffe") #CNN Classifier and RCNN
SET(Caffe_DIR "/home/dumisani/dev/caffe_ssd/build/install/share/Caffe") #SSD CNNs
find_package(Caffe)
LINK_DIRECTORIES(${Caffe_LIBRARIES})
include_directories(${Caffe_INCLUDE_DIRS})
add_definitions(${Caffe_DEFINITIONS}) # ex. -DCPU_ONLY
MESSAGE("${CAFFE_FOUND}")
MESSAGE("Caffe_LIBRARIES: ${Caffe_LIBRARIES}")
MESSAGE("Caffe_INCLUDE_DIRS : ${Caffe_INCLUDE_DIRS}")
IF(Caffe_FOUND)
message("Caffe found!!")
SET(Flitr_Compile_CNN 1)
ELSE()
message("Caffe not found!!")
ENDIF(Caffe_FOUND)
#=========================
#Remember to link libaries on both the main CMakeFile, and also the app's CMakeFile
LINK_LIBRARIES(avformat cuda ${Caffe_LIBRARIES} ${opencv} opencv_core opencv_imgproc opencv_highgui opencv_dnn)
ADD_DEFINITIONS(-DFLITR_USE_CAFFE)
ENDIF(FLITR_USE_CAFFE)
# ==================
# === find Boost ===
#BOOST no longer needed for FLITr.
#SET(Boost_USE_STATIC_LIBS OFF CACHE BOOL "Link boost in statically")
#SET(Boost_NO_SYSTEM_PATHS OFF CACHE BOOL "Search only BOOST_ROOT.")
#SET(BOOST_ROOT "" CACHE PATH "Path to search for custom boost library. Empty to use default paths.")
#MARK_AS_ADVANCED(FORCE ${CMAKE_PREFIX_PATH})
#SET(Boost_USE_STATIC_LIBS OFF)
#SET(Boost_USE_MULTITHREADED ON)
#SET(Boost_ADDITIONAL_VERSIONS "1.49")
#FIND_PACKAGE(Boost 1.46 REQUIRED COMPONENTS filesystem system)
#INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
#LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
#IF (NOT Boost_FOUND)
# MESSAGE(FATAL_ERROR "Cannot find boost, set BOOST_ROOT.")
#ENDIF(NOT Boost_FOUND)
# ==================
#=== Find LIBTIFF ===#
OPTION(FLITR_USE_LIBTIFF "Include LibTiff and LibTiffProducer." OFF)
IF(FLITR_USE_LIBTIFF)
#Note: Assuming for the moment that libTiff, if present, is installed amongst the default system includes and libs.
ENDIF(FLITR_USE_LIBTIFF)
#====================#
OPTION(FLITR_USE_OSG "Use OpenSceneGraph." OFF)
IF(FLITR_USE_OSG)
# === Find OSG ===#
SET(OpenSceneGraph_MARK_AS_ADVANCED ON)
FIND_PACKAGE(OpenSceneGraph REQUIRED osgViewer osgUtil osgTerrain osgGA osgFX osgDB osgText osgSim osgParticle)
INCLUDE_DIRECTORIES(${OPENSCENEGRAPH_INCLUDE_DIR})
LINK_DIRECTORIES(${OPENSCENEGRAPH_INCLUDE_DIRS}/../bin ${OPENSCENEGRAPH_LIBRARY_DIRS})
#=================#
OPTION(FLITR_WITH_OSGCUDA "Use osgCuda textures in the OSG consumer. Assume osgCuda and CUDA are installed." OFF)
IF(FLITR_WITH_OSGCUDA)
# uses FindCUDA from CMake
FIND_PACKAGE(CUDA 4.0 REQUIRED)
LINK_DIRECTORIES(/usr/local/cuda/lib64)
INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES}/C/common/inc)
ENDIF()
ADD_DEFINITIONS(-DFLITR_USE_OSG)
ENDIF(FLITR_USE_OSG)
# === find FFmpeg ===
SET(FFmpeg_ROOT "" CACHE PATH "Path to search for custom FFmpeg library. Empty to use default paths.")
SET(FFmpeg_NO_SYSTEM_PATHS OFF CACHE BOOL "Search only FFmpeg_ROOT.")
FIND_PACKAGE(FFmpeg)
IF(FFmpeg_FOUND)
INCLUDE_DIRECTORIES(${FFmpeg_INCLUDE_DIRS})
ENDIF()
#MESSAGE(" FFmpeg_FOUND ${FFmpeg_FOUND}")
IF(NOT FFmpeg_FOUND)
MESSAGE(FATAL_ERROR "Cannot find FFmpeg, set FFmpeg_ROOT.")
ENDIF(NOT FFmpeg_FOUND)
# ===================
OPTION(FLITR_USE_OPENMP "Enable the compiler's OpenMP directives if available." ON)
IF(FLITR_USE_OPENMP)
# === find OpenMP ===
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
ADD_DEFINITIONS(-DUSE_OPENMP)
endif()
# ===================
ENDIF(FLITR_USE_OPENMP)
#default include and lib directories.
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR};${CMAKE_SOURCE_DIR}/include;/usr/local/include;/opt/local/include;${AVFORMAT_PATH};${SWSCALE_PATH};${FLITR_3RDPARTY_ROOT}/include/)
LINK_DIRECTORIES(${CMAKE_SOURCE_DIR} /usr/local/lib /opt/local/lib ${FLITR_3RDPARTY_ROOT}/lib ${FLITR_3RDPARTY_ROOT}/bin)
OPTION(FLITR_PROFILE "Enable profiling code." ON)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/flitr/flitr_config.h.in ${CMAKE_SOURCE_DIR}/include/flitr/flitr_config.h)
# to get e.g. UINT64_C or UINT64_MAX from stdint.h
ADD_DEFINITIONS(-D__STDC_CONSTANT_MACROS)
SET(LIB_SOURCES
src/flitr/multi_raw_video_file_consumer.cpp
src/flitr/raw_video_file_writer.cpp
src/flitr/raw_video_file_reader.cpp
src/flitr/raw_video_file_producer.cpp
src/flitr/ffmpeg_producer.cpp
#src/flitr/ffserver_producer.cpp
src/flitr/test_pattern_producer.cpp
src/flitr/smulti_ffmpeg_producer.cpp
src/flitr/smulti_raw_video_file_producer.cpp
src/flitr/ffmpeg_reader.cpp
src/flitr/ffmpeg_utils.cpp
src/flitr/ffmpeg_writer.cpp
src/flitr/flitr_thread.cpp
src/flitr/high_resolution_time.cpp
src/flitr/image_consumer.cpp
src/flitr/image_processor.cpp
src/flitr/image_processor_utils.cpp
src/flitr/log_message.cpp
src/flitr/metadata_writer.cpp
src/flitr/metadata_reader.cpp
src/flitr/multi_example_consumer.cpp
src/flitr/multi_image_buffer_consumer.cpp
src/flitr/multi_cpuhistogram_consumer.cpp
src/flitr/multi_ffmpeg_consumer.cpp
#src/flitr/multi_ffserver_consumer.cpp
src/flitr/image_diff_and_scale.cpp
src/flitr/image_multiplexer.cpp
src/flitr/graph_manager.cpp
src/flitr/modules/xml_config/tinyxml.cpp
src/flitr/modules/xml_config/tinyxmlerror.cpp
src/flitr/modules/xml_config/tinyxmlparser.cpp
src/flitr/modules/xml_config/xml_config.cpp
src/flitr/shared_image_buffer.cpp
src/flitr/modules/target_injector/target_injector.cpp
src/flitr/modules/de_motion_blur/de_motion_blur.cpp
src/flitr/modules/flitr_image_processors/transform2D/fip_transform2D.cpp
src/flitr/modules/flitr_image_processors/flip/fip_flip.cpp
src/flitr/modules/flitr_image_processors/rotate/fip_rotate.cpp
src/flitr/modules/flitr_image_processors/dpt/fip_dpt.cpp
src/flitr/modules/flitr_image_processors/crop/fip_crop.cpp
src/flitr/modules/flitr_image_processors/msr/fip_msr.cpp
src/flitr/modules/flitr_image_processors/tonemap/fip_tonemap.cpp
src/flitr/modules/flitr_image_processors/cnvrt_to_float/fip_cnvrt_to_y_f32.cpp
src/flitr/modules/flitr_image_processors/cnvrt_to_8bit/fip_cnvrt_to_y_8.cpp
src/flitr/modules/flitr_image_processors/cnvrt_to_float/fip_cnvrt_to_rgb_f32.cpp
src/flitr/modules/flitr_image_processors/cnvrt_to_8bit/fip_cnvrt_to_rgb_8.cpp
src/flitr/modules/flitr_image_processors/gradient_image/fip_gradient_image.cpp
src/flitr/modules/flitr_image_processors/average_image/fip_average_image.cpp
src/flitr/modules/flitr_image_processors/average_image/fip_average_image_iir.cpp
src/flitr/modules/flitr_image_processors/beat_image/fip_beat_image.cpp
src/flitr/modules/flitr_image_processors/deinterlace/fip_deinterlace.cpp
src/flitr/modules/flitr_image_processors/photometric_equalise/fip_photometric_equalise.cpp
src/flitr/modules/flitr_image_processors/gaussian_downsample/fip_gaussian_downsample.cpp
src/flitr/modules/flitr_image_processors/gaussian_filter/fip_gaussian_filter.cpp
src/flitr/modules/flitr_image_processors/adaptive_threshold/fip_adaptive_threshold.cpp
src/flitr/modules/flitr_image_processors/morphological_filter/fip_morphological_filter.cpp
src/flitr/modules/flitr_image_processors/unsharp_mask/fip_unsharp_mask.cpp
src/flitr/modules/flitr_image_processors/dewarp/fip_lk_dewarp.cpp
src/flitr/modules/flitr_image_processors/stabilise/fip_lk_stabilise.cpp
src/flitr/modules/flitr_image_processors/motion_detect/fip_motion_detect.cpp
src/flitr/modules/flitr_image_processors/simulate/fip_camera_shake.cpp
src/flitr/modules/flitr_image_processors/simulate/fip_test_pattern.cpp
#find include/ | grep .h | grep -v .svn | sort
include/flitr/raw_video_file_utils.h
include/flitr/multi_raw_video_file_consumer.h
include/flitr/raw_video_file_writer.h
include/flitr/raw_video_file_reader.h
include/flitr/raw_video_file_producer.h
include/flitr/ffmpeg_producer.h
#include/flitr/ffserver_producer.h
include/flitr/test_pattern_producer.h
include/flitr/smulti_ffmpeg_producer.h
include/flitr/smulti_raw_video_file_producer.h
include/flitr/ffmpeg_reader.h
include/flitr/ffmpeg_utils.h
include/flitr/ffmpeg_writer.h
include/flitr/flitr_export.h
include/flitr/flitr_stdint.h
include/flitr/flitr_thread.h
include/flitr/graph_manager.h
include/flitr/high_resolution_time.h
include/flitr/image_consumer.h
include/flitr/image_processor.h
include/flitr/image_processor_utils.h
include/flitr/image_format.h
include/flitr/image.h
include/flitr/image_metadata.h
include/flitr/image_producer.h
include/flitr/log_message.h
include/flitr/manipulator_utils.h
include/flitr/metadata_writer.h
include/flitr/metadata_reader.h
include/flitr/multi_example_consumer.h
include/flitr/multi_image_buffer_consumer.h
include/flitr/multi_cpuhistogram_consumer.h
include/flitr/multi_ffmpeg_consumer.h
#include/flitr/multi_ffserver_consumer.h
include/flitr/image_diff_and_scale.h
include/flitr/image_multiplexer.h
include/flitr/modules/xml_config/tinyxml.h
include/flitr/modules/xml_config/xml_config.h
include/flitr/modules/parameters/parameters.h
include/flitr/shared_image_buffer.h
include/flitr/stats_collector.h
# Video
include/flitr/video_producer.h
# include/flitr/video_linux_v4l.h
include/flitr/video_win32_directshow.h
include/flitr/modules/target_injector/target_injector.h
include/flitr/modules/de_motion_blur/de_motion_blur.h
include/flitr/modules/flitr_image_processors/transform2D/fip_transform2D.h
include/flitr/modules/flitr_image_processors/flip/fip_flip.h
include/flitr/modules/flitr_image_processors/rotate/fip_rotate.h
include/flitr/modules/flitr_image_processors/dpt/fip_dpt.h
include/flitr/modules/flitr_image_processors/cnvrt_to_float/fip_cnvrt_to_y_f32.h
include/flitr/modules/flitr_image_processors/cnvrt_to_8bit/fip_cnvrt_to_y_8.h
include/flitr/modules/flitr_image_processors/cnvrt_to_float/fip_cnvrt_to_rgb_f32.h
include/flitr/modules/flitr_image_processors/cnvrt_to_8bit/fip_cnvrt_to_rgb_8.h
include/flitr/modules/flitr_image_processors/tonemap/fip_tonemap.h
include/flitr/modules/flitr_image_processors/msr/fip_msr.h
include/flitr/modules/flitr_image_processors/crop/fip_crop.h
include/flitr/modules/flitr_image_processors/gradient_image/fip_gradient_image.h
include/flitr/modules/flitr_image_processors/average_image/fip_average_image.h
include/flitr/modules/flitr_image_processors/average_image/fip_average_image_iir.h
include/flitr/modules/flitr_image_processors/beat_image/fip_beat_image.h
include/flitr/modules/flitr_image_processors/deinterlace/fip_deinterlace.h
include/flitr/modules/flitr_image_processors/photometric_equalise/fip_photometric_equalise.h
include/flitr/modules/flitr_image_processors/gaussian_downsample/fip_gaussian_downsample.h
include/flitr/modules/flitr_image_processors/gaussian_filter/fip_gaussian_filter.h
include/flitr/modules/flitr_image_processors/adaptive_threshold/fip_adaptive_threshold.h
include/flitr/modules/flitr_image_processors/morphological_filter/fip_morphological_filter.h
include/flitr/modules/flitr_image_processors/unsharp_mask/fip_unsharp_mask.h
include/flitr/modules/flitr_image_processors/dewarp/fip_lk_dewarp.h
include/flitr/modules/flitr_image_processors/stabilise/fip_lk_stabilise.h
include/flitr/modules/flitr_image_processors/motion_detect/fip_motion_detect.h
include/flitr/modules/flitr_image_processors/simulate/fip_camera_shake.h
include/flitr/modules/flitr_image_processors/simulate/fip_test_pattern.h
)
IF(FLITR_USE_OSG)
SET(LIB_SOURCES ${LIB_SOURCES}
src/flitr/ortho_texture_manipulator.cpp
include/flitr/ortho_texture_manipulator.h
src/flitr/multi_osg_consumer.cpp
include/flitr/multi_osg_consumer.h
src/flitr/multi_ffmpeg_producer.cpp
include/flitr/multi_ffmpeg_producer.h
src/flitr/osg_image_producer.cpp
include/flitr/osg_image_producer.h
src/flitr/hud.cpp
src/flitr/manipulator_utils.cpp
src/flitr/modules/geometry_overlays/crosshair_overlay.cpp
src/flitr/modules/geometry_overlays/geometry_overlay.cpp
src/flitr/modules/geometry_overlays/points_overlay.cpp
src/flitr/modules/geometry_overlays/quad_overlay.cpp
src/flitr/modules/geometry_overlays/triangle_overlay.cpp
src/flitr/modules/geometry_overlays/circle_overlay.cpp
src/flitr/modules/geometry_overlays/plot2D_overlay.cpp
src/flitr/modules/geometry_overlays/text_label_overlay.cpp
src/flitr/modules/geometry_overlays/arrow_overlay.cpp
src/flitr/modules/geometry_overlays/tape_overlay.cpp
src/flitr/modules/geometry_overlays/lines_overlay.cpp
src/flitr/textured_quad.cpp
src/flitr/glsl_image_processor.cpp
src/flitr/modules/glsl_shader_passes/glsl_masked_gain_pass.cpp
src/flitr/modules/glsl_shader_passes/glsl_shader_pass.cpp
src/flitr/modules/glsl_shader_passes/glsl_gamma_pass.cpp
src/flitr/modules/glsl_shader_passes/glsl_sigmoid_pass.cpp
src/flitr/modules/glsl_shader_passes/glsl_copy_pass.cpp
src/flitr/modules/glsl_shader_passes/glsl_crop_pass.cpp
src/flitr/modules/glsl_shader_passes/glsl_translate_pass.cpp
src/flitr/modules/glsl_shader_passes/glsl_downsample_pass.cpp
src/flitr/modules/glsl_shader_passes/glsl_downsample_x_pass.cpp
src/flitr/modules/glsl_shader_passes/glsl_downsample_y_pass.cpp
src/flitr/modules/glsl_shader_passes/homography_shader_pass.cpp
src/flitr/modules/glsl_shader_passes/glsl_gaussian_filter_x_pass.cpp
src/flitr/modules/glsl_shader_passes/glsl_gaussian_filter_y_pass.cpp
src/flitr/modules/glsl_shader_passes/glsl_keep_history_pass.cpp
src/flitr/modules/glsl_shader_passes/glsl_threshold_pass.cpp
src/flitr/modules/glsl_shader_passes/glsl_grayscale_pass.cpp
src/flitr/modules/lucas_kanade/ImageMultiPyramid.cpp
src/flitr/modules/lucas_kanade/ImageStabiliserMultiLK.cpp
#src/flitr/modules/lucas_kanade/ImageBiPyramid.cpp
#src/flitr/modules/lucas_kanade/ImageStabiliserBiLK.cpp
include/flitr/hud.h
include/flitr/modules/geometry_overlays/crosshair_overlay.h
include/flitr/modules/geometry_overlays/geometry_overlay.h
include/flitr/modules/geometry_overlays/points_overlay.h
include/flitr/modules/geometry_overlays/quad_overlay.h
include/flitr/modules/geometry_overlays/triangle_overlay.h
include/flitr/modules/geometry_overlays/circle_overlay.h
include/flitr/modules/geometry_overlays/plot2D_overlay.h
include/flitr/modules/geometry_overlays/text_label_overlay.h
include/flitr/modules/geometry_overlays/arrow_overlay.h
include/flitr/modules/geometry_overlays/tape_overlay.h
include/flitr/modules/geometry_overlays/lines_overlay.h
include/flitr/textured_quad.h
include/flitr/glsl_image_processor.h
include/flitr/modules/glsl_shader_passes/glsl_masked_gain_pass.h
include/flitr/modules/glsl_shader_passes/glsl_shader_pass.h
include/flitr/modules/glsl_shader_passes/glsl_gamma_pass.h
include/flitr/modules/glsl_shader_passes/glsl_sigmoid_pass.h
include/flitr/modules/glsl_shader_passes/glsl_copy_pass.h
include/flitr/modules/glsl_shader_passes/glsl_crop_pass.h
include/flitr/modules/glsl_shader_passes/glsl_translate_pass.h
include/flitr/modules/glsl_shader_passes/glsl_downsample_pass.h
include/flitr/modules/glsl_shader_passes/glsl_downsample_x_pass.h
include/flitr/modules/glsl_shader_passes/glsl_downsample_y_pass.h
include/flitr/modules/glsl_shader_passes/homography_shader_pass.h
include/flitr/modules/glsl_shader_passes/glsl_gaussian_filter_x_pass.h
include/flitr/modules/glsl_shader_passes/glsl_gaussian_filter_y_pass.h
include/flitr/modules/glsl_shader_passes/glsl_keep_history_pass.h
include/flitr/modules/glsl_shader_passes/glsl_threshold_pass.h
include/flitr/modules/glsl_shader_passes/glsl_grayscale_pass.h
src/flitr/modules/cpu_shader_passes/cpu_shader_pass.cpp
src/flitr/modules/cpu_shader_passes/cpu_find_discreet_objects_pass.cpp
include/flitr/modules/cpu_shader_passes/cpu_shader_pass.h
include/flitr/modules/cpu_shader_passes/cpu_palette_remap_shader.h
include/flitr/modules/cpu_shader_passes/cpu_photometric_equalisation.h
include/flitr/modules/cpu_shader_passes/cpu_local_photometric_equalisation.h
include/flitr/modules/cpu_shader_passes/cpu_uniform_noise_shader.h
include/flitr/modules/cpu_shader_passes/cpu_find_discreet_objects_pass.h
include/flitr/modules/lucas_kanade/ImageMultiPyramid.h
include/flitr/modules/lucas_kanade/ImageStabiliserMultiLK.h
#include/flitr/modules/lucas_kanade/ImageBiPyramid.h
#include/flitr/modules/lucas_kanade/ImageStabiliserBiLK.h
)
#=== Caffe CNN Classification
IF(Flitr_Compile_CNN)
MESSAGE("Convolutional Neural Networks examples will be compiled.\n")
ADD_SUBDIRECTORY(examples/classification)
SET(LIB_SOURCES
${LIB_SOURCES}
src/flitr/modules/flitr_image_processors/classification/fip_classification.cpp
include/flitr/modules/flitr_image_processors/classification/fip_classification.h
include/flitr/modules/flitr_image_processors/classification/caffe_cnn_functions.h
)
# ADD_SUBDIRECTORY(examples/classification_RCNN)
# SET(LIB_SOURCES
# ${LIB_SOURCES}
# src/flitr/modules/flitr_image_processors/classification_RCNN/fip_classification_RCNN.cpp
# include/flitr/modules/flitr_image_processors/classification_RCNN/fip_classification_RCNN.h
# include/flitr/modules/flitr_image_processors/classification_RCNN/caffe_rcnn_functions.h
# )
ADD_SUBDIRECTORY(examples/object_detection_CNN)
SET(LIB_SOURCES
${LIB_SOURCES}
src/flitr/modules/flitr_image_processors/object_detection_CNN/fip_object_detection_CNN.cpp
include/flitr/modules/flitr_image_processors/object_detection_CNN/fip_object_detection_CNN.h
src/flitr/modules/flitr_image_processors/object_detection_CNN/caffe_ssd_functions.cpp
include/flitr/modules/flitr_image_processors/object_detection_CNN/caffe_ssd_functions.h
)
ENDIF(Flitr_Compile_CNN)
#OpenCV example and helper functions
IF(FLITR_USE_OPENCV)
ADD_SUBDIRECTORY(examples/opencv_processor)
SET(LIB_SOURCES
${LIB_SOURCES}
src/flitr/modules/flitr_image_processors/opencv_processor/fip_opencv_processor.cpp
src/flitr/modules/opencv_helpers/opencv_processors.cpp
src/flitr/modules/opencv_helpers/opencv_helpers.cpp
include/flitr/modules/flitr_image_processors/opencv_processor/fip_opencv_processor.h
include/flitr/modules/opencv_helpers/opencv_processors.h
include/flitr/modules/opencv_helpers/opencv_helpers.h
)
ENDIF(FLITR_USE_OPENCV)
#Need to replace the _gl.. calls with the relevant osg calls before the below files will compile under OSX.
IF(NOT APPLE)
SET(LIB_SOURCES ${LIB_SOURCES}
src/flitr/multi_screen_capture_producer.cpp
src/flitr/screen_capture_producer.cpp
src/flitr/texture_capture_producer.cpp
include/flitr/multi_screen_capture_producer.h
include/flitr/screen_capture_producer.h
include/flitr/texture_capture_producer.h
)
ENDIF()
ENDIF()
IF(NOT WIN32)
SET(LIB_SOURCES ${LIB_SOURCES}
src/flitr/fifo_producer.cpp
include/flitr/fifo_producer.h
include/flitr/fifo_consumer.h
)
ENDIF()
IF(FLITR_USE_LIBTIFF)
SET(LIB_SOURCES ${LIB_SOURCES}
src/flitr/libtiff_producer.cpp
include/flitr/libtiff_producer.h
)
ENDIF(FLITR_USE_LIBTIFF)
# tinyxml
ADD_SUBDIRECTORY(src/flitr/tinyxml)
# Video
if(WIN32)
ADD_SUBDIRECTORY(src/flitr/video_win32_directshow)
add_definitions(-DTIXML_USE_STL)
endif(WIN32)
if(UNIX)
IF(NOT APPLE)
SET(LIB_SOURCES ${LIB_SOURCES}
src/flitr/v4l2_producer.cpp
include/flitr/v4l2_producer.h
)
ADD_SUBDIRECTORY(src/flitr/video_linux_v4l)
ENDIF()
endif(UNIX)
INCLUDE_DIRECTORIES(
${LIB_INCL_DIRS}
)
source_group("src" FILES ${LIB_SOURCES})
ADD_LIBRARY(flitr SHARED
${LIB_SOURCES}
)
IF(WIN32)
TARGET_LINK_LIBRARIES(flitr opengl32 OpenThreads ${OPENSCENEGRAPH_LIBRARIES} ${FFmpeg_LIBRARIES})
ELSEIF(APPLE)
TARGET_LINK_LIBRARIES(flitr ${OPENSCENEGRAPH_LIBRARIES} ${FFmpeg_LIBRARIES})
ELSE()
TARGET_LINK_LIBRARIES(flitr m rt)
IF(NOT FLITR_USE_OSG)
TARGET_LINK_LIBRARIES(flitr z bz2)
ENDIF()
TARGET_LINK_LIBRARIES(flitr ${FFmpeg_LIBRARIES} lzma ${OPENSCENEGRAPH_LIBRARIES})
#MESSAGE(${OPENSCENEGRAPH_LIBRARIES})
ENDIF()
TARGET_LINK_LIBRARIES(flitr ${OpenCL_LIBRARIES})
IF(FLITR_USE_OPENCV)
TARGET_LINK_LIBRARIES(flitr ${OpenCV_LIBS})
ENDIF(FLITR_USE_OPENCV)
TARGET_LINK_LIBRARIES(flitr ${LIB_LINK_LIBRARIES})
IF(FLITR_WITH_OSGCUDA)
TARGET_LINK_LIBRARIES(flitr debug osgCuda)
TARGET_LINK_LIBRARIES(flitr optimised osgCuda)
ENDIF()
IF(FLITR_USE_LIBTIFF)
TARGET_LINK_LIBRARIES(flitr tiff)
ENDIF()
SET_TARGET_PROPERTIES(flitr PROPERTIES COMPILE_FLAGS "-DFLITR_SHARED_LIBRARY")
ADD_SUBDIRECTORY(tests/shared_image_buffer)
ADD_SUBDIRECTORY(tests/ffmpeg_producer)
ADD_SUBDIRECTORY(examples/gaussian_filter)
ADD_SUBDIRECTORY(examples/adaptive_threshold)
#================
IF(FLITR_USE_OSG)
IF(FLITR_USE_LIBTIFF)
ADD_SUBDIRECTORY(apps/viewer_colour_night)
ENDIF()
IF(NOT WIN32)
ADD_SUBDIRECTORY(examples/gateway_video_hub)
ENDIF()
ADD_SUBDIRECTORY(examples/msr)
ADD_SUBDIRECTORY(examples/average_image)
ADD_SUBDIRECTORY(examples/deinterlace)
ADD_SUBDIRECTORY(examples/motion_detect)
ADD_SUBDIRECTORY(examples/photometric_equalise)
ADD_SUBDIRECTORY(examples/beat_image)
ADD_SUBDIRECTORY(examples/morphological_filter)
ADD_SUBDIRECTORY(examples/target_injector)
ADD_SUBDIRECTORY(examples/de_motion_blur)
ADD_SUBDIRECTORY(examples/LK_image_registration_cpu)
ADD_SUBDIRECTORY(examples/LK_dewarp_cpu)
ADD_SUBDIRECTORY(examples/DPT)
ADD_SUBDIRECTORY(examples/LK_image_registration)
ADD_SUBDIRECTORY(examples/viewer_video_quad)
ADD_SUBDIRECTORY(examples/viewer_video_history_quad)
ADD_SUBDIRECTORY(examples/viewer_multi_video_quad)
ADD_SUBDIRECTORY(examples/ortho_pick_overlay)
ADD_SUBDIRECTORY(examples/keep_history_pass)
#ADD_SUBDIRECTORY(examples/targeting_task_performance)
ADD_SUBDIRECTORY(examples/producer_multiplexer)
ADD_SUBDIRECTORY(examples/geometry_overlays)
ADD_SUBDIRECTORY(examples/graph_manager)
#ADD_SUBDIRECTORY(examples/streaming_rtsp_writer)
#ADD_SUBDIRECTORY(examples/streaming_rtsp_reader)
IF(WIN32)
ADD_SUBDIRECTORY(examples/video_producer)
ENDIF()
ENDIF()
#================
IF(FLITR_USE_OSG)
ADD_SUBDIRECTORY(examples/hud_overlay)
ADD_SUBDIRECTORY(examples/glsl_shader_pass)
ADD_SUBDIRECTORY(examples/cpu_shader_pass)
ADD_SUBDIRECTORY(examples/histogram_processing)
ADD_SUBDIRECTORY(examples/viewer_image_quad)
#Need to replace the _gl.. calls with the relevant osg calls before the below examples will compile under OSX.
IF(NOT APPLE)
ADD_SUBDIRECTORY(examples/save_texture_to_video_file)
ADD_SUBDIRECTORY(examples/points_overlay)
ADD_SUBDIRECTORY(examples/screen_capture)
ENDIF()
ENDIF()
IF(FLITR_WITH_OSGCUDA)
#ADD_SUBDIRECTORY(examples/cuda_auto_contrast)
ENDIF()
# Add postfix if on 64-bit
IF(UNIX AND NOT WIN32 AND NOT APPLE)
IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib64/" AND CMAKE_SIZEOF_VOID_P EQUAL 8 )
SET(LIB_INSTALL_POSTFIX "64" CACHE STRING "Install suffix for library installation dir")
MARK_AS_ADVANCED(LIB_INSTALL_POSTFIX)
ENDIF()
ENDIF()
#default
IF(NOT DEFINED LIB_INSTALL_POSTFIX)
SET(LIB_INSTALL_POSTFIX "")
ENDIF()
#install
INSTALL(
TARGETS flitr
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_INSTALL_POSTFIX}
ARCHIVE DESTINATION lib${LIB_INSTALL_POSTFIX}
)
#INSTALL(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/share" DESTINATION ${CMAKE_INSTALL_PREFIX})
# for include files install
ADD_SUBDIRECTORY(include)
OPTION(FLITR_WITH_DOXYGEN "Generate the doxygen documentation." OFF)
IF(FLITR_WITH_DOXYGEN)
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(Doxygen ALL ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generate Doxygen documentation." VERBATIM)
else(DOXYGEN_FOUND)
MESSAGE(WARNING "Doxygen not found!")
endif(DOXYGEN_FOUND)
ENDIF(FLITR_WITH_DOXYGEN)
# 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)