CMakeLists.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. cmake_minimum_required(VERSION 2.8.3)
  2. project(autoware_rviz_plugins)
  3. find_package(autoware_build_flags REQUIRED)
  4. find_package(catkin REQUIRED COMPONENTS
  5. rviz
  6. std_msgs
  7. )
  8. if(rviz_QT_VERSION VERSION_LESS "5")
  9. message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
  10. find_package(Qt4 ${rviz_QT_VERSION} EXACT REQUIRED QtCore QtGui)
  11. ## pull in all required include dirs, define QT_LIBRARIES, etc.
  12. include(${QT_USE_FILE})
  13. else()
  14. message(STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
  15. find_package(Qt5 ${rviz_QT_VERSION} EXACT REQUIRED Core Widgets)
  16. ## make target_link_libraries(${QT_LIBRARIES}) pull in all required dependencies
  17. set(QT_LIBRARIES Qt5::Widgets)
  18. endif()
  19. catkin_package(
  20. DEPENDS rviz
  21. )
  22. include_directories(
  23. ${catkin_INCLUDE_DIRS}
  24. )
  25. SET(CMAKE_CXX_FLAGS "-O2 -g -Wall -Wno-unused-result -DROS ${CMAKE_CXX_FLAGS}")
  26. add_definitions(-DQT_NO_KEYWORDS -g)
  27. set(CMAKE_AUTOMOC ON)
  28. set(SOURCE_FILES
  29. src/state_panel/state_panel.cpp
  30. src/sim_object/autoware_flag_tool.cpp
  31. )
  32. add_library(autoware_rviz_plugins ${SOURCE_FILES} ${UIC_FILES})
  33. target_link_libraries(autoware_rviz_plugins ${QT_LIBRARIES} ${catkin_LIBRARIES} ${rviz_DEFAULT_PLUGIN_LIBRARIES})
  34. install(TARGETS ${PROJECT_NAME}
  35. ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  36. LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  37. RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  38. )
  39. install(DIRECTORY media/
  40. DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/media
  41. )
  42. install(DIRECTORY icons/
  43. DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/icons
  44. )
  45. install(FILES plugin_description.xml
  46. DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
  47. )