CMakeLists.txt 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. cmake_minimum_required(VERSION 2.8.12)
  2. project(object_map)
  3. find_package(autoware_build_flags REQUIRED)
  4. find_package(catkin REQUIRED COMPONENTS
  5. autoware_msgs
  6. grid_map_cv
  7. grid_map_msgs
  8. grid_map_ros
  9. lanelet2_extension
  10. nav_msgs
  11. pcl_conversions
  12. pcl_ros
  13. roscpp
  14. roslint
  15. sensor_msgs
  16. tf
  17. vector_map
  18. )
  19. # TODO add other files into roslint
  20. set(ROSLINT_CPP_OPTS "--filter=-build/c++14")
  21. roslint_cpp(
  22. nodes/wayarea2grid_lanelet2/wayarea2grid_lanelet2_node.cpp
  23. nodes/wayarea2grid_lanelet2/wayarea2grid_lanelet2.cpp
  24. include/wayarea2grid_lanelet2/wayarea2grid_lanelet2.h
  25. )
  26. find_package(Qt5Core REQUIRED)
  27. find_package(OpenCV REQUIRED)
  28. find_package(PCL REQUIRED)
  29. find_package(OpenMP)
  30. if (OPENMP_FOUND)
  31. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
  32. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
  33. endif ()
  34. catkin_package(
  35. INCLUDE_DIRS include
  36. LIBRARIES object_map_utils_lib
  37. CATKIN_DEPENDS
  38. pcl_ros
  39. pcl_conversions
  40. tf
  41. sensor_msgs
  42. nav_msgs
  43. autoware_msgs
  44. grid_map_msgs
  45. vector_map
  46. lanelet2_extension
  47. )
  48. set(CMAKE_CXX_FLAGS "-O2 -g -Wall ${CMAKE_CXX_FLAGS}")
  49. include_directories(
  50. include
  51. ${catkin_INCLUDE_DIRS}
  52. )
  53. ### object_map_utils ###
  54. add_library(object_map_utils_lib
  55. include/object_map/object_map_utils.cpp
  56. include/object_map/object_map_utils.hpp
  57. )
  58. target_link_libraries(object_map_utils_lib
  59. ${catkin_LIBRARIES}
  60. )
  61. ### laserscan2costmap ###
  62. add_executable(laserscan2costmap
  63. nodes/laserscan2costmap/laserscan2costmap.cpp
  64. )
  65. target_link_libraries(laserscan2costmap
  66. ${catkin_LIBRARIES}
  67. )
  68. ### potential_field ###
  69. add_executable(potential_field
  70. nodes/potential_field/potential_field.cpp
  71. )
  72. add_dependencies(potential_field
  73. ${catkin_EXPORTED_TARGETS}
  74. )
  75. target_link_libraries(potential_field
  76. ${catkin_LIBRARIES}
  77. )
  78. ### grid_map_filter ###
  79. add_library(grid_map_filter_lib
  80. nodes/grid_map_filter/grid_map_filter.h
  81. include/object_map/object_map_utils.hpp
  82. nodes/grid_map_filter/grid_map_filter.cpp
  83. )
  84. target_link_libraries(grid_map_filter_lib
  85. ${catkin_LIBRARIES}
  86. object_map_utils_lib
  87. )
  88. add_executable(grid_map_filter
  89. nodes/grid_map_filter/grid_map_filter_node.cpp
  90. nodes/grid_map_filter/grid_map_filter.h
  91. )
  92. target_link_libraries(grid_map_filter
  93. ${catkin_LIBRARIES}
  94. object_map_utils_lib
  95. grid_map_filter_lib
  96. )
  97. ### wayarea2grid ###
  98. add_library(wayarea2grid_lib
  99. nodes/wayarea2grid/wayarea2grid.h
  100. include/object_map/object_map_utils.hpp
  101. nodes/wayarea2grid/wayarea2grid.cpp
  102. )
  103. target_link_libraries(wayarea2grid_lib
  104. ${catkin_LIBRARIES}
  105. object_map_utils_lib
  106. )
  107. add_executable(wayarea2grid
  108. nodes/wayarea2grid/wayarea2grid.h
  109. nodes/wayarea2grid/wayarea2grid_node.cpp
  110. )
  111. target_link_libraries(wayarea2grid
  112. ${catkin_LIBRARIES}
  113. wayarea2grid_lib
  114. )
  115. add_library(wayarea2grid_lanelet2_lib
  116. include/object_map/object_map_utils.hpp
  117. nodes/wayarea2grid_lanelet2/wayarea2grid_lanelet2.cpp
  118. )
  119. target_link_libraries(wayarea2grid_lanelet2_lib
  120. ${catkin_LIBRARIES}
  121. object_map_utils_lib
  122. )
  123. add_executable(wayarea2grid_lanelet2
  124. nodes/wayarea2grid_lanelet2/wayarea2grid_lanelet2_node.cpp
  125. )
  126. target_link_libraries(wayarea2grid_lanelet2
  127. ${catkin_LIBRARIES}
  128. wayarea2grid_lanelet2_lib
  129. )
  130. install(
  131. TARGETS
  132. wayarea2grid
  133. wayarea2grid_lib
  134. wayarea2grid_lanelet2
  135. wayarea2grid_lanelet2_lib
  136. grid_map_filter_lib
  137. grid_map_filter
  138. potential_field
  139. laserscan2costmap
  140. object_map_utils_lib
  141. ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  142. LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  143. RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  144. )
  145. install(DIRECTORY launch/
  146. DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
  147. )
  148. install(DIRECTORY include/${PROJECT_NAME}/
  149. DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  150. FILES_MATCHING PATTERN "*.hpp"
  151. )
  152. install(DIRECTORY config/
  153. DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config
  154. )
  155. if (CATKIN_ENABLE_TESTING)
  156. roslint_add_test()
  157. endif()