CMakeLists.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. cmake_minimum_required(VERSION 2.8.3)
  2. project(vlg22c_cam)
  3. find_package(autoware_build_flags REQUIRED)
  4. find_package(catkin REQUIRED COMPONENTS
  5. camera_info_manager
  6. image_transport
  7. roscpp
  8. sensor_msgs
  9. std_msgs
  10. )
  11. ## pkg-config libraries
  12. find_package(PkgConfig REQUIRED)
  13. find_package(OpenCV REQUIRED)
  14. set(CMAKE_CXX_FLAGS "-O2 -Wall ${CMAKE_CXX_FLAGS}")
  15. catkin_package(
  16. LIBRARIES ${PROJECT_NAME}
  17. )
  18. set(BAUMER_INC_DIR "$ENV{HOME}/Baumer/BaumerGAPI/Components/Dev/C_C++/Inc")
  19. set(BAUMER_LIB_DIR "$ENV{HOME}/Baumer/BaumerGAPI/Components/Bin/Systems/GigE")
  20. if(EXISTS "${BAUMER_INC_DIR}")
  21. add_definitions(-D_GNULINUX)
  22. include_directories(include
  23. ${catkin_INCLUDE_DIRS}
  24. ${BAUMER_INC_DIR}
  25. nodes/vlg22/src/
  26. ${OpenCV_INCLUDE_DIRS}
  27. )
  28. link_directories("${BAUMER_LIB_DIR}")
  29. add_executable(${PROJECT_NAME}_node
  30. nodes/vlg22/src/vlg22_main.cpp
  31. nodes/vlg22/src/bgapi_init.cpp
  32. )
  33. target_link_libraries(${PROJECT_NAME}_node
  34. bgapi
  35. ${OpenCV_LIBS}
  36. ${catkin_LIBRARIES}
  37. )
  38. add_custom_command(TARGET ${PROJECT_NAME}_node POST_BUILD
  39. COMMAND ${CMAKE_COMMAND} -E copy_directory
  40. ${BAUMER_LIB_DIR} $<TARGET_FILE_DIR:${PROJECT_NAME}_node>
  41. )
  42. install(TARGETS ${PROJECT_NAME}_node
  43. ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  44. LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  45. RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  46. )
  47. install(DIRECTORY launch/
  48. DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
  49. PATTERN ".svn" EXCLUDE
  50. )
  51. else()
  52. message("'BGGAPI' is not installed. 'vlg22c_cam' will not be built.")
  53. endif()