CMakeLists.txt 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. cmake_minimum_required(VERSION 3.0.0)
  2. project(staticoma)
  3. ## Find catkin macros and libraries
  4. find_package(catkin REQUIRED COMPONENTS
  5. roscpp
  6. rosbag_storage
  7. std_msgs
  8. )
  9. ## System dependencies are found with CMake's conventions
  10. #find_package(Boost REQUIRED COMPONENTS system)
  11. ###################################
  12. ## catkin specific configuration ##
  13. ###################################
  14. ## The catkin_package macro generates cmake config files for your package
  15. ## Declare things to be passed to dependent projects
  16. ## INCLUDE_DIRS: uncomment this if your package contains header files
  17. ## LIBRARIES: libraries you create in this project that dependent projects also need
  18. ## CATKIN_DEPENDS: catkin_packages dependent projects also need
  19. ## DEPENDS: system dependencies of this project that dependent projects also need
  20. catkin_package(
  21. INCLUDE_DIRS include
  22. # LIBRARIES ${PROJECT_NAME}
  23. CATKIN_DEPENDS roscpp std_msgs
  24. # DEPENDS system_lib
  25. CFG_EXTRAS ${PROJECT_NAME}_cmake_path.cmake
  26. )
  27. ###########
  28. ## Build ##
  29. ###########
  30. include(CMakeParseArguments)
  31. # --------------
  32. # CCW flags
  33. # --------------
  34. if (CCWS_CLANG_TIDY)
  35. set (CMAKE_CXX_CLANG_TIDY "${CCWS_CLANG_TIDY}")
  36. endif()
  37. if (CCWS_CXX_FLAGS)
  38. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CCWS_CXX_FLAGS}")
  39. set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CCWS_LINKER_FLAGS}")
  40. else()
  41. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Werror=pedantic -pedantic-errors -Wshadow -Werror=return-type -Werror -fPIC -fstack-protector-strong")
  42. endif()
  43. # --------------
  44. ## Specify additional locations of header files
  45. ## Your package locations should be listed before other locations
  46. include_directories(
  47. include
  48. SYSTEM ${catkin_INCLUDE_DIRS}
  49. SYSTEM src/3rdparty
  50. )
  51. ## Declare a C++ library
  52. #add_library(${PROJECT_NAME}
  53. # src/${PROJECT_NAME}/${PROJECT_NAME}.cpp
  54. #)
  55. ## Add cmake target dependencies of the library
  56. ## as an example, code may need to be generated before libraries
  57. ## either from message generation or dynamic reconfigure
  58. #add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
  59. ## Declare a C++ executable
  60. ## With catkin_make all packages are built within a single CMake context
  61. ## The recommended prefix ensures that target names across packages don't collide
  62. add_executable(server src/server.cpp)
  63. add_executable(replayer src/replayer.cpp)
  64. ## Rename C++ executable without prefix
  65. ## The above recommended prefix causes long target names, the following renames the
  66. ## target back to the shorter version for ease of user use
  67. ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
  68. #set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
  69. ## Add cmake target dependencies of the executable
  70. ## same as for the library above
  71. #add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
  72. ## Specify libraries to link a library or executable target against
  73. target_link_libraries(server
  74. ${catkin_LIBRARIES}
  75. )
  76. target_link_libraries(replayer
  77. ${catkin_LIBRARIES}
  78. )
  79. #############
  80. ## Install ##
  81. #############
  82. # all install targets should use catkin DESTINATION variables
  83. # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
  84. ## Mark executable scripts (Python etc.) for installation
  85. ## in contrast to setup.py, you can choose the destination
  86. #install(PROGRAMS
  87. # scripts/my_python_script
  88. # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  89. #)
  90. # Mark executables and/or libraries for installation
  91. install(TARGETS replayer server
  92. ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  93. LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  94. RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  95. )
  96. # Mark cpp header files for installation
  97. install(DIRECTORY include/${PROJECT_NAME}/
  98. DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  99. FILES_MATCHING PATTERN "*.h"
  100. PATTERN ".svn" EXCLUDE
  101. )
  102. ## Mark other files for installation (e.g. launch and bag files, etc.)
  103. #install(FILES
  104. # # myfile1
  105. # # myfile2
  106. # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
  107. #)
  108. #foreach(DIR launch)
  109. # install(DIRECTORY ${DIR}
  110. # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
  111. # USE_SOURCE_PERMISSIONS
  112. # )
  113. #endforeach()
  114. #install(FILES ${CMAKE_SOURCE_DIR}/plugin.xml
  115. # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
  116. #)
  117. install (DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/"
  118. DESTINATION "${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake"
  119. FILES_MATCHING PATTERN "*.cmake")
  120. #==============================================
  121. # Uncomment to enable tests.
  122. #==============================================
  123. if(CATKIN_ENABLE_TESTING)
  124. add_subdirectory(test)
  125. endif()
  126. #==============================================