|
| 1 | +cmake_minimum_required(VERSION 3.10) |
| 2 | +project(segregator) |
| 3 | + |
| 4 | +set(CMAKE_CXX_STANDARD 17) |
| 5 | +# set(CMAKE_BUILD_TYPE "Debug") |
| 6 | + |
| 7 | +set(CMAKE_INSTALL_RPATH "/usr/local/lib") |
| 8 | +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) |
| 9 | + |
| 10 | +if (NOT CMAKE_BUILD_TYPE) |
| 11 | + set(CMAKE_BUILD_TYPE "Release") |
| 12 | +endif () |
| 13 | + |
| 14 | +find_package(catkin REQUIRED COMPONENTS |
| 15 | + roscpp |
| 16 | + rospy |
| 17 | + std_msgs |
| 18 | + geometry_msgs |
| 19 | + message_generation |
| 20 | + sensor_msgs |
| 21 | + nav_msgs |
| 22 | + pcl_ros |
| 23 | + cv_bridge |
| 24 | + eigen_conversions |
| 25 | +) |
| 26 | + |
| 27 | +find_package(OpenCV REQUIRED) |
| 28 | +find_package(OpenCV REQUIRED QUIET) |
| 29 | +find_package(OpenMP) |
| 30 | +find_package(PCL 1.8 REQUIRED) |
| 31 | +find_package(Boost 1.54 REQUIRED) |
| 32 | +find_package(Eigen3 3.2 QUIET REQUIRED NO_MODULE) |
| 33 | + |
| 34 | +add_message_files( |
| 35 | + FILES |
| 36 | + cloud_info.msg |
| 37 | +) |
| 38 | + |
| 39 | +generate_messages( |
| 40 | + DEPENDENCIES |
| 41 | + geometry_msgs |
| 42 | + std_msgs |
| 43 | + nav_msgs |
| 44 | +) |
| 45 | + |
| 46 | +catkin_package( |
| 47 | + INCLUDE_DIRS |
| 48 | + include |
| 49 | + LIBRARIES |
| 50 | + ${PROJECT_NAME} |
| 51 | + nano_gicp |
| 52 | + nanoflann |
| 53 | + CATKIN_DEPENDS |
| 54 | + roscpp |
| 55 | + rospy |
| 56 | + std_msgs |
| 57 | +) |
| 58 | + |
| 59 | +include_directories(include |
| 60 | + ${catkin_INCLUDE_DIRS} |
| 61 | + ${OpenCV_INCLUDE_DIRS} |
| 62 | + ${PCL_INCLUDE_DIRS} |
| 63 | +) |
| 64 | + |
| 65 | +add_definitions(${PCL_DEFINITIONS}) |
| 66 | +link_directories(${PCL_LIBRARY_DIRS}) |
| 67 | + |
| 68 | +if (OPENMP_FOUND) |
| 69 | + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") |
| 70 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") |
| 71 | + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") |
| 72 | +endif () |
| 73 | + |
| 74 | + |
| 75 | +configure_file(pmc/pmc.CMakeLists.txt.in pmc-download/CMakeLists.txt) |
| 76 | +execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . |
| 77 | + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/pmc-download") |
| 78 | +execute_process(COMMAND "${CMAKE_COMMAND}" --build . |
| 79 | + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/pmc-download") |
| 80 | +add_subdirectory("${CMAKE_BINARY_DIR}/pmc-src" #CMAKE_BINARY_DIR => |
| 81 | + "${CMAKE_BINARY_DIR}/pmc-build") |
| 82 | + |
| 83 | +# # NanoFLANN |
| 84 | +# add_library(nanoflann SHARED |
| 85 | +# src/nano_gicp/nanoflann.cc |
| 86 | +# ) |
| 87 | +# target_link_libraries(nanoflann ${PCL_LIBRARIES}) |
| 88 | +# target_include_directories(nanoflann PUBLIC include ${PCL_INCLUDE_DIRS}) |
| 89 | + |
| 90 | +# # NanoGICP |
| 91 | +# add_library(nano_gicp SHARED |
| 92 | +# src/nano_gicp/lsq_registration.cc |
| 93 | +# src/nano_gicp/nano_gicp.cc |
| 94 | +# ) |
| 95 | +# target_link_libraries(nano_gicp ${PCL_LIBRARIES} ${OpenMP_LIBS} nanoflann) |
| 96 | +# target_include_directories(nano_gicp PUBLIC include ${PCL_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR}) |
| 97 | + |
| 98 | +####### Executable ####### |
| 99 | +set(teaser_src |
| 100 | + src/registration.cc |
| 101 | + src/graph.cc |
| 102 | + src/teaser_utils/feature_matcher.cc |
| 103 | + src/teaser_utils/fpfh.cc |
| 104 | + ) |
| 105 | + |
| 106 | +add_executable(segregator_example examples/segregator_example.cpp ${teaser_src} src/semantic_teaser.cpp) |
| 107 | +add_dependencies(segregator_example ${catkin_EXPORTED_TARGETS}) |
| 108 | +target_compile_options(segregator_example PRIVATE ${OpenMP_FLAGS}) |
| 109 | +target_link_libraries(segregator_example |
| 110 | + PUBLIC |
| 111 | + ${PCL_LIBRARIES} |
| 112 | + ${catkin_LIBRARIES} |
| 113 | + ${OpenMP_LIBS} |
| 114 | + stdc++fs |
| 115 | + pmc |
| 116 | + # nano_gicp |
| 117 | + ) |
| 118 | + |
0 commit comments