-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
82 lines (72 loc) · 3.57 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
cmake_minimum_required(VERSION 3.13)
project(VideoSubFinderWXW LANGUAGES CXX)
if(WIN32)
option(WIN64 "Make x64 build" ON)
if(WIN64)
find_package(IntelDPCPP REQUIRED)
option(USE_CUDA "Build with CUDA support" ON)
add_definitions(-DWIN64)
set(wxWidgets_INCLUDE_DIRS "$ENV{WX_WIDGETS_PATH}/lib/vc_x64_lib/mswu;$ENV{WX_WIDGETS_PATH}/include" CACHE STRING "Paths to OpenCV include dirs")
set(OpenCV_INCLUDE_DIRS "$ENV{OPENCV_BUILD_PATH_X64}/install/include" CACHE STRING "Paths to OpenCV include dirs")
set(FFMPEG_INCLUDE_DIRS "$ENV{FFMPEG_PATH_X64}/include" CACHE STRING "Paths to FFMPEG include dirs")
set(VideoSubFinderWXW_LINK_DIRS "$ENV{WX_WIDGETS_PATH}/lib/vc_x64_lib;$ENV{OPENCV_BUILD_PATH_X64}/lib/Release;$ENV{CUDA_TOOLKIT_PATH}/lib/x64;$ENV{FFMPEG_PATH_X64}/lib" CACHE STRING "VideoSubFinderWXW link dirs")
else()
option(USE_CUDA "Build with CUDA support" OFF)
add_definitions(-DWINX86)
set(wxWidgets_INCLUDE_DIRS "$ENV{WX_WIDGETS_PATH}/lib/vc_lib/mswu;$ENV{WX_WIDGETS_PATH}/include" CACHE STRING "Paths to OpenCV include dirs")
set(OpenCV_INCLUDE_DIRS "$ENV{OPENCV_BUILD_PATH_X86}/install/include" CACHE STRING "Paths to OpenCV include dirs")
set(FFMPEG_INCLUDE_DIRS "$ENV{FFMPEG_PATH_X86}/include" CACHE STRING "Paths to FFMPEG include dirs")
set(VideoSubFinderWXW_LINK_DIRS "$ENV{WX_WIDGETS_PATH}/lib/vc_lib;$ENV{OPENCV_BUILD_PATH_X86}/lib/Release;$ENV{FFMPEG_PATH_X86}/lib" CACHE STRING "VideoSubFinderWXW link dirs")
endif(WIN64)
set(OpenCV_LIBS "opencv_world$ENV{OPENCV_LIBS_VER}.lib" CACHE STRING "Required OpenCV libs for build")
else()
option(USE_CUDA "Build with CUDA support" ON)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(wxWidgets_USE_DEBUG ON)
else()
set(wxWidgets_USE_DEBUG OFF)
endif()
if(USE_GUI)
find_package(wxWidgets REQUIRED COMPONENTS core base aui)
else()
if (BUILD_FULL_STATIC)
set(wxWidgets_INCLUDE_DIRS "/usr/local/lib/wx/include/base-unicode-static-3.2;/usr/local/include/wx-3.2")
set(wxWidgets_LIBRARIES "-L/usr/local/lib -pthread /usr/local/lib/libwx_baseu-3.2.a -lwxregexu-3.2 -lwxexpat-3.2 -lwxzlib-3.2 -ldl -lm")
else(BUILD_FULL_STATIC)
find_package(wxWidgets REQUIRED COMPONENTS base)
endif(BUILD_FULL_STATIC)
endif(USE_GUI)
find_package(OpenCV REQUIRED COMPONENTS videoio)
if(USE_CUDA)
set(CUDA_LINK_DIRS "$ENV{CUDA_TOOLKIT_PATH}//lib64;$ENV{CUDA_TOOLKIT_PATH}//extras/CUPTI/lib64" CACHE STRING "CUDA link dirs")
endif(USE_CUDA)
endif(WIN32)
if(USE_CUDA)
set(CMAKE_CUDA_FLAGS "-arch=all")
add_definitions(-DUSE_CUDA)
set(CUDAKernels_INCLUDE_DIRS "../CUDAKernels")
set(CUDAKernels_LIB "CUDAKernels;cudart;nppicc;nppig")
add_subdirectory(Components/CUDAKernels)
else()
set(CUDAKernels_INCLUDE_DIRS "")
set(CUDAKernels_LIB "")
endif(USE_CUDA)
add_subdirectory(Components/IPAlgorithms)
add_subdirectory(Components/OCVVideo)
add_subdirectory(Components/FFMPEGVideo)
if(USE_GUI)
add_definitions(-DUSE_GUI)
option(USE_GUI "Build with GUI support" ON)
add_subdirectory(Interfaces/VideoSubFinderWXW)
install(TARGETS VideoSubFinderWXW DESTINATION VideoSubFinder)
else()
add_definitions(-UUSE_GUI)
option(USE_GUI "Build with GUI support" OFF)
add_subdirectory(Interfaces/VideoSubFinderCli)
install(TARGETS VideoSubFinderCli DESTINATION VideoSubFinder)
endif(USE_GUI)
install(DIRECTORY Data/bitmaps/ DESTINATION VideoSubFinder/bitmaps)
install(DIRECTORY Settings/Localization/ DESTINATION VideoSubFinder/settings FILES_MATCHING PATTERN "*.cfg")
install(FILES Settings/general.cfg DESTINATION VideoSubFinder/settings)
file(GLOB readme_files "Docs/readme*.txt")
install(FILES ${readme_files} DESTINATION VideoSubFinder/Docs)