Skip to content

Commit bc88ade

Browse files
rhuitlmvieth
authored andcommitted
Make the dependency of "outofcore" on "visualization" optional.
Without "visualization", one of the overloads of queryFrustum is unavailable.
1 parent 575168b commit bc88ade

File tree

5 files changed

+32
-5
lines changed

5 files changed

+32
-5
lines changed

Diff for: CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -471,13 +471,19 @@ else()
471471
endif()
472472
unset(CMAKE_REQUIRED_LIBRARIES)
473473

474+
### --[ Set variables for pcl_config.h
475+
if (BUILD_visualization)
476+
set(PCL_VISUALIZATION_AVAILABLE TRUE)
477+
endif()
478+
474479
### ---[ Create the config.h file
475480
set(pcl_config_h_in "${CMAKE_CURRENT_SOURCE_DIR}/pcl_config.h.in")
476481
set(pcl_config_h "${CMAKE_CURRENT_BINARY_DIR}/include/pcl/pcl_config.h")
477482
configure_file("${pcl_config_h_in}" "${pcl_config_h}")
478483
PCL_ADD_INCLUDES(common "" "${pcl_config_h}")
479484
include_directories("${CMAKE_CURRENT_BINARY_DIR}/include")
480485

486+
## ---[ PCL modules
481487
collect_subproject_directory_names("${PCL_SOURCE_DIR}" "CMakeLists.txt" PCL_MODULES_NAMES PCL_MODULES_DIRS doc)
482488
set(PCL_MODULES_NAMES_UNSORTED ${PCL_MODULES_NAMES})
483489
topological_sort(PCL_MODULES_NAMES PCL_ _DEPENDS)

Diff for: outofcore/CMakeLists.txt

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
set(SUBSYS_NAME outofcore)
22
set(SUBSYS_DESC "Point cloud outofcore library")
3+
if(BUILD_visualization)
34
set(SUBSYS_DEPS common io filters octree visualization)
5+
else()
6+
set(SUBSYS_DEPS common io filters octree)
7+
endif()
48

59
if(NOT TARGET Boost::filesystem)
610
set(DEFAULT FALSE)
@@ -70,9 +74,13 @@ endif()
7074

7175
set(LIB_NAME "pcl_${SUBSYS_NAME}")
7276

73-
PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs} ${impl_incs} ${visualization_incs})
74-
#PCL_ADD_SSE_FLAGS("${LIB_NAME}")
75-
target_link_libraries("${LIB_NAME}" pcl_common pcl_visualization ${Boost_SYSTEM_LIBRARY})
77+
if(BUILD_visualization)
78+
PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs} ${impl_incs} ${visualization_incs})
79+
target_link_libraries("${LIB_NAME}" pcl_common pcl_visualization ${Boost_SYSTEM_LIBRARY})
80+
else()
81+
PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs} ${impl_incs})
82+
target_link_libraries("${LIB_NAME}" pcl_common ${Boost_SYSTEM_LIBRARY})
83+
endif()
7684
if(HAVE_CJSON)
7785
target_link_libraries("${LIB_NAME}" ${CJSON_LIBRARIES})
7886
endif()
@@ -81,7 +89,9 @@ PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC ${SUBSYS_DESC} PCL_
8189
# Install include files
8290
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}" ${incs})
8391
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/impl" ${impl_incs})
84-
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/visualization" ${visualization_incs})
92+
if(BUILD_visualization)
93+
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/visualization" ${visualization_incs})
94+
endif()
8595

8696
if(BUILD_tools)
8797
add_subdirectory(tools)

Diff for: outofcore/include/pcl/outofcore/impl/octree_base_node.hpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151

5252
#include <pcl/common/common.h>
5353
#include <pcl/common/utils.h> // pcl::utils::ignore
54+
#ifdef PCL_VISUALIZATION_AVAILABLE
5455
#include <pcl/visualization/common/common.h>
56+
#endif
5557
#include <pcl/outofcore/octree_base_node.h>
5658
#include <pcl/filters/random_sample.h>
5759
#include <pcl/filters/extract_indices.h>
@@ -1199,7 +1201,7 @@ namespace pcl
11991201
}
12001202

12011203
////////////////////////////////////////////////////////////////////////////////
1202-
1204+
#ifdef PCL_VISUALIZATION_AVAILABLE
12031205
template<typename Container, typename PointT> void
12041206
OutofcoreOctreeBaseNode<Container, PointT>::queryFrustum (const double planes[24], const Eigen::Vector3d &eye, const Eigen::Matrix4d &view_projection_matrix, std::list<std::string>& file_names, const std::uint32_t query_depth, const bool skip_vfc_check)
12051207
{
@@ -1310,6 +1312,7 @@ namespace pcl
13101312
}
13111313
}
13121314
}
1315+
#endif
13131316

13141317
////////////////////////////////////////////////////////////////////////////////
13151318
template<typename ContainerT, typename PointT> void

Diff for: outofcore/include/pcl/outofcore/octree_base_node.h

+7
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,15 @@ namespace pcl
161161
void
162162
queryFrustum (const double planes[24], std::list<std::string>& file_names, const std::uint32_t query_depth, const bool skip_vfc_check = false);
163163

164+
/** \warning This function is only available if the visualization module is available and the preprocessor symbol `PCL_VISUALIZATION_AVAILABLE` is defined.
165+
*/
166+
#ifdef PCL_VISUALIZATION_AVAILABLE
164167
void
165168
queryFrustum (const double planes[24], const Eigen::Vector3d &eye, const Eigen::Matrix4d &view_projection_matrix, std::list<std::string>& file_names, const std::uint32_t query_depth, const bool skip_vfc_check = false);
169+
#else
170+
void
171+
queryFrustum (const double planes[24], const Eigen::Vector3d &eye, const Eigen::Matrix4d &view_projection_matrix, std::list<std::string>& file_names, const std::uint32_t query_depth, const bool skip_vfc_check = false) = delete;
172+
#endif
166173

167174
//point extraction
168175
/** \brief Recursively add points that fall into the queried bounding box up to the \b query_depth

Diff for: pcl_config.h.in

+1
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,4 @@
100100

101101
#cmakedefine HAVE_QVTK 1
102102

103+
#cmakedefine PCL_VISUALIZATION_AVAILABLE

0 commit comments

Comments
 (0)