forked from colmap/colmap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeConfig.cmake.in
203 lines (165 loc) · 5.89 KB
/
CMakeConfig.cmake.in
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# Copyright (c) 2018, ETH Zurich and UNC Chapel Hill.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of ETH Zurich and UNC Chapel Hill nor the names of
# its contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de)
# Find package module for COLMAP library.
#
# The following variables are set by this module:
#
# COLMAP_FOUND: TRUE if COLMAP is found.
# COLMAP_VERSION: COLMAP version.
# COLMAP_INCLUDE_DIRS: Include directories for COLMAP.
# COLMAP_LINK_DIRS: Link directories for COLMAP.
# COLMAP_LIBRARIES: Libraries required to link COLMAP.
# COLMAP_CUDA_ENABLED: Whether COLMAP was compiled with CUDA support.
# COLMAP_CGAL_ENABLED: Whether COLMAP was compiled with CGAL dependencies.
get_filename_component(COLMAP_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_FILE} PATH)
set(COLMAP_INSTALL_PREFIX "${COLMAP_INSTALL_PREFIX}/../..")
set(COLMAP_FOUND FALSE)
# Set hints for finding dependency packages.
set(EIGEN3_INCLUDE_DIR_HINTS @EIGEN3_INCLUDE_DIR_HINTS@)
set(FREEIMAGE_INCLUDE_DIR_HINTS @FREEIMAGE_INCLUDE_DIR_HINTS@)
set(FREEIMAGE_LIBRARY_DIR_HINTS @FREEIMAGE_LIBRARY_DIR_HINTS@)
set(GLEW_INCLUDE_DIR_HINTS @GLEW_INCLUDE_DIR_HINTS@)
set(GLEW_LIBRARY_DIR_HINTS @GLEW_LIBRARY_DIR_HINTS@)
set(GLOG_INCLUDE_DIR_HINTS @GLOG_INCLUDE_DIR_HINTS@)
set(GLOG_LIBRARY_DIR_HINTS @GLOG_LIBRARY_DIR_HINTS@)
# Find dependency packages.
set(TEMP_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH ${COLMAP_INSTALL_PREFIX}/share/colmap/cmake)
if(COLMAP_FIND_QUIETLY)
find_package(Ceres QUIET)
find_package(Boost COMPONENTS
program_options
filesystem
regex
system
unit_test_framework
QUIET)
find_package(Eigen3 QUIET)
find_package(FreeImage QUIET)
find_package(Glog QUIET)
find_package(OpenGL QUIET)
find_package(Glew QUIET)
find_package(Qt5 5.4 QUIET COMPONENTS Core OpenGL Widgets)
else()
find_package(Ceres REQUIRED)
find_package(Boost COMPONENTS
program_options
filesystem
regex
system
unit_test_framework
REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(FreeImage REQUIRED)
find_package(Glog REQUIRED)
find_package(OpenGL REQUIRED)
find_package(Glew REQUIRED)
find_package(Qt5 5.4 REQUIRED COMPONENTS Core OpenGL Widgets)
endif()
# Set the exported variables.
set(COLMAP_FOUND TRUE)
set(COLMAP_VERSION @COLMAP_VERSION@)
set(COLMAP_CUDA_ENABLED @CUDA_ENABLED@)
set(COLMAP_CUDA_MIN_VERSION @CUDA_MIN_VERSION@)
set(COLMAP_CGAL_ENABLED @CGAL_ENABLED@)
set(COLMAP_INCLUDE_DIRS
${COLMAP_INSTALL_PREFIX}/include/
${COLMAP_INSTALL_PREFIX}/include/colmap
${COLMAP_INSTALL_PREFIX}/include/colmap/lib
${Boost_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS}
${FREEIMAGE_INCLUDE_DIRS}
${CERES_INCLUDE_DIRS}
${GLEW_INCLUDE_DIRS}
${Qt5Core_INCLUDE_DIRS}
${Qt5OpenGL_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
)
set(COLMAP_LINK_DIRS
${COLMAP_INSTALL_PREFIX}/lib/colmap
${Boost_LIBRARY_DIRS}
)
set(COLMAP_EXTERNAL_LIBRARIES
${CMAKE_DL_LIBS}
${GLOG_LIBRARIES}
${FREEIMAGE_LIBRARIES}
${CERES_LIBRARIES}
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLEW_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5OpenGL_LIBRARIES}
${Qt5Widgets_LIBRARIES}
)
if(UNIX)
list(APPEND COLMAP_EXTERNAL_LIBRARIES
${Boost_FILESYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_SYSTEM_LIBRARY}
pthread)
endif()
set(COLMAP_INTERNAL_LIBRARIES
colmap
flann
graclus
lsd
pba
poisson_recon
sqlite3
sift_gpu
vlfeat
)
if(COLMAP_CUDA_ENABLED)
find_package(CUDA ${COLMAP_CUDA_MIN_VERSION} QUIET)
list(APPEND COLMAP_INTERNAL_LIBRARIES colmap_cuda)
list(APPEND COLMAP_EXTERNAL_LIBRARIES ${CUDA_LIBRARIES})
endif()
if(COLMAP_CGAL_ENABLED)
find_package(CGAL REQUIRED)
list(APPEND COLMAP_EXTERNAL_LIBRARIES ${CGAL_LIBRARY} ${GMP_LIBRARIES})
endif()
set(COLMAP_LIBRARIES
${COLMAP_INTERNAL_LIBRARIES}
${COLMAP_EXTERNAL_LIBRARIES}
)
# Cleanup of configuration variables.
set(CMAKE_MODULE_PATH ${TEMP_CMAKE_MODULE_PATH})
unset(COLMAP_INSTALL_PREFIX)
unset(EIGEN3_INCLUDE_DIR_HINTS)
unset(FREEIMAGE_INCLUDE_DIR_HINTS)
unset(FREEIMAGE_LIBRARY_DIR_HINTS)
unset(GLEW_INCLUDE_DIR_HINTS)
unset(GLEW_LIBRARY_DIR_HINTS)
unset(GLOG_INCLUDE_DIR_HINTS)
unset(GLOG_LIBRARY_DIR_HINTS)
unset(QT5_CMAKE_CONFIG_DIR_HINTS)