CMakeLists.txt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. cmake_minimum_required(VERSION 2.8.12)
  2. project(points2image)
  3. include(FindPkgConfig)
  4. find_package(autoware_build_flags REQUIRED)
  5. find_package(catkin REQUIRED COMPONENTS
  6. autoware_msgs
  7. cv_bridge
  8. fastvirtualscan
  9. pcl_conversions
  10. pcl_ros
  11. roscpp
  12. rosinterface
  13. sensor_msgs
  14. std_msgs
  15. tf
  16. )
  17. find_package(OpenCV REQUIRED)
  18. set(CMAKE_AUTOMOC ON)
  19. #set(CMAKE_AUTOUIC ON)
  20. #set(CMAKE_AUTORCC ON)
  21. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  22. find_package(Qt5Core REQUIRED)
  23. find_package(Qt5Widgets REQUIRED)
  24. find_package(GLUT REQUIRED)
  25. find_package(OpenGL REQUIRED)
  26. catkin_package()
  27. set(CMAKE_CXX_FLAGS "-O2 -g -Wall ${CMAKE_CXX_FLAGS}")
  28. include_directories(
  29. include
  30. ${catkin_INCLUDE_DIRS}
  31. ${CMAKE_CURRENT_SOURCE_DIR}
  32. ${CMAKE_CURRENT_BINARY_DIR}
  33. )
  34. # library
  35. add_library(points_image
  36. lib/points_image/points_image.cpp
  37. )
  38. add_dependencies(points_image
  39. ${catkin_EXPORTED_TARGETS}
  40. )
  41. target_link_libraries(points_image
  42. ${catkin_LIBRARIES}
  43. ${OpenCV_LIBS}
  44. )
  45. qt5_wrap_ui(points2vscan_ui_mainwindow nodes/points2vscan/mainwindow.ui)
  46. # points2vscan
  47. add_executable(points2vscan
  48. nodes/points2vscan/main.cpp
  49. nodes/points2vscan/mainwindow.cpp
  50. nodes/points2vscan/mainwindow.h
  51. ${points2vscan_ui_mainwindow}
  52. )
  53. target_link_libraries(points2vscan
  54. ${catkin_LIBRARIES}
  55. Qt5::Core
  56. Qt5::Widgets
  57. points_image
  58. ${OPENGL_LIBRARIES}
  59. ${OpenCV_LIBS}
  60. )
  61. add_dependencies(points2vscan
  62. ${catkin_EXPORTED_TARGETS}
  63. )
  64. # points2image
  65. add_executable(points2image nodes/points2image/points2image.cpp)
  66. target_link_libraries(points2image
  67. ${catkin_LIBRARIES}
  68. ${OpenCV_LIBS}
  69. points_image
  70. )
  71. add_dependencies(points2image
  72. ${catkin_EXPORTED_TARGETS}
  73. )
  74. # vscan2image
  75. add_executable(vscan2image nodes/vscan2image/vscan2image.cpp)
  76. target_link_libraries(vscan2image
  77. ${catkin_LIBRARIES}
  78. ${OpenCV_LIBS}
  79. points_image
  80. )
  81. add_dependencies(vscan2image
  82. ${catkin_EXPORTED_TARGETS}
  83. )
  84. # vscan2linelist
  85. add_executable(vscan2linelist nodes/vscan2linelist/vscan2linelist.cpp)
  86. target_link_libraries(vscan2linelist
  87. ${catkin_LIBRARIES}
  88. )
  89. install(DIRECTORY include/${PROJECT_NAME}/
  90. DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  91. FILES_MATCHING PATTERN "*.hpp"
  92. )
  93. install(
  94. TARGETS
  95. points_image
  96. vscan2linelist
  97. vscan2image
  98. points2image
  99. points2vscan
  100. ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  101. LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  102. RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  103. )