forked from uos/lvr2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLVR2Config.cmake.in
174 lines (141 loc) · 4.36 KB
/
LVR2Config.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
# -----------------------------------------------------------------
# lvr's cmake configuration
#
# provided options:
# - LVR2_USE_STATIC_LIBS(=OFF) to link the static libraries of lvr
#
# provided interface variables:
# - LVR2_INCLUDE_DIRS
# - LVR2_DEFINITIONS
# - LVR2_LIBRARIES
#
# Do not forget to add_defintions(${LVR2_DEFINITIONS}) as they
# describe the build configuration of liblvr.
#
# -----------------------------------------------------------------
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/lvr2Targets.cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Modules")
cmake_policy(PUSH)
cmake_policy(SET CMP0012 NEW)
set(LVR2_INCLUDE_DIRS @LVR2_INSTALL_INCLUDE_DIRS@)
set(LVR2_DEFINITIONS @LVR2_DEFINITIONS@)
find_package(PkgConfig REQUIRED)
set(LVR2_LIB_DIR @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@)
option(LVR2_USE_STATIC_LIBS OFF)
if(LVR2_USE_STATIC_LIBS)
set(LVR2_LIBRARY ${LVR2_LIB_DIR}/liblvr2_static.a)
set(LVR2_LIBRARIES ${LVR2_LIBRARY})
else()
set(LVR2_LIBRARY ${LVR2_LIB_DIR}/liblvr2.so)
set(LVR2_LIBRARIES ${LVR2_LIBRARY})
endif()
# MPI
if(@MPI_FOUND@)
find_package(MPI REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${MPI_INCLUDE_PATH})
list(APPEND LVR2_LIBRARIES ${MPI_CXX_LIBRARIES})
endif(@MPI_FOUND@)
###################
## REQUIRED DEPS ##
###################
# TBB
find_package(TBB REQUIRED)
list(APPEND LVR2_LIBRARIES TBB::tbb)
# TIFF
find_package(TIFF REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${TIFF_INCLUDE_DIRS})
list(APPEND LVR2_LIBRARIES ${TIFF_LIBRARY})
# GDAL
find_package(GDAL REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${GDAL_INCLUDE_DIR})
list(APPEND LVR2_LIBRARIES ${GDAL_LIBRARY})
# OpenCV
find_package(OpenCV REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${OpenCV_INCLUDE_DIRS})
list(APPEND LVR2_LIBRARIES ${OpenCV_LIBS})
# FLANN
find_package(FLANN REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${FLANN_INCLUDE_DIR})
# Lz4
find_package(LZ4 REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${LZ4_INCLUDE_DIR})
list(APPEND LVR2_LIBRARIES ${LZ4_LIBRARY})
# GSL
find_package(GSL REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${GSL_INCLUDE_DIRS})
list(APPEND LVR2_LIBRARIES ${GSL_LIBRARIES})
# Eigen
find_package(Eigen3 REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
# YAML-CPP
find_package(yaml-cpp REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR})
list(APPEND LVR2_LIBRARIES ${YAML_CPP_LIBRARIES})
# Boost
find_package(Boost COMPONENTS @Boost_COMPONENTS@ REQUIRED QUIET)
list(APPEND LVR2_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
list(APPEND LVR2_DEFINITIONS ${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
list(APPEND LVR2_LIBRARIES ${Boost_LIBRARIES})
# HDF5
find_package(HDF5 REQUIRED COMPONENTS C CXX HL)
list(APPEND LVR2_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS})
list(APPEND LVR2_LIBRARIES ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})
# OpenGL
find_package(OpenGL COMPONENTS OpenGL)
list(APPEND LVR2_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
list(APPEND LVR2_LIBRARIES ${OPENGL_LIBRARIES})
# GLUT
find_package(GLUT REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${GLUT_INCLUDE_DIR})
list(APPEND LVR2_LIBRARIES ${GLUT_LIBRARIES})
#####################
## OPTIONAL DEPS ##
#####################
if(@RDB_FOUND@)
find_package(RDB)
list(APPEND LVR2_INCLUDE_DIRS ${RDB_INCLUDE_DIRS})
endif(@RDB_FOUND@)
# VTK
if(@VTK_FOUND@)
find_package(VTK REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${VTK_INCLUDE_DIRS})
list(APPEND LVR2_DEFINITIONS ${VTK_DEFINITIONS})
endif()
# nabo
if(@NABO_FOUND@)
find_package(Nabo REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${NABO_INCLUDE_DIRS})
endif()
# pcl
if(@PCL_FOUND@)
find_package(PCL REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${PCL_INCLUDE_DIRS})
list(APPEND LVR2_DEFINITIONS ${PCL_DEFINITIONS})
endif()
# cgal
if(@CGAL_FOUND@)
find_package(CGAL REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${CGAL_INCLUDE_DIRS})
endif()
# libfreenect
if(@LIBFREENECT_FOUND@)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBFREENECT REQUIRED libfreenect)
list(APPEND LVR2_INCLUDE_DIRS ${LIBFREENECT_INCLUDE_DIRS})
endif()
# stann
if(@STANN_FOUND@)
set(STANN_DIR @STANN_DIR@)
find_package(STANN REQUIRED)
list(APPEND LVR2_2INCLUDE_DIRS ${STANN_INCLUDE_DIR})
endif()
# Embree
if(@embree_FOUND@)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
find_package(embree 3.0 REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${EMBREE_INCLUDE_DIRS})
list(APPEND LVR2_LIBRARIES ${EMBREE_LIBRARY})
endif()
cmake_policy(POP)
set(LVR2_FOUND TRUE)