Skip to content

Commit

Permalink
Merge pull request PointCloudLibrary#1247 from taketwo/remove-build-o…
Browse files Browse the repository at this point in the history
…penni

Remove redundant cmake BUILD_* options for grabbers
  • Loading branch information
jspricke committed Aug 24, 2015
2 parents 967912d + d0b960d commit 0748bd7
Show file tree
Hide file tree
Showing 20 changed files with 134 additions and 195 deletions.
74 changes: 11 additions & 63 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ if(OPENMP_FOUND)
else(OPENMP_FOUND)
message (STATUS "Not found OpenMP")
endif()
# Boost (required)
include("${PCL_SOURCE_DIR}/cmake/pcl_find_boost.cmake")

# Eigen (required)
find_package(Eigen REQUIRED)
include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS})
Expand All @@ -256,67 +255,13 @@ if(WITH_LIBUSB)
endif(LIBUSB_1_FOUND)
endif(WITH_LIBUSB)

# OpenNI
option(WITH_OPENNI "OpenNI driver support" TRUE)
if(WITH_OPENNI)
find_package(OpenNI)
if (OPENNI_FOUND)
set(HAVE_OPENNI ON)
include_directories(SYSTEM ${OPENNI_INCLUDE_DIRS})
endif(OPENNI_FOUND)
endif(WITH_OPENNI)

# OpenNI 2
option(WITH_OPENNI2 "OpenNI 2 driver support" TRUE)
if(WITH_OPENNI2)
find_package(OpenNI2)
if (OPENNI2_FOUND)
set(HAVE_OPENNI2 ON)
include_directories(SYSTEM ${OPENNI2_INCLUDE_DIRS})
endif(OPENNI2_FOUND)
endif(WITH_OPENNI2)

# Fotonic (FZ_API)
option(WITH_FZAPI "Build Fotonic Camera support" TRUE)
if(WITH_FZAPI)
find_package(FZAPI)
if (FZAPI_FOUND)
set(HAVE_FZAPI ON)
include_directories(SYSTEM "${FZAPI_INCLUDE_DIR}")
endif(FZAPI_FOUND)
endif(WITH_FZAPI)

# IDS-Imaging - Ensenso
option(WITH_ENSENSO "Build IDS-Imaging Ensenso's camera support" TRUE)
if(WITH_ENSENSO)
set(ENSENSO_ABI_DIR "ENSENSO_ABI_DIR-NOTFOUND" CACHE PATH "directory of Ensenso ABI")
find_package(Ensenso) # FindEnsenso.cmake
if (ENSENSO_FOUND)
set(HAVE_ENSENSO ON)
include_directories(SYSTEM "${ENSENSO_INCLUDE_DIRS}")
endif(ENSENSO_FOUND)
endif(WITH_ENSENSO)

# David Vision Systems - davidSDK
option(WITH_DAVIDSDK "Build davidSDK support" TRUE)
if(WITH_DAVIDSDK)
set(DAVIDSDK_ABI_DIR "davidSDK_ABI_DIR-NOTFOUND" CACHE PATH "directory of davidSDK ABI")
find_package(davidSDK) # FinddavidSDK.cmake
if (DAVIDSDK_FOUND)
set(HAVE_DAVIDSDK ON)
include_directories(SYSTEM "${DAVIDSDK_INCLUDE_DIRS}")
endif(DAVIDSDK_FOUND)
endif(WITH_DAVIDSDK)

# Intel Perceptional Computing Interface (PXCAPI)
option(WITH_PXCAPI "Build PXC Device support" TRUE)
if(WITH_PXCAPI)
find_package(PXCAPI)
if (PXCAPI_FOUND)
set(HAVE_PXCAPI ON)
include_directories(SYSTEM ${PXCAPI_INCLUDE_DIRS})
endif(PXCAPI_FOUND)
endif(WITH_PXCAPI)
# Dependencies for different grabbers
PCL_ADD_GRABBER_DEPENDENCY("OpenNI" "OpenNI grabber support")
PCL_ADD_GRABBER_DEPENDENCY("OpenNI2" "OpenNI2 grabber support")
PCL_ADD_GRABBER_DEPENDENCY("FZAPI" "Fotonic camera support")
PCL_ADD_GRABBER_DEPENDENCY("Ensenso" "IDS-Imaging Ensenso camera support")
PCL_ADD_GRABBER_DEPENDENCY("davidSDK" "David Vision Systems SDK support")
PCL_ADD_GRABBER_DEPENDENCY("PXCAPI" "Intel PXC device support")

# metslib
if (PKG_CONFIG_FOUND)
Expand Down Expand Up @@ -421,6 +366,9 @@ if(WITH_OPENGL)
include("${PCL_SOURCE_DIR}/cmake/pcl_find_gl.cmake")
endif(WITH_OPENGL)

# Boost (required)
include("${PCL_SOURCE_DIR}/cmake/pcl_find_boost.cmake")

### ---[ Create the config.h file
set(pcl_config_h_in "${CMAKE_CURRENT_SOURCE_DIR}/pcl_config.h.in")
set(pcl_config_h "${CMAKE_CURRENT_BINARY_DIR}/include/pcl/pcl_config.h")
Expand Down
6 changes: 3 additions & 3 deletions apps/3d_rec_framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ else(NOT VTK_FOUND)
endif(NOT VTK_FOUND)

# OpenNI found?
if(NOT OPENNI_FOUND OR NOT BUILD_OPENNI)
if(NOT WITH_OPENNI)
set(DEFAULT AUTO_OFF)
set(REASON "OpenNI was not found or was disabled by the user.")
elseif(NOT ${DEFAULT} STREQUAL "AUTO_OFF")
Expand Down Expand Up @@ -88,13 +88,13 @@ if(build)
PCL_ADD_LIBRARY("${LIB_NAME}" "${SUBSUBSYS_NAME}" ${srcs} ${impl_incs_pipeline} ${incs_utils} ${incs_fw} ${incs_fw_global} ${incs_fw_local} ${incc_tools_framework} ${incs_pipelines} ${incs_pc_source})
target_link_libraries("${LIB_NAME}" pcl_apps pcl_common pcl_io pcl_filters pcl_visualization pcl_segmentation pcl_surface pcl_features pcl_sample_consensus pcl_search)

if(OPENNI_FOUND)
if(WITH_OPENNI)
target_link_libraries("${LIB_NAME}" ${OPENNI_LIBRARIES})
if(NOT WIN32)
find_package(libusb-1.0 REQUIRED)
target_link_libraries("${LIB_NAME}" ${LIBUSB_1_LIBRARIES})
endif()
endif(OPENNI_FOUND)
endif()

PCL_MAKE_PKGCONFIG("${LIB_NAME}" "${SUBSUBSYS_NAME}" "${SUBSUBSYS_DESC}" "" "" "" "" "")

Expand Down
4 changes: 2 additions & 2 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ if(build)

endif (QT4_FOUND AND VTK_USE_QVTK)

if (OPENNI_FOUND AND BUILD_OPENNI)
if (WITH_OPENNI)

# PCL_ADD_EXECUTABLE_OPT_BUNDLE(pcl_openni_grab_frame "${SUBSYS_NAME}" src/openni_grab_frame.cpp)
# target_link_libraries(pcl_openni_grab_frame pcl_common pcl_io pcl_visualization)
Expand Down Expand Up @@ -199,7 +199,7 @@ if(build)

PCL_ADD_EXECUTABLE_OPT_BUNDLE(pcl_openni_klt "${SUBSYS_NAME}" src/openni_klt.cpp)
target_link_libraries(pcl_openni_klt pcl_common pcl_io pcl_visualization pcl_tracking)
endif() # OPENNI_FOUND + BUILD_OPENNI
endif() # WITH_OPENNI

endif() # VTK_FOUND

Expand Down
2 changes: 1 addition & 1 deletion apps/in_hand_scanner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ elseif(NOT ${DEFAULT} STREQUAL "AUTO_OFF")
endif()

#OpenNI
if(NOT OPENNI_FOUND OR NOT BUILD_OPENNI)
if(NOT WITH_OPENNI)
set(DEFAULT AUTO_OFF)
set(REASON "OpenNI was not found or was disabled by the user.")
elseif(NOT ${DEFAULT} STREQUAL "AUTO_OFF")
Expand Down
4 changes: 2 additions & 2 deletions cmake/Modules/FindFZAPI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FZAPI DEFAULT_MSG
FZAPI_LIBS FZAPI_INCLUDE_DIR)

FZAPI_LIBS FZAPI_INCLUDE_DIRS)

2 changes: 1 addition & 1 deletion cmake/pcl_find_boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if(Boost_SERIALIZATION_FOUND)
endif(Boost_SERIALIZATION_FOUND)

# Required boost modules
if(BUILD_OPENNI2)
if(WITH_OPENNI2)
set(BOOST_REQUIRED_MODULES system filesystem thread date_time iostreams chrono)
find_package(Boost 1.47.0 REQUIRED COMPONENTS ${BOOST_REQUIRED_MODULES})
else()
Expand Down
24 changes: 24 additions & 0 deletions cmake/pcl_targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -905,3 +905,27 @@ macro (PCL_ADD_DOC _subsys)
endif(USE_PROJECT_FOLDERS)
endif(DOXYGEN_FOUND)
endmacro(PCL_ADD_DOC)

###############################################################################
# Add a dependency for a grabber
# _name The dependency name.
# _description The description text to display when dependency is not found.
# This macro adds on option named "WITH_NAME", where NAME is the capitalized
# dependency name. The user may use this option to control whether the
# corresponding grabber should be built or not. Also an attempt to find a
# package with the given name is made. If it is not successfull, then the
# "WITH_NAME" option is coerced to FALSE.
macro(PCL_ADD_GRABBER_DEPENDENCY _name _description)
string(TOUPPER ${_name} _name_capitalized)
option(WITH_${_name_capitalized} "${_description}" TRUE)
if(WITH_${_name_capitalized})
find_package(${_name})
if (NOT ${_name_capitalized}_FOUND)
set(WITH_${_name_capitalized} FALSE CACHE BOOL "${_description}" FORCE)
message(WARNING "${_description}: not building because ${_name} not found")
else()
set(HAVE_${_name_capitalized} TRUE)
include_directories(SYSTEM "${${_name_capitalized}_INCLUDE_DIRS}")
endif()
endif()
endmacro(PCL_ADD_GRABBER_DEPENDENCY)
4 changes: 2 additions & 2 deletions cuda/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ mark_as_advanced("BUILD_${SUBSYS_NAME}")
PCL_SUBSYS_DEPEND(build "${SUBSYS_NAME}" DEPS ${SUBSYS_DEPS})

if(build)
if(VTK_FOUND AND OPENNI_FOUND AND BUILD_OPENNI)
if(VTK_FOUND AND WITH_OPENNI)

PCL_CUDA_ADD_EXECUTABLE(kinect_viewer_cuda "${SUBSYS_NAME}" src/kinect_viewer_cuda.cpp)
target_link_libraries (kinect_viewer_cuda pcl_io pcl_cuda_io pcl_visualization pcl_common pcl_kdtree)

endif(VTK_FOUND AND OPENNI_FOUND AND BUILD_OPENNI)
endif()
endif(build)


Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/content/ensenso_cameras.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The default following values can be tweaked into cmake if you don't have a stand
ENSENSO_ABI_DIR /opt/ensenso_test/development/c
You can deactivate building the Ensenso support by setting ``BUILD_ENSENSO`` to false.
You can deactivate building the Ensenso support by setting ``WITH_ENSENSO`` to false.
Compile and install PCL.

Using the example
Expand Down
2 changes: 1 addition & 1 deletion gpu/kinfu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(SUBSYS_DEPS common io gpu_containers geometry search visualization)
set(build FALSE)

# OpenNI found?
if(NOT OPENNI_FOUND OR NOT BUILD_OPENNI)
if(NOT WITH_OPENNI)
set(DEFAULT FALSE)
set(REASON "OpenNI was not found or was disabled by the user.")
else()
Expand Down
4 changes: 2 additions & 2 deletions gpu/kinfu/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(OPENNI_FOUND)
if(WITH_OPENNI)
if(NOT VTK_FOUND)
set(DEFAULT FALSE)
set(REASON "VTK was not found.")
Expand Down Expand Up @@ -57,4 +57,4 @@ if(OPENNI_FOUND)
# endif(GLUT_FOUND)
#endif (GLEW_FOUND)

endif(OPENNI_FOUND)
endif()
2 changes: 1 addition & 1 deletion gpu/kinfu_large_scale/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(SUBSYS_DEPS common visualization io gpu_containers gpu_utils geometry search
set(build FALSE)

# OpenNI found?
if(NOT OPENNI_FOUND OR NOT BUILD_OPENNI)
if(NOT WITH_OPENNI)
set(DEFAULT FALSE)
set(REASON "OpenNI was not found or was disabled by the user.")
else()
Expand Down
4 changes: 2 additions & 2 deletions gpu/kinfu_large_scale/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(OPENNI_FOUND)
if(WITH_OPENNI)
if(NOT VTK_FOUND)
set(DEFAULT FALSE)
set(REASON "VTK was not found.")
Expand Down Expand Up @@ -47,4 +47,4 @@ if(OPENNI_FOUND)
target_link_libraries("${the_target}" pcl_common pcl_io ${OPENNI_LIBRARIES} pcl_visualization pcl_gpu_kinfu_large_scale pcl_filters)


endif(OPENNI_FOUND)
endif()
Loading

0 comments on commit 0748bd7

Please sign in to comment.