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