-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
143 lines (123 loc) · 3.54 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
# CMake file for OpenGL 2d image warper
# Author: Shane Yuan
# E-mail: [email protected]
#
##
## _oo0oo_
## o8888888o
## 88" . "88
## (| -_- |)
## 0\ = /0
## ___/`---'\___
## .' \\| |// '.
## / \\||| : |||// \
## / _||||| -:- |||||- \
## | | \\\ - /// | |
## | \_| ''\---/'' |_/ |
## \ .-\__ '-' ___/-. /
## ___'. .' /--.--\ `. .'___
## ."" '< `.___\_<|>_/___.' >' "".
## | | : `- \`.;`\ _ /`;.`/ - ` : | |
## \ \ `_. \_ __\ /__ _/ .-` / /
## =====`-.____`.___ \_____/___.-`___.-'=====
## `=---='
##
## 佛祖保佑 永无BUG
## Buddha Bless No Bug
##
message(
"##
## _oo0oo_
## o8888888o
## 88\" . \"88
## (| -_- |)
## 0\\ = /0
## ___/`---'\\___
## .' \\\\| |// '.
## / \\\\||| : |||// \\
## / _||||| -:- |||||- \\
## | | \\\\\\ - /// | |
## | \\_| ''\\---/'' |_/ |
## \\ .-\\__ '-' ___/-. /
## ___'. .' /--.--\\ `. .'___
## .\"\" '< `.___\\_<|>_/___.' >' \"\".
## | | : `- \\`.;`\\ _ /`;.`/ - ` : | |
## \\ \\ `_. \\_ __\\ /__ _/ .-` / /
## =====`-.____`.___ \\_____/___.-`___.-'=====
## `=---='
##
## 佛祖保佑 永无BUG
## Buddha Bless No Bug
##
"
)
cmake_minimum_required (VERSION 3.10)
set(name "OpenGLImageWarper")
project ( ${name} )
# cmake module
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
# c++ version
set (CMAKE_CXX_STANDARD 11)
#opencv
if ( WIN32 )
set(OpenCV_DIR "E:/libs/OpenCV/x64/vc14/lib")
set(OpenCV_CONFIG_PATH "E:/libs/OpenCV")
endif()
# OpenCV
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
# OpenGL
find_package(OpenGL REQUIRED)
# Ask the user to give the paths to GLFW, GLEW and GLM.
# On Linux this can be found automatically with pkg-config;
# see http://stackoverflow.com/questions/6889264/cmake-flags-for-opengl-using-glew-and-glfw, for instance.
if ( WIN32 )
set(GLFW_INCLUDE_PATH "E:/libs/OpenGL/include/GLFW")
set(GLFW_LIBRARY "E:/libs/OpenGL/lib/glfw3.lib" )
set(GLEW_INCLUDE_PATH "E:/libs/OpenGL/include")
set(GLEW_LIBRARY_DEBUG debug "E:/libs/OpenGL/lib/glew32d.lib")
set(GLEW_LIBRARY_RELEASE optimized "E:/libs/OpenGL/lib/glew32.lib")
set(GLM_INCLUDE_PATH "E:/libs/OpenGL/include")
endif()
#cuda
find_package(CUDA)
set(CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS}
# -O3
-gencode=arch=compute_61,code=\"sm_61,compute_61\"
)
include_directories(
${GLFW_INCLUDE_PATH}
${GLEW_INCLUDE_PATH}
${GLM_INCLUDE_PATH}
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/common
)
cuda_add_executable(${name}
common/shader.hpp
common/shader.cpp
OpenGLImageWarper.h
OpenGLImageWarper.cpp
OpenGLImageWarper.cu
main.cpp
)
target_link_libraries(${name}
${OPENGL_LIBRARY} # filled by "find_package(OpenGL REQUIRED)"
${GLFW_LIBRARY}
${GLEW_LIBRARY_DEBUG}
${GLEW_LIBRARY_RELEASE}
${OpenCV_LIBS}
${CUDA_LIBRARY}
${CUDA_npp_LIBRARY}
${CUDA_nppc_LIBRARY}
${CUDA_nppicc_LIBRARY}
${CUDA_nppicom_LIBRARY}
${CUDA_nppidei_LIBRARY}
${CUDA_nppif_LIBRARY}
${CUDA_nppig_LIBRARY}
${CUDA_nppim_LIBRARY}
${CUDA_nppist_LIBRARY}
${CUDA_nppisu_LIBRARY}
${CUDA_nppitc_LIBRARY}
${CUDA_npps_LIBRARY}
)