CMakeLists.txt 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. cmake_minimum_required(VERSION 2.8.3)
  2. project(map_file)
  3. find_package(autoware_build_flags REQUIRED)
  4. find_package(catkin REQUIRED COMPONENTS
  5. autoware_msgs
  6. geometry_msgs
  7. lanelet2_extension
  8. pcl_ros
  9. roscpp
  10. std_msgs
  11. tf
  12. tf2_geometry_msgs
  13. tf2_ros
  14. vector_map
  15. visualization_msgs
  16. )
  17. find_package(PCL REQUIRED COMPONENTS io)
  18. find_package(Boost REQUIRED COMPONENTS filesystem)
  19. # See: https://github.com/ros-perception/perception_pcl/blob/lunar-devel/pcl_ros/CMakeLists.txt#L10-L22
  20. if(NOT "${PCL_LIBRARIES}" STREQUAL "")
  21. # FIXME: this causes duplicates and not found error in ubuntu:zesty
  22. list(REMOVE_ITEM PCL_LIBRARIES "/usr/lib/libmpi.so")
  23. # For debian: https://github.com/ros-perception/perception_pcl/issues/139
  24. list(REMOVE_ITEM PCL_IO_LIBRARIES
  25. "vtkGUISupportQt"
  26. "vtkGUISupportQtOpenGL"
  27. "vtkGUISupportQtSQL"
  28. "vtkGUISupportQtWebkit"
  29. "vtkViewsQt"
  30. "vtkRenderingQt"
  31. )
  32. endif()
  33. find_package(CURL REQUIRED)
  34. set(CMAKE_CXX_FLAGS "-O2 -Wall ${CMAKE_CXX_FLAGS}")
  35. catkin_package(
  36. INCLUDE_DIRS include
  37. LIBRARIES get_file
  38. CATKIN_DEPENDS
  39. autoware_msgs
  40. geometry_msgs
  41. std_msgs
  42. tf2_geometry_msgs
  43. visualization_msgs
  44. DEPENDS Boost
  45. )
  46. include_directories(
  47. include
  48. ${catkin_INCLUDE_DIRS}
  49. ${PCL_IO_INCLUDE_DIRS}
  50. ${CURL_INCLUDE_DIRS}
  51. ${Boost_INCLUDE_DIR}
  52. )
  53. add_library(get_file
  54. lib/map_file/get_file.cpp
  55. )
  56. target_link_libraries(get_file ${CURL_LIBRARIES})
  57. add_executable(points_map_loader nodes/points_map_loader/points_map_loader.cpp)
  58. target_link_libraries(points_map_loader ${catkin_LIBRARIES} get_file ${CURL_LIBRARIES} ${PCL_IO_LIBRARIES})
  59. add_dependencies(points_map_loader
  60. ${catkin_EXPORTED_TARGETS}
  61. )
  62. add_executable(vector_map_loader nodes/vector_map_loader/vector_map_loader.cpp)
  63. target_link_libraries(vector_map_loader ${catkin_LIBRARIES} ${vector_map_LIBRARIES} get_file ${CURL_LIBRARIES})
  64. add_dependencies(vector_map_loader ${catkin_EXPORTED_TARGETS})
  65. add_executable(lanelet2_map_loader nodes/lanelet2_map_loader/lanelet2_map_loader.cpp)
  66. target_link_libraries(lanelet2_map_loader ${catkin_LIBRARIES} ${Boost_LIBRARIES})
  67. add_dependencies(lanelet2_map_loader ${catkin_EXPORTED_TARGETS})
  68. add_executable(lanelet2_map_visualization nodes/lanelet2_map_loader/lanelet2_map_visualization.cpp)
  69. target_link_libraries(lanelet2_map_visualization ${catkin_LIBRARIES})
  70. add_dependencies(lanelet2_map_visualization ${catkin_EXPORTED_TARGETS})
  71. add_executable(points_map_filter nodes/points_map_filter/points_map_filter_node.cpp nodes/points_map_filter/points_map_filter.cpp)
  72. target_link_libraries(points_map_filter ${catkin_LIBRARIES})
  73. add_dependencies(points_map_filter ${catkin_EXPORTED_TARGETS})
  74. ## Install executables and/or libraries
  75. install(
  76. TARGETS
  77. get_file
  78. points_map_loader
  79. vector_map_loader
  80. lanelet2_map_loader
  81. lanelet2_map_visualization
  82. points_map_filter
  83. ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  84. LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  85. RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  86. )
  87. ## Install project namespaced headers
  88. install(DIRECTORY include/${PROJECT_NAME}/
  89. DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  90. )
  91. install(DIRECTORY launch/
  92. DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
  93. PATTERN ".svn" EXCLUDE
  94. )