https://github.com/PointCloudLibrary/pcl
Raw File
Tip revision: 2d643324990ec14838846d9a509b7e07faedce30 authored by Jochen Sprickerhof on 30 August 2011, 20:40:06 UTC
syncing trunk to pcl-1.x and pcl-1.1.x (apps, common)
Tip revision: 2d64332
PCLConfig.cmake.in
# ------------------------------------------------------------------------------------
# Helper to use PCL from outside project
#
# target_link_libraries(my_fabulous_target pcl_xxx) where xxx is in
# - common
# - cuda
# - features
# - filters
# - io
# - kdtree
# - keypoints
# - octree
# - range_image
# - range_image_border_extractor
# - registration
# - sample_consensus
# - segmentation
# - surface
# - visualization
#
# For compatibility reason we also provide PCL_XXX_LIBRARY, PCL_XXX_LIBRARY_DEBUG
# and PCL_XXX_LIBRARIES where XXX is upper cased xxx from the components above.
#
# PCL_INCLUDE_DIRS is filled with PCL and available 3rdparty headers
# PCL_LIBRARY_DIRS is filled with PCL components libraries install directory and
# 3rdparty libraries paths
# 
# Tested with:
# - PCL 1.0
# - PCL 1.0.1
#
#                                   www.pointclouds.org
#------------------------------------------------------------------------------------

set(PCL_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_ROOT@")
set(PCL_LIBRARY_DIRS "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@")
include("@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@/pcl/PCLDepends.cmake")

if("@PCL_SUBSYS_STATUS_common@" STREQUAL "TRUE")
  list(APPEND PCL_COMPONENTS common)
endif("@PCL_SUBSYS_STATUS_common@" STREQUAL "TRUE")

if("@PCL_SUBSYS_STATUS_io@" STREQUAL "TRUE")
  list(APPEND PCL_COMPONENTS io)
endif("@PCL_SUBSYS_STATUS_io@" STREQUAL "TRUE")

if("@PCL_SUBSYS_STATUS_filters@" STREQUAL "TRUE")
  list(APPEND PCL_COMPONENTS filters)
endif("@PCL_SUBSYS_STATUS_filters@" STREQUAL "TRUE")

if("@PCL_SUBSYS_STATUS_features@" STREQUAL "TRUE")
  list(APPEND PCL_COMPONENTS features)
endif("@PCL_SUBSYS_STATUS_features@" STREQUAL "TRUE")

if("@PCL_SUBSYS_STATUS_kdtree@" STREQUAL "TRUE")
  list(APPEND PCL_COMPONENTS kdtree)
endif("@PCL_SUBSYS_STATUS_kdtree@" STREQUAL "TRUE")

if("@PCL_SUBSYS_STATUS_octree@" STREQUAL "TRUE")
  list(APPEND PCL_COMPONENTS octree)
endif("@PCL_SUBSYS_STATUS_octree@" STREQUAL "TRUE")

if("@PCL_SUBSYS_STATUS_range_image@" STREQUAL "TRUE")
  list(APPEND PCL_COMPONENTS range_image)
  list(APPEND PCL_COMPONENTS range_image_border_extractor)
endif("@PCL_SUBSYS_STATUS_range_image@" STREQUAL "TRUE")

if("@PCL_SUBSYS_STATUS_surface@" STREQUAL "TRUE")
  list(APPEND PCL_COMPONENTS surface)
endif("@PCL_SUBSYS_STATUS_surface@" STREQUAL "TRUE")

if("@PCL_SUBSYS_STATUS_sample_consensus@" STREQUAL "TRUE")
  list(APPEND PCL_COMPONENTS sample_consensus)
endif("@PCL_SUBSYS_STATUS_sample_consensus@" STREQUAL "TRUE")

if("@PCL_SUBSYS_STATUS_registration@" STREQUAL "TRUE")
  list(APPEND PCL_COMPONENTS registration)
endif("@PCL_SUBSYS_STATUS_registration@" STREQUAL "TRUE")

if("@PCL_SUBSYS_STATUS_segmentation@" STREQUAL "TRUE")
  list(APPEND PCL_COMPONENTS segmentation)
endif("@PCL_SUBSYS_STATUS_segmentation@" STREQUAL "TRUE")

if("@PCL_SUBSYS_STATUS_visualization@" STREQUAL "TRUE")
  list(APPEND PCL_COMPONENTS visualization)
endif("@PCL_SUBSYS_STATUS_visualization@" STREQUAL "TRUE")

if("@PCL_SUBSYS_STATUS_keypoints@" STREQUAL "TRUE")
  list(APPEND PCL_COMPONENTS keypoints)
endif("@PCL_SUBSYS_STATUS_keypoints@" STREQUAL "TRUE")

if("@PCL_SUBSYS_STATUS_cuda@" STREQUAL "TRUE")
  list(APPEND PCL_COMPONENTS cuda)
endif("@PCL_SUBSYS_STATUS_cuda@" STREQUAL "TRUE")

if(PCL_FIND_COMPONENTS)
  foreach(comp ${PCL_FIND_COMPONENTS})
    list(FIND PCL_COMPONENTS ${comp} found)
    if(found EQUAL -1)
      message(FATAL_ERROR "requested components ${comp} not found")
    else(found EQUAL -1)
      string(TOUPPER "${comp}" COMP)
      set(PCL_${COMP}_LIBRARY pcl_${comp})
      set(PCL_${COMP}_LIBRARY_DEBUG pcl_${comp})
      get_target_property(CONFIGURATIONS pcl_${comp} IMPORTED_CONFIGURATIONS)
      list(FIND CONFIGURATIONS DEBUG debug_found)
      if(debug_found EQUAL -1 AND WIN32)
        message("${comp} not installed in Debug configuration, using default!")
      endif(debug_found EQUAL -1 AND WIN32)
      set(PCL_${COMP}_LIBRARIES pcl_${comp})
      list(APPEND PCL_LIBRARIES ${PCL_${COMP}_LIBRARIES})
    endif(found EQUAL -1)
  endforeach(comp)
else(PCL_FIND_COMPONENTS)
  foreach(comp ${PCL_COMPONENTS})
    string(TOUPPER "${comp}" COMP)
    set(PCL_${COMP}_LIBRARY pcl_${comp})
    set(PCL_${COMP}_LIBRARY_DEBUG pcl_${comp})
    get_target_property(CONFIGURATIONS pcl_${comp} IMPORTED_CONFIGURATIONS)
    list(FIND CONFIGURATIONS DEBUG debug_found)
    if(debug_found EQUAL -1 AND WIN32)
      message("${comp} not installed in Debug configuration, using default!")
    endif(debug_found EQUAL -1 AND WIN32)
    set(PCL_${COMP}_LIBRARIES pcl_${comp})
    list(APPEND PCL_LIBRARIES ${PCL_${COMP}_LIBRARIES})
  endforeach(comp)
endif(PCL_FIND_COMPONENTS)

##
# append 3rd party stuff
##
list(APPEND PCL_INCLUDE_DIRS "@Boost_INCLUDE_DIR@")

list(APPEND PCL_INCLUDE_DIRS "@FLANN_INCLUDE_DIRS@")

list(APPEND PCL_INCLUDE_DIRS "@CMINPACK_INCLUDE_DIRS@")

list(APPEND PCL_INCLUDE_DIRS "@EIGEN_INCLUDE_DIRS@")

list(APPEND PCL_INCLUDE_DIRS "@CMINPACK_INCLUDE_DIRS@")

if("@HAVE_OPENNI@" STREQUAL "ON")
  list(APPEND PCL_INCLUDE_DIRS "@OPENNI_INCLUDE_DIRS@")
endif("@HAVE_OPENNI@" STREQUAL "ON")

if("@HAVE_QHULL@" STREQUAL "ON")
  list(APPEND PCL_INCLUDE_DIRS "@QHULL_INCLUDE_DIRS@")
endif("@HAVE_QHULL@" STREQUAL "ON")

if("@HAVE_WXWIDGETS@" STREQUAL "ON")
  find_package(wxWidgets REQUIRED)
  include("@wxWidgets_USE_FILE@")
  list(APPEND PCL_INCLUDE_DIRS "@wxWidgets_INCLUDE_DIRS@")
  list(APPEND PCL_LIBRARY_DIRS "@wxWidgets_LIBRARY_DIRS@")
endif ("@HAVE_WXWIDGETS@" STREQUAL "ON")

if("@HAVE_VTK@" STREQUAL "ON")
  set(VTK_DIR "@VTK_DIR@")
  find_package(VTK REQUIRED)
  include ("${VTK_USE_FILE}")
  list(APPEND PCL_INCLUDE_DIRS "${VTK_INCLUDE_DIRS}")
  list(APPEND PCL_LIBRARY_DIRS "${VTK_LIBRARY_DIRS}")
endif("@HAVE_VTK@" STREQUAL "ON")

list(SORT PCL_INCLUDE_DIRS)
list(REMOVE_DUPLICATES PCL_INCLUDE_DIRS)

##
# Add some definitions for eigen sake
##
add_definitions(-DEIGEN_USE_NEW_STDVECTOR 
                -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET)

##
# those are for windows sake
##
if(MSVC)
  add_definitions(-DBOOST_ALL_NO_LIB)
  if("@FLANN_LIBRARY@" MATCHES "flann_cpp_s")
    add_definitions(-DFLANN_STATIC)
  endif("@FLANN_LIBRARY@" MATCHES "flann_cpp_s")
  if("@CMINPACK_LIBRARY@" MATCHES "cminpack_s")
    add_definitions(-DCMINPACK_NO_DLL)
  endif("@CMINPACK_LIBRARY@" MATCHES "cminpack_s")
endif(MSVC)
back to top