@@ -23,6 +23,10 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "")
23
23
set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "build type default to RelWithDebInfo, set to Release to improve performance" FORCE )
24
24
endif ()
25
25
26
+ set (PCL_SHARED_LIBS ON CACHE BOOL "" FORCE ) # shared build is a way, otherwise too many errors
27
+ set (WITH_VTK OFF CACHE BOOL "" FORCE )
28
+ set (WITH_QT OFF CACHE BOOL "" FORCE )
29
+
26
30
project (PCL VERSION 1.13.0 )
27
31
string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER )
28
32
@@ -314,14 +318,29 @@ endif()
314
318
find_package (Threads REQUIRED )
315
319
316
320
# Eigen (required)
321
+ # PATCH: Build system needs to pass PC_EIGEN_INCLUDE_DIRS variable to make it search-able
322
+ if (NOT DEFINED PC_EIGEN_INCLUDE_DIRS )
323
+ message (FATAL_ERROR "PATCH: PC_EIGEN_INCLUDE_DIRS is required!" )
324
+ endif ()
325
+
317
326
find_package (Eigen 3.3 REQUIRED )
318
327
include_directories (SYSTEM ${EIGEN_INCLUDE_DIRS} )
319
328
320
329
# FLANN (required)
321
- find_package ( FLANN 1.9.1 REQUIRED )
322
- if (NOT ( ${FLANN_LIBRARY_TYPE} MATCHES ${PCL_FLANN_REQUIRED_TYPE} ) AND NOT ( ${PCL_FLANN_REQUIRED_TYPE} MATCHES "DONTCARE" ) )
323
- message (FATAL_ERROR "Flann was selected with ${PCL_FLANN_REQUIRED_TYPE} but found as ${FLANN_LIBRARY_TYPE} " )
330
+ # PATCH: manually set flann.pc variables and make it work with build system
331
+ if (NOT DEFINED _PATCHED_FLANN_INSTALL_DIR_ )
332
+ message (FATAL_ERROR "PATCH: _PATCHED_FLANN_INSTALL_DIR_ is required! " )
324
333
endif ()
334
+ set (FLANN_FOUND 1 )
335
+ set (FLANN_INCLUDE_DIRS ${_PATCHED_FLANN_INSTALL_DIR_} /include )
336
+ set (FLANN_LIBRARY_DIRS ${_PATCHED_FLANN_INSTALL_DIR_} /lib )
337
+ set (FLANN_LIBRARIES ${FLANN_LIBRARY_DIRS} /flann_cpp_s.lib )
338
+
339
+ include_directories (${FLANN_INCLUDE_DIRS} )
340
+
341
+ # Create interface library that effectively becomes an alias for the appropriate (static/dynamic) imported FLANN target
342
+ add_library (FLANN::FLANN INTERFACE IMPORTED )
343
+ set_property (TARGET FLANN::FLANN APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${FLANN_LIBRARIES} )
325
344
326
345
# libusb
327
346
option (WITH_LIBUSB "Build USB RGBD-Camera drivers" TRUE )
@@ -409,7 +428,14 @@ if(WITH_OPENGL)
409
428
endif ()
410
429
411
430
# Boost (required)
431
+ # PATCH: Build system needs to pass Boost_DIR variable to make it search-able
432
+ if (NOT DEFINED Boost_DIR )
433
+ message (FATAL_ERROR "PATCH: Boost_DIR is required!" )
434
+ endif ()
435
+
436
+ set (CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE )
412
437
include ("${PCL_SOURCE_DIR} /cmake/pcl_find_boost.cmake" )
438
+ set (CMAKE_FIND_PACKAGE_PREFER_CONFIG FALSE )
413
439
414
440
### ---[ Create the config.h file
415
441
set (pcl_config_h_in "${CMAKE_CURRENT_SOURCE_DIR} /pcl_config.h.in" )
@@ -448,4 +474,4 @@ MAKE_DEP_GRAPH()
448
474
449
475
### ---[ Finish up
450
476
PCL_WRITE_STATUS_REPORT ()
451
- PCL_RESET_MAPS ()
477
+ PCL_RESET_MAPS ()
0 commit comments