|
| 1 | +cmake_minimum_required(VERSION 2.8.3) |
| 2 | +project(m100_x3) |
| 3 | + |
| 4 | +set(CMAKE_VERBOSE_MAKEFILE "true") |
| 5 | + |
| 6 | +include(CheckCXXCompilerFlag) |
| 7 | +CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) |
| 8 | +CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) |
| 9 | +if(COMPILER_SUPPORTS_CXX11) |
| 10 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") |
| 11 | +elseif(COMPILER_SUPPORTS_CXX0X) |
| 12 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") |
| 13 | +else() |
| 14 | + message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") |
| 15 | +endif() |
| 16 | + |
| 17 | +set(ADDITIONAL_CXX_FLAG "-Wall -O3") |
| 18 | +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ADDITIONAL_CXX_FLAG}") |
| 19 | + |
| 20 | +## Find catkin macros and libraries |
| 21 | +## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) |
| 22 | +## is used, also find other catkin packages |
| 23 | +find_package(catkin REQUIRED COMPONENTS |
| 24 | + cv_bridge |
| 25 | + image_transport |
| 26 | + roscpp |
| 27 | + sensor_msgs |
| 28 | +) |
| 29 | + |
| 30 | +## System dependencies are found with CMake's conventions |
| 31 | +# find_package(Boost REQUIRED COMPONENTS system) |
| 32 | + |
| 33 | + |
| 34 | +## Uncomment this if the package has a setup.py. This macro ensures |
| 35 | +## modules and global scripts declared therein get installed |
| 36 | +## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html |
| 37 | +# catkin_python_setup() |
| 38 | + |
| 39 | +################################################ |
| 40 | +## Declare ROS messages, services and actions ## |
| 41 | +################################################ |
| 42 | + |
| 43 | +## To declare and build messages, services or actions from within this |
| 44 | +## package, follow these steps: |
| 45 | +## * Let MSG_DEP_SET be the set of packages whose message types you use in |
| 46 | +## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). |
| 47 | +## * In the file package.xml: |
| 48 | +## * add a build_depend tag for "message_generation" |
| 49 | +## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET |
| 50 | +## * If MSG_DEP_SET isn't empty the following dependency has been pulled in |
| 51 | +## but can be declared for certainty nonetheless: |
| 52 | +## * add a run_depend tag for "message_runtime" |
| 53 | +## * In this file (CMakeLists.txt): |
| 54 | +## * add "message_generation" and every package in MSG_DEP_SET to |
| 55 | +## find_package(catkin REQUIRED COMPONENTS ...) |
| 56 | +## * add "message_runtime" and every package in MSG_DEP_SET to |
| 57 | +## catkin_package(CATKIN_DEPENDS ...) |
| 58 | +## * uncomment the add_*_files sections below as needed |
| 59 | +## and list every .msg/.srv/.action file to be processed |
| 60 | +## * uncomment the generate_messages entry below |
| 61 | +## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) |
| 62 | + |
| 63 | +## Generate messages in the 'msg' folder |
| 64 | +# add_message_files( |
| 65 | +# FILES |
| 66 | +# Message1.msg |
| 67 | +# Message2.msg |
| 68 | +# ) |
| 69 | + |
| 70 | +## Generate services in the 'srv' folder |
| 71 | +# add_service_files( |
| 72 | +# FILES |
| 73 | +# Service1.srv |
| 74 | +# Service2.srv |
| 75 | +# ) |
| 76 | + |
| 77 | +## Generate actions in the 'action' folder |
| 78 | +# add_action_files( |
| 79 | +# FILES |
| 80 | +# Action1.action |
| 81 | +# Action2.action |
| 82 | +# ) |
| 83 | + |
| 84 | +## Generate added messages and services with any dependencies listed here |
| 85 | +# generate_messages( |
| 86 | +# DEPENDENCIES |
| 87 | +# sensor_msgs |
| 88 | +# ) |
| 89 | + |
| 90 | +################################################ |
| 91 | +## Declare ROS dynamic reconfigure parameters ## |
| 92 | +################################################ |
| 93 | + |
| 94 | +## To declare and build dynamic reconfigure parameters within this |
| 95 | +## package, follow these steps: |
| 96 | +## * In the file package.xml: |
| 97 | +## * add a build_depend and a run_depend tag for "dynamic_reconfigure" |
| 98 | +## * In this file (CMakeLists.txt): |
| 99 | +## * add "dynamic_reconfigure" to |
| 100 | +## find_package(catkin REQUIRED COMPONENTS ...) |
| 101 | +## * uncomment the "generate_dynamic_reconfigure_options" section below |
| 102 | +## and list every .cfg file to be processed |
| 103 | + |
| 104 | +## Generate dynamic reconfigure parameters in the 'cfg' folder |
| 105 | +# generate_dynamic_reconfigure_options( |
| 106 | +# cfg/DynReconf1.cfg |
| 107 | +# cfg/DynReconf2.cfg |
| 108 | +# ) |
| 109 | + |
| 110 | +################################### |
| 111 | +## catkin specific configuration ## |
| 112 | +################################### |
| 113 | +## The catkin_package macro generates cmake config files for your package |
| 114 | +## Declare things to be passed to dependent projects |
| 115 | +## INCLUDE_DIRS: uncomment this if you package contains header files |
| 116 | +## LIBRARIES: libraries you create in this project that dependent projects also need |
| 117 | +## CATKIN_DEPENDS: catkin_packages dependent projects also need |
| 118 | +## DEPENDS: system dependencies of this project that dependent projects also need |
| 119 | +catkin_package( |
| 120 | +# INCLUDE_DIRS include |
| 121 | +# LIBRARIES m100_x3 |
| 122 | +# CATKIN_DEPENDS cv_bridge roscpp sensor_msgs |
| 123 | +# DEPENDS system_lib |
| 124 | +) |
| 125 | + |
| 126 | +########### |
| 127 | +## Build ## |
| 128 | +########### |
| 129 | + |
| 130 | +## Specify additional locations of header files |
| 131 | +## Your package locations should be listed before other locations |
| 132 | +# include_directories(include) |
| 133 | +include_directories( |
| 134 | + ${catkin_INCLUDE_DIRS} |
| 135 | +) |
| 136 | + |
| 137 | +## Declare a C++ library |
| 138 | +# add_library(m100_x3 |
| 139 | +# src/${PROJECT_NAME}/m100_x3.cpp |
| 140 | +# ) |
| 141 | + |
| 142 | +## Add cmake target dependencies of the library |
| 143 | +## as an example, code may need to be generated before libraries |
| 144 | +## either from message generation or dynamic reconfigure |
| 145 | +# add_dependencies(m100_x3 ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) |
| 146 | + |
| 147 | +## Declare a C++ executable |
| 148 | +add_executable(m100_x3_node |
| 149 | + src/m100_x3_node.cpp |
| 150 | + src/djicam_utils.cpp |
| 151 | +) |
| 152 | + |
| 153 | +## Add cmake target dependencies of the executable |
| 154 | +## same as for the library above |
| 155 | +# add_dependencies(m100_x3_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) |
| 156 | + |
| 157 | +## Specify libraries to link a library or executable target against |
| 158 | +target_link_libraries(m100_x3_node |
| 159 | + dcam |
| 160 | + ${catkin_LIBRARIES} |
| 161 | +) |
| 162 | + |
| 163 | +############# |
| 164 | +## Install ## |
| 165 | +############# |
| 166 | + |
| 167 | +# all install targets should use catkin DESTINATION variables |
| 168 | +# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html |
| 169 | + |
| 170 | +## Mark executable scripts (Python etc.) for installation |
| 171 | +## in contrast to setup.py, you can choose the destination |
| 172 | +# install(PROGRAMS |
| 173 | +# scripts/my_python_script |
| 174 | +# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} |
| 175 | +# ) |
| 176 | + |
| 177 | +## Mark executables and/or libraries for installation |
| 178 | +# install(TARGETS m100_x3 m100_x3_node |
| 179 | +# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} |
| 180 | +# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} |
| 181 | +# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} |
| 182 | +# ) |
| 183 | + |
| 184 | +## Mark cpp header files for installation |
| 185 | +# install(DIRECTORY include/${PROJECT_NAME}/ |
| 186 | +# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} |
| 187 | +# FILES_MATCHING PATTERN "*.h" |
| 188 | +# PATTERN ".svn" EXCLUDE |
| 189 | +# ) |
| 190 | + |
| 191 | +## Mark other files for installation (e.g. launch and bag files, etc.) |
| 192 | +# install(FILES |
| 193 | +# # myfile1 |
| 194 | +# # myfile2 |
| 195 | +# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} |
| 196 | +# ) |
| 197 | + |
| 198 | +############# |
| 199 | +## Testing ## |
| 200 | +############# |
| 201 | + |
| 202 | +## Add gtest based cpp test target and link libraries |
| 203 | +# catkin_add_gtest(${PROJECT_NAME}-test test/test_m100_x3.cpp) |
| 204 | +# if(TARGET ${PROJECT_NAME}-test) |
| 205 | +# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) |
| 206 | +# endif() |
| 207 | + |
| 208 | +## Add folders to be run by python nosetests |
| 209 | +# catkin_add_nosetests(test) |
0 commit comments