-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathCMakeLists.txt
137 lines (118 loc) · 3.01 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
cmake_minimum_required(VERSION 2.8)
project(SuperResolution)
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(${EIGEN_INCLUDE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs)
# Default to Release mode.
IF(NOT DEFINED CMAKE_BUILD_TYPE)
SET(${CMAKE_BUILD_TYPE} Release ... FORCE)
ENDIF()
# Release mode makes the code run faster.
IF(NOT ${CMAKE_BUILD_TYPE} MATCHES Debug)
MESSAGE("Build type: Release.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -Ofast")
ELSE()
MESSAGE("WARNING: Building in DEBUG MODE! Use 'cmake -DCMAKE_BUILD_TYPE=Release' for faster runtime.")
ENDIF()
# Require C++ 11.
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_definitions(-DROOT_CODE_DIRECTORY="${CMAKE_CURRENT_SOURCE_DIR}")
# Libraries will be stored in the "lib" directory, and binaries in "bin".
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Grab all binary source files in the src directory.
file(GLOB SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/*")
# Create a library for all of the added Super Resolution dependencies (i.e. all
# the classes).
file(GLOB alglib_SRC "libs/alglib/src/*.cpp")
file(GLOB hyperspectral_SRC "src/hyperspectral/*.cpp")
file(GLOB evaluation_SRC "src/evaluation/*.cpp")
file(GLOB image_SRC "src/image/*.cpp")
file(GLOB image_model_SRC "src/image_model/*.cpp")
file(GLOB motion_SRC "src/motion/*.cpp")
file(GLOB optimization_SRC "src/optimization/*.cpp")
file(GLOB util_SRC "src/util/*.cpp")
file(GLOB video_SRC "src/video/*.cpp")
file(GLOB wavelet_SRC "src/wavelet/*.cpp")
add_library(
LibSuperResolution
${alglib_SRC}
${hyperspectral_SRC}
${evaluation_SRC}
${image_SRC}
${image_model_SRC}
${motion_SRC}
${optimization_SRC}
${util_SRC}
${video_SRC}
${wavelet_SRC}
)
# Set up the gtest/gmock testing framework.
enable_testing()
file(GLOB test_SRC "test/*.cpp")
add_executable(
Test
${test_SRC}
)
target_link_libraries(
Test
LibSuperResolution
glog
gflags
gmock
gmock_main
gtest
gtest_main
${OpenCV_LIBS}
)
# Add the VisualizeImage binary.
add_executable(
VisualizeImage
src/visualize_image.cpp
)
target_link_libraries(
VisualizeImage
LibSuperResolution
glog
gflags
${OpenCV_LIBS}
)
# Add the GenerateData binary.
add_executable(
GenerateData
src/generate_data.cpp
)
target_link_libraries(
GenerateData
LibSuperResolution
glog
gflags
${OpenCV_LIBS}
)
# Add the Shift-Add Fusion binary.
add_executable(
ShiftAddFusion
src/shift_add_fusion.cpp
)
target_link_libraries(
ShiftAddFusion
LibSuperResolution
glog
gflags
${OpenCV_LIBS}
)
# Add the SuperResolution binary.
add_executable(
SuperResolution
src/super_resolution.cpp
)
target_link_libraries(
SuperResolution
LibSuperResolution
glog
gflags
${OpenCV_LIBS}
)