Permalink
Browse files

Check WITH_* variables instead of *_FOUND and BUILD_* everywhere in C…

…Make scriptst
  • Loading branch information...
1 parent 55deacd commit d0b960da7128a942324df23501cf4c56ef69ad15 @taketwo taketwo committed Aug 23, 2015
@@ -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")
@@ -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}" "" "" "" "" "")
View
@@ -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)
@@ -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
@@ -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")
@@ -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()
@@ -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)
@@ -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
@@ -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()
@@ -1,4 +1,4 @@
-if(OPENNI_FOUND)
+if(WITH_OPENNI)
if(NOT VTK_FOUND)
set(DEFAULT FALSE)
set(REASON "VTK was not found.")
@@ -57,4 +57,4 @@ if(OPENNI_FOUND)
# endif(GLUT_FOUND)
#endif (GLEW_FOUND)
-endif(OPENNI_FOUND)
+endif()
@@ -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()
@@ -1,4 +1,4 @@
-if(OPENNI_FOUND)
+if(WITH_OPENNI)
if(NOT VTK_FOUND)
set(DEFAULT FALSE)
set(REASON "VTK was not found.")
@@ -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()
View
@@ -13,30 +13,22 @@ endif(WIN32)
PCL_ADD_DOC("${SUBSYS_NAME}")
if(build)
- ## OpenNI 2.x
- OPTION(BUILD_OPENNI2 "Build the OpenNI 2 Grabber." OFF)
- MARK_AS_ADVANCED(BUILD_OPENNI2)
- if(NOT BUILD_OPENNI2)
- # Set OPENNI2_FOUND to false locally to avoid building anything OpenNI 2 related
- # Remember that other modules (libraries) need to check explicitly for BUILD_OPENNI2
- set(OPENNI2_FOUND FALSE)
- endif()
- if(OPENNI2_FOUND)
- set(IMAGE_INCLUDES
- include/pcl/io/image_metadata_wrapper.h
- include/pcl/io/image.h
- include/pcl/io/image_rgb24.h
- include/pcl/io/image_yuv422.h
- include/pcl/io/image_ir.h
- include/pcl/io/image_depth.h
- )
-
- set(IMAGE_SOURCES
- src/image_rgb24.cpp
- src/image_yuv422.cpp
- src/image_ir.cpp
- src/image_depth.cpp
- )
+ if(WITH_OPENNI2)
+ set(IMAGE_INCLUDES
+ include/pcl/io/image_metadata_wrapper.h
+ include/pcl/io/image.h
+ include/pcl/io/image_rgb24.h
+ include/pcl/io/image_yuv422.h
+ include/pcl/io/image_ir.h
+ include/pcl/io/image_depth.h
+ )
+
+ set(IMAGE_SOURCES
+ src/image_rgb24.cpp
+ src/image_yuv422.cpp
+ src/image_ir.cpp
+ src/image_depth.cpp
+ )
set(OPENNI2_GRABBER_INCLUDES
include/pcl/io/openni2_grabber.h
@@ -70,17 +62,9 @@ if(build)
if(MSVC)
file(COPY ${OPENNI2_REDIST_DIR} DESTINATION ${CMAKE_BINARY_DIR}/bin PATTERN *.*)
endif(MSVC)
- endif(OPENNI2_FOUND)
-
- ## OpenNI 1.x
- OPTION(BUILD_OPENNI "Build the OpenNI Grabber." ON)
- MARK_AS_ADVANCED(BUILD_OPENNI)
- if(NOT BUILD_OPENNI)
- # Set OPENNI_FOUND to false locally to avoid building anything OpenNI related
- # Remember that other modules (libraries) need to check explicitly for BUILD_OPENNI
- set(OPENNI_FOUND FALSE)
endif()
- if(OPENNI_FOUND)
+
+ if(WITH_OPENNI)
set(OPENNI_GRABBER_INCLUDES
include/pcl/io/openni_grabber.h
include/pcl/io/oni_grabber.h
@@ -120,12 +104,12 @@ if(build)
src/oni_grabber.cpp
${IMAGE_SOURCES}
)
- endif(OPENNI_FOUND)
+ endif()
source_group("Image Headers" FILES ${IMAGE_INCLUDES})
source_group("Image Sources" FILES ${IMAGE_SOURCES})
- if(FZAPI_FOUND)
+ if(WITH_FZAPI)
set(FZAPI_GRABBER_INCLUDES
include/pcl/io/fotonic_grabber.h
)
@@ -135,50 +119,34 @@ if(build)
set(FZAPI_GRABBER_SOURCES
src/fotonic_grabber.cpp
)
- endif(FZAPI_FOUND)
-
- ## Ensenso
- OPTION(BUILD_ENSENSO "Build the Ensenso Grabber." ON)
- MARK_AS_ADVANCED(BUILD_ENSENSO)
- if(NOT BUILD_ENSENSO)
- # Set ENSENSO_FOUND to false locally to avoid building anything Ensenso related
- # Remember that other modules (libraries) need to check explicitly for BUILD_ENSENSO
- set(ENSENSO_FOUND FALSE)
endif()
- if(ENSENSO_FOUND)
+
+ if(WITH_ENSENSO)
set(ENSENSO_GRABBER_INCLUDES
include/pcl/io/ensenso_grabber.h
)
set(ENSENSO_GRABBER_SOURCES
src/ensenso_grabber.cpp
)
- endif(ENSENSO_FOUND)
-
- ## davidSDK
- OPTION(BUILD_DAVIDSDK "Build the davidSDK Grabber." ON)
- MARK_AS_ADVANCED(BUILD_DAVIDSDK)
- if(NOT BUILD_DAVIDSDK)
- # Set DAVIDSDK_FOUND to false locally to avoid building anything davidSDK related
- # Remember that other modules (libraries) need to check explicitly for BUILD_DAVIDSDK
- set(DAVIDSDK_FOUND FALSE)
endif()
- if(DAVIDSDK_FOUND)
+
+ if(WITH_DAVIDSDK)
set(DAVIDSDK_GRABBER_INCLUDES
include/pcl/io/davidsdk_grabber.h
)
set(DAVIDSDK_GRABBER_SOURCES
src/davidsdk_grabber.cpp
)
- endif(DAVIDSDK_FOUND)
+ endif()
- if(PXCAPI_FOUND)
- set(PXC_GRABBER_INCLUDES
- include/pcl/io/pxc_grabber.h
- )
- set(PXC_GRABBER_SOURCES
- src/pxc_grabber.cpp
- )
- endif(PXCAPI_FOUND)
+ if(WITH_PXCAPI)
+ set(PXC_GRABBER_INCLUDES
+ include/pcl/io/pxc_grabber.h
+ )
+ set(PXC_GRABBER_SOURCES
+ src/pxc_grabber.cpp
+ )
+ endif()
if(LIBUSB_1_FOUND)
set(DINAST_GRABBER_INCLUDES
@@ -303,11 +271,11 @@ if(build)
include/pcl/compression/organized_pointcloud_conversion.h
include/pcl/compression/libpng_wrapper.h
)
- if(OPENNI_FOUND OR OPENNI2_FOUND)
+ if(WITH_OPENNI OR WITH_OPENNI2)
list(APPEND compression_incs
include/pcl/compression/organized_pointcloud_compression.h
)
- endif(OPENNI_FOUND OR OPENNI2_FOUND)
+ endif()
endif(PNG_FOUND)
set(impl_incs
@@ -319,11 +287,11 @@ if(build)
include/pcl/compression/impl/octree_pointcloud_compression.hpp
${VTK_IO_INCLUDES_IMPL}
)
- if(PNG_FOUND AND (OPENNI_FOUND OR OPENNI2_FOUND) )
+ if(PNG_FOUND AND (WITH_OPENNI OR WITH_OPENNI2))
list(APPEND impl_incs
include/pcl/compression/impl/organized_pointcloud_compression.hpp
)
- endif(PNG_FOUND AND (OPENNI_FOUND OR OPENNI2_FOUND) )
+ endif()
set(LIB_NAME "pcl_${SUBSYS_NAME}")
@@ -340,49 +308,49 @@ if(build)
target_link_libraries("${LIB_NAME}" ${LIBUSB_1_LIBRARIES})
endif(LIBUSB_1_FOUND)
- if(OPENNI2_FOUND)
+ if(WITH_OPENNI2)
target_link_libraries(${LIB_NAME} ${OPENNI2_LIBRARIES})
- endif(OPENNI2_FOUND)
+ endif()
- if(OPENNI_FOUND)
+ if(WITH_OPENNI)
target_link_libraries("${LIB_NAME}" ${OPENNI_LIBRARIES})
- endif(OPENNI_FOUND)
+ endif()
- if(FZAPI_FOUND)
+ if(WITH_FZAPI)
target_link_libraries("${LIB_NAME}" ${FZAPI_LIBS})
- if(WIN32)
- target_link_libraries("${LIB_NAME}" Version.lib)
- endif(WIN32)
- endif(FZAPI_FOUND)
+ if(WIN32)
+ target_link_libraries("${LIB_NAME}" Version.lib)
+ endif(WIN32)
+ endif()
- if(ENSENSO_FOUND)
+ if(WITH_ENSENSO)
target_link_libraries(${LIB_NAME} ${ENSENSO_LIBRARIES})
- endif(ENSENSO_FOUND)
+ endif()
- if(DAVIDSDK_FOUND)
+ if(WITH_DAVIDSDK)
target_link_libraries(${LIB_NAME} ${DAVIDSDK_LIBRARIES})
- endif(DAVIDSDK_FOUND)
+ endif()
- if(PXCAPI_FOUND)
- link_directories(${PXCAPI_LIB_DIRS})
- target_link_libraries("${LIB_NAME}" ${PXCAPI_LIBS})
- endif(PXCAPI_FOUND)
+ if(WITH_PXCAPI)
+ link_directories(${PXCAPI_LIB_DIRS})
+ target_link_libraries("${LIB_NAME}" ${PXCAPI_LIBS})
+ endif()
if (PCAP_FOUND)
target_link_libraries("${LIB_NAME}" ${PCAP_LIBRARIES})
endif(PCAP_FOUND)
set(EXT_DEPS eigen3)
- if(OPENNI_FOUND)
+ if(WITH_OPENNI)
list(APPEND EXT_DEPS libopenni)
- endif(OPENNI_FOUND)
- if(OPENNI2_FOUND)
+ endif()
+ if(WITH_OPENNI2)
list(APPEND EXT_DEPS libopenni2)
- endif(OPENNI2_FOUND)
- if(ENSENSO_FOUND)
+ endif()
+ if(WITH_ENSENSO)
list(APPEND EXT_DEPS ensenso)
- endif(ENSENSO_FOUND)
+ endif()
PCL_MAKE_PKGCONFIG("${LIB_NAME}" "${SUBSYS_NAME}" "${SUBSYS_DESC}"
"${SUBSYS_DEPS}" "${EXT_DEPS}" "" "" "")
@@ -1,4 +1,4 @@
-if(OPENNI_FOUND)
+if(WITH_OPENNI)
PCL_ADD_EXECUTABLE(pcl_openni_grabber_example ${SUBSYS_NAME} openni_grabber_example.cpp)
target_link_libraries(pcl_openni_grabber_example pcl_common pcl_io)
@@ -8,8 +8,7 @@ if(OPENNI_FOUND)
PCL_ADD_EXECUTABLE(pcl_openni_pcd_recorder ${SUBSYS_NAME} openni_pcd_recorder.cpp)
target_link_libraries(pcl_openni_pcd_recorder pcl_common pcl_io)
-
-endif(OPENNI_FOUND)
+endif()
PCL_ADD_EXECUTABLE(pcl_pcd_convert_NaN_nan ${SUBSYS_NAME} pcd_convert_NaN_nan.cpp)
PCL_ADD_EXECUTABLE(pcl_pcd_introduce_nan ${SUBSYS_NAME} pcd_introduce_nan.cpp)
@@ -50,7 +50,7 @@ if(build)
#SET_TARGET_PROPERTIES("${LIB_NAME}" PROPERTIES LINKER_LANGUAGE CXX)
- if(OPENNI_FOUND AND BUILD_OPENNI)
+ if(WITH_OPENNI)
PCL_ADD_EXECUTABLE_OPT_BUNDLE(pcl_ground_based_rgbd_people_detector "${SUBSYS_NAME}" apps/main_ground_based_people_detection.cpp)
target_link_libraries(pcl_ground_based_rgbd_people_detector pcl_common pcl_kdtree pcl_search pcl_features pcl_sample_consensus pcl_filters pcl_io pcl_visualization pcl_segmentation pcl_people)
endif()
Oops, something went wrong.

0 comments on commit d0b960d

Please sign in to comment.