Skip to content

Commit

Permalink
Merge pull request #299 from jpgr87/master
Browse files Browse the repository at this point in the history
Allow pcl to be built against a system-wide installed metslib
  • Loading branch information
rbrusu committed Dec 14, 2013
2 parents 40e6127 + 579f202 commit 2c872f5
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 38 deletions.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
### ---[ Find universal dependencies
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/" ${CMAKE_MODULE_PATH})

# ---[ Include pkgconfig
include (FindPkgConfig)

# ---[ Release/Debug specific flags
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
add_definitions("-DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG")
Expand Down Expand Up @@ -267,6 +270,14 @@ if (PXCAPI_FOUND)
include_directories(SYSTEM ${PXCAPI_INCLUDE_DIRS})
endif()

# metslib
if (PKG_CONFIG_FOUND)
pkg_check_modules(METSLIB metslib)
if (METSLIB_FOUND)
set (HAVE_METSLIB ON)
endif()
endif()

# LibPNG
find_package(PNG)
if (PNG_FOUND)
Expand Down
78 changes: 41 additions & 37 deletions recognition/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ if(build)
include/pcl/${SUBSYS_NAME}/boost.h
include/pcl/${SUBSYS_NAME}/color_gradient_dot_modality.h
include/pcl/${SUBSYS_NAME}/color_gradient_modality.h
include/pcl/${SUBSYS_NAME}/color_modality.h
include/pcl/${SUBSYS_NAME}/crh_alignment.h
include/pcl/${SUBSYS_NAME}/color_modality.h
include/pcl/${SUBSYS_NAME}/crh_alignment.h
include/pcl/${SUBSYS_NAME}/linemod.h
include/pcl/${SUBSYS_NAME}/dotmod.h
include/pcl/${SUBSYS_NAME}/quantizable_modality.h
Expand All @@ -36,8 +36,8 @@ if(build)
include/pcl/${SUBSYS_NAME}/surface_normal_modality.h
include/pcl/${SUBSYS_NAME}/linemod/line_rgbd.h
include/pcl/${SUBSYS_NAME}/implicit_shape_model.h
include/pcl/${SUBSYS_NAME}/ransac_based/auxiliary.h
include/pcl/${SUBSYS_NAME}/ransac_based/hypothesis.h
include/pcl/${SUBSYS_NAME}/ransac_based/auxiliary.h
include/pcl/${SUBSYS_NAME}/ransac_based/hypothesis.h
include/pcl/${SUBSYS_NAME}/ransac_based/model_library.h
include/pcl/${SUBSYS_NAME}/ransac_based/rigid_transform_space.h
include/pcl/${SUBSYS_NAME}/ransac_based/obj_rec_ransac.h
Expand All @@ -48,12 +48,11 @@ if(build)
include/pcl/${SUBSYS_NAME}/ransac_based/simple_octree.h
include/pcl/${SUBSYS_NAME}/ransac_based/voxel_structure.h
include/pcl/${SUBSYS_NAME}/ransac_based/bvh.h

)

set (ransac_based_incs
include/pcl/${SUBSYS_NAME}/ransac_based/auxiliary.h
include/pcl/${SUBSYS_NAME}/ransac_based/hypothesis.h
set(ransac_based_incs
include/pcl/${SUBSYS_NAME}/ransac_based/auxiliary.h
include/pcl/${SUBSYS_NAME}/ransac_based/hypothesis.h
include/pcl/${SUBSYS_NAME}/ransac_based/model_library.h
include/pcl/${SUBSYS_NAME}/ransac_based/rigid_transform_space.h
include/pcl/${SUBSYS_NAME}/ransac_based/obj_rec_ransac.h
Expand All @@ -66,50 +65,46 @@ if(build)
include/pcl/${SUBSYS_NAME}/ransac_based/bvh.h
)


set(hv_incs
include/pcl/${SUBSYS_NAME}/hv/occlusion_reasoning.h
include/pcl/${SUBSYS_NAME}/hv/hypotheses_verification.h
include/pcl/${SUBSYS_NAME}/hv/hv_papazov.h
include/pcl/${SUBSYS_NAME}/hv/hv_go.h
include/pcl/${SUBSYS_NAME}/hv/greedy_verification.h
)
)

set(face_detection_incs
include/pcl/${SUBSYS_NAME}/face_detection/face_common.h
include/pcl/${SUBSYS_NAME}/face_detection/face_detector_data_provider.h
include/pcl/${SUBSYS_NAME}/face_detection/rf_face_detector_trainer.h
include/pcl/${SUBSYS_NAME}/face_detection/rf_face_utils.h
)
include/pcl/${SUBSYS_NAME}/face_detection/face_common.h
include/pcl/${SUBSYS_NAME}/face_detection/face_detector_data_provider.h
include/pcl/${SUBSYS_NAME}/face_detection/rf_face_detector_trainer.h
include/pcl/${SUBSYS_NAME}/face_detection/rf_face_utils.h
)

set(cg_incs
include/pcl/${SUBSYS_NAME}/cg/correspondence_grouping.h
include/pcl/${SUBSYS_NAME}/cg/hough_3d.h
include/pcl/${SUBSYS_NAME}/cg/geometric_consistency.h
)


set(impl_incs
include/pcl/${SUBSYS_NAME}/impl/linemod/line_rgbd.hpp
include/pcl/${SUBSYS_NAME}/impl/ransac_based/simple_octree.hpp
include/pcl/${SUBSYS_NAME}/impl/ransac_based/voxel_structure.hpp
include/pcl/${SUBSYS_NAME}/impl/implicit_shape_model.hpp
include/pcl/${SUBSYS_NAME}/impl/implicit_shape_model.hpp
)


set(ransac_based_impl_incs
include/pcl/${SUBSYS_NAME}/impl/ransac_based/simple_octree.hpp
set(ransac_based_impl_incs
include/pcl/${SUBSYS_NAME}/impl/ransac_based/simple_octree.hpp
include/pcl/${SUBSYS_NAME}/impl/ransac_based/voxel_structure.hpp
)


set(hv_impl_incs
include/pcl/${SUBSYS_NAME}/impl/hv/occlusion_reasoning.hpp
include/pcl/${SUBSYS_NAME}/impl/hv/hv_papazov.hpp
include/pcl/${SUBSYS_NAME}/impl/hv/greedy_verification.hpp
include/pcl/${SUBSYS_NAME}/impl/hv/hv_go.hpp
)
)

set(cg_impl_incs
include/pcl/${SUBSYS_NAME}/impl/cg/correspondence_grouping.hpp
include/pcl/${SUBSYS_NAME}/impl/cg/hough_3d.hpp
Expand All @@ -133,23 +128,32 @@ if(build)
src/ransac_based/orr_octree_zprojection.cpp
src/face_detection/face_detector_data_provider.cpp
src/face_detection/rf_face_detector_trainer.cpp
src/implicit_shape_model.cpp
src/implicit_shape_model.cpp
)

set(metslib_incs
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/abstract-search.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/local-search.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/mets.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/metslib_config.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/model.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/observer.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/simulated-annealing.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/tabu-search.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/termination-criteria.hh
)
if (HAVE_METSLIB)
set(metslib_incs "")
else(HAVE_METSLIB)
set(metslib_incs
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/abstract-search.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/local-search.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/mets.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/metslib_config.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/model.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/observer.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/simulated-annealing.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/tabu-search.hh
include/pcl/${SUBSYS_NAME}/3rdparty/metslib/termination-criteria.hh
)
endif(HAVE_METSLIB)

set(LIB_NAME pcl_${SUBSYS_NAME})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
if (HAVE_METSLIB)
include_directories(${METSLIB_INCLUDE_DIRS})
else(HAVE_METSLIB)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/pcl/recognition/3rdparty/)
endif(HAVE_METSLIB)
PCL_ADD_LIBRARY(${LIB_NAME} ${SUBSYS_NAME} ${srcs} ${incs} ${impl_incs} ${face_detection_incs} ${ransac_based_incs} ${ransac_based_impl_incs} ${hv_incs} ${hv_impl_incs} ${cg_incs} ${cg_impl_incs} ${metslib_incs})
target_link_libraries(${LIB_NAME} pcl_common pcl_kdtree pcl_octree pcl_search pcl_features pcl_registration pcl_sample_consensus pcl_filters pcl_ml pcl_io)
PCL_MAKE_PKGCONFIG(${LIB_NAME} ${SUBSYS_NAME} "${SUBSYS_DESC}" "${SUBSYS_DEPS}" "" "" "" "")
Expand Down
2 changes: 1 addition & 1 deletion recognition/include/pcl/recognition/hv/hv_go.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <pcl/pcl_macros.h>
#include <pcl/recognition/hv/hypotheses_verification.h>
#include <pcl/common/common.h>
#include "pcl/recognition/3rdparty/metslib/mets.hh"
#include "metslib/mets.hh"
#include <pcl/features/normal_3d.h>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
Expand Down

0 comments on commit 2c872f5

Please sign in to comment.