-
Notifications
You must be signed in to change notification settings - Fork 105
/
CMakeLists.txt
96 lines (87 loc) · 2.94 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
cmake_minimum_required(VERSION 3.16)
project(LiveVideoMagnification VERSION 1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# OpenCV Setup
find_package(OpenCV QUIET)
if(NOT OpenCV_FOUND)
if(NOT OpenCV_DIR)
message(FATAL_ERROR "OpenCV not found and OpenCV_DIR is not set. Please specify the path to the OpenCV build directory.")
else()
find_package(OpenCV REQUIRED PATHS ${OpenCV_DIR} NO_DEFAULT_PATH)
if(NOT OpenCV_FOUND)
message(FATAL_ERROR "OpenCV not found in the specified OpenCV_DIR: ${OpenCV_DIR}")
endif()
endif()
endif()
# Qt6 Setup
find_package(Qt6 REQUIRED COMPONENTS Widgets)
qt6_standard_project_setup()
set(CMAKE_AUTOUIC OFF)
# Include paths
include_directories(
${CMAKE_SOURCE_DIR}/src
)
# Gather all files necessary for the project
set(SOURCES
src/main/main.cpp
src/main/helper/MatToQImage.cpp
src/main/helper/SharedImageBuffer.cpp
src/main/magnification/Magnificator.cpp
src/main/magnification/RieszPyramid.cpp
src/main/magnification/SpatialFilter.cpp
src/main/magnification/TemporalFilter.cpp
src/main/threads/CaptureThread.cpp
src/main/threads/PlayerThread.cpp
src/main/threads/ProcessingThread.cpp
src/main/threads/SavingThread.cpp
src/main/ui/CameraConnectDialog.cpp
src/main/ui/CameraView.cpp
src/main/ui/FrameLabel.cpp
src/main/ui/MagnifyOptions.cpp
src/main/ui/MainWindow.cpp
src/main/ui/VideoView.cpp
src/external/qxtSlider/qxtglobal.cpp
src/external/qxtSlider/qxtspanslider.cpp
)
set(HEADERS
src/main/helper/ComplexMat.h
src/main/helper/MatToQImage.h
src/main/helper/SharedImageBuffer.h
src/main/magnification/Magnificator.h
src/main/magnification/RieszPyramid.h
src/main/magnification/SpatialFilter.h
src/main/magnification/TemporalFilter.h
src/main/threads/CaptureThread.h
src/main/threads/PlayerThread.h
src/main/threads/ProcessingThread.h
src/main/threads/SavingThread.h
src/main/ui/CameraConnectDialog.h
src/main/ui/CameraView.h
src/main/ui/FrameLabel.h
src/main/ui/MagnifyOptions.h
src/main/ui/MainWindow.h
src/main/ui/VideoView.h
src/main/other/Buffer.h
src/main/other/Config.h
src/main/other/Structures.h
src/external/qxtSlider/qxtglobal.h
src/external/qxtSlider/qxtnamespace.h
src/external/qxtSlider/qxtspanslider.h
src/external/qxtSlider/qxtspanslider_p.h
)
set(UI_FILES
src/main/ui/MainWindow.ui
src/main/ui/CameraView.ui
src/main/ui/CameraConnectDialog.ui
src/main/ui/MagnifyOptions.ui
src/main/ui/VideoView.ui
)
qt_add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${UI_FILES})
qt6_add_ui(${PROJECT_NAME} SOURCES ${UI_FILES})
target_include_directories(${PROJECT_NAME} PRIVATE ${OpenCV_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets ${OpenCV_LIBS})
set_target_properties(${PROJECT_NAME} PROPERTIES
WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON
)