CMakeLists.txt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. cmake_minimum_required(VERSION 2.8.12)
  2. project(autoware_pointgrey_drivers)
  3. find_package(autoware_build_flags REQUIRED)
  4. find_package(catkin REQUIRED COMPONENTS
  5. camera_info_manager
  6. cv_bridge
  7. image_transport
  8. message_generation
  9. roscpp
  10. sensor_msgs
  11. std_msgs
  12. tf
  13. )
  14. set(CMAKE_CXX_FLAGS "-O2 -Wall ${CMAKE_CXX_FLAGS}")
  15. find_package(OpenCV REQUIRED)
  16. catkin_package()
  17. if(EXISTS "/usr/include/flycapture")
  18. include_directories(
  19. /usr/include/flycapture
  20. ${catkin_INCLUDE_DIRS}
  21. ${OpenCV_INCLUDE_DIRS}
  22. )
  23. add_executable(grasshopper3_camera
  24. nodes/grasshopper3/grasshopper3.cpp
  25. )
  26. target_link_libraries(grasshopper3_camera
  27. ${catkin_LIBRARIES}
  28. ${OpenCV_LIBS}
  29. flycapture
  30. )
  31. install(TARGETS grasshopper3_camera
  32. ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  33. LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  34. RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  35. )
  36. install(FILES scripts/grasshopper3.launch
  37. DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
  38. )
  39. else()
  40. message("'FlyCapture SDK' is not installed. 'grasshopper3_camera' will not be built.")
  41. endif()
  42. if(EXISTS "/usr/include/ladybug")
  43. if(${CMAKE_VERSION} VERSION_LESS "3.1.3")
  44. include(FindXercesC.cmake)
  45. else()
  46. find_package(XercesC REQUIRED)
  47. endif()
  48. include_directories(
  49. /usr/include/ladybug
  50. nodes/ladybug
  51. ${catkin_INCLUDE_DIRS}
  52. ${OpenCV_INCLUDE_DIRS}
  53. ${XercesC_INCLUDE_DIRS}
  54. )
  55. add_executable(ladybug_camera
  56. nodes/ladybug/ladybug.cpp
  57. )
  58. target_link_libraries(ladybug_camera
  59. ${catkin_LIBRARIES}
  60. ${OpenCV_LIBS}
  61. ${XercesC_LIBRARIES}
  62. flycapture
  63. ladybug
  64. )
  65. install(TARGETS ladybug_camera
  66. ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  67. LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  68. RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  69. )
  70. install(FILES scripts/ladybug.launch
  71. DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
  72. )
  73. else()
  74. message("'SDK for Ladybug' is not installed. 'ladybug_camera' will not be built.")
  75. endif()
  76. if(EXISTS "/usr/include/spinnaker")
  77. include(FindSpinnaker.cmake)
  78. include_directories(
  79. nodes/spinnaker
  80. ${Spinnaker_INCLUDE_DIRS}
  81. ${catkin_INCLUDE_DIRS}
  82. ${OpenCV_INCLUDE_DIRS}
  83. )
  84. add_executable(spinnaker_camera
  85. nodes/spinnaker/spinnaker.cpp
  86. )
  87. target_link_libraries(spinnaker_camera
  88. ${catkin_LIBRARIES}
  89. ${OpenCV_LIBS}
  90. ${Spinnaker_LIBRARIES}
  91. )
  92. install(TARGETS spinnaker_camera
  93. ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  94. LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  95. RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  96. )
  97. install(FILES
  98. scripts/spinnaker.launch
  99. DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
  100. )
  101. else()
  102. message("'SDK for Spinnaker' is not installed. 'spinnaker_camera' will not be built.")
  103. endif()