forked from PaulStahr/Multiview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
162 lines (143 loc) · 4 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
# Generated from multiview.pro.
cmake_minimum_required(VERSION 3.16)
project(multiview VERSION 1.0 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
#find_package(QT NAMES Qt5 Qt6 REQUIRED COMPONENTS Core)
find_package(QT NAMES Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui)
#REF: https://doc-snapshots.qt.io/qt6-dev/cmake-qt5-and-qt6-compatibility.html
message(STATUS "Using Qt Version: ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}")
#NOTE: qt_add_executable is Qt6 specific
#REF: https://bugreports.qt.io/browse/QTCREATORBUG-26062
#qt_add_executable(multiview WIN32 MACOSX_BUNDLE
add_executable(multiview
src/OBJ_Loader.cpp src/OBJ_Loader.h
src/control_ui.h
src/control_window.cpp src/control_window.h
src/data.cpp src/data.h
src/geometry.cpp src/geometry.h
src/image_io.cpp src/image_io.h
src/image_util.cpp src/image_util.h
src/io_util.cpp src/io_util.h
src/iterator_util.h
src/main.cpp src/main.h
#src/main_egl.cpp src/main.h
src/openglwindow.cpp src/openglwindow.h
src/python_binding.cpp
src/qt_gl_util.cpp
src/qt_util.cpp src/qt_util.h
src/rendering_view.cpp
src/serialize.cpp src/serialize.h
src/server.cpp src/server.h
src/session.cpp src/session.h
src/shader.cpp src/shader.h
src/transformation.cpp src/transformation.h
src/util.cpp src/util.h
src/counting_semaphore.cpp src/counting_semaphore.h
src/lang.cpp src/lang.h
ui/control_ui.ui
)
target_include_directories(multiview PUBLIC
.
/usr/include/python3.8
/usr/include/x86_64-linux-gnu/python3.8
)
target_compile_definitions(multiview PUBLIC
OPENEXR
QT_DEPRECATED_WARNINGS
)
target_link_libraries(multiview PUBLIC
# Remove: L/usr/include/python3.8/
# Remove: L/usr/include/x86_64-linux-gnu/python3.8/
EGL
Half
Iex
IexMath
IlmImf
IlmThread
Imath
Qt5Widgets
Qt5::Core
Qt5::Gui
boost_filesystem
boost_graph
boost_numpy38
boost_python38
boost_system
boost_unit_test_framework
dl
png
python3.8
stdc++fs
pthread
GL
)
#NOTE: Added the -pthread compilation flag is Linux specific requirement
#REF: https://stackoverflow.com/questions/34143265/undefined-reference-to-symbol-pthread-createglibc-2-2-5
target_compile_options(multiview PUBLIC
-Wall
-Wextra
-fopenmp
-g
-pedantic
-std=c++17
-pthread
-msse4.1
-mavx
)
#NOTE: Copy shader directory to build directory
#REF: https://stackoverflow.com/a/13429998
#message(STATUS "current source dir: ${CMAKE_CURRENT_SOURCE_DIR}")
add_custom_command(TARGET multiview POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/shader/ $<TARGET_FILE_DIR:multiview>/shader
COMMENT "Copying shader folder to build directory")
if(Release)
message(STATUS "** multiview RELEASE build **")
target_sources(multiview PUBLIC
src/main.cpp
#src/main_egl.cpp
)
endif()
if(Debug)
message(STATUS "** multiview DEBUG build **")
target_sources(multiview PUBLIC
src/main.cpp
#src/main_egl.cpp
)
target_link_libraries(multiview PUBLIC
# Remove: fsanitize=address
# Remove: static-libasan
)
target_compile_options(multiview
-fsanitize=address
-static-libasan
)
endif()
if(Test)
message(STATUS "** multiview TEST build **")
target_sources(multiview PUBLIC
src/OBJ_Loader_test.h
src/geometry_test.h
src/io_util_test.h
src/data_test.h
src/test_main.cpp
)
target_link_libraries(multiview PUBLIC
# Remove: fsanitize=address
# Remove: static-libasan
)
target_compile_options(multiview
-fsanitize=address
-static-libasan
)
endif()
if(Library)
message(STATUS "** multiview LIBRARY build **")
target_link_libraries(multiview PUBLIC
# Remove: -shared
# Remove: fPIC
)
endif()