Skip to content
Snippets Groups Projects
Select Git revision
  • a566bc704f14f4ebb3b51ae48587a6a7b752e248
  • master default
  • simulated_grasping
  • v1.0
4 results

CMakeLists.txt

Blame
  • CMakeLists.txt 5.03 KiB
    cmake_minimum_required(VERSION 2.8.3)
    project(panda_simulation)
    
    # Compile as C++11, supported in ROS Kinetic and newer
    add_compile_options(-std=c++14)
    set(GCC_COVERAGE_COMPILE_FLAGS "-fpermissive")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} ${GAZEBO_CXX_FLAGS}")
    
    # Find catkin macros and libraries if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) is used, also find other
    # catkin packages
    find_package(catkin REQUIRED
                 COMPONENTS controller_manager
                            effort_controllers
                            gazebo_ros
                            joint_state_controller
                            joint_state_publisher
                            joint_trajectory_controller
                            robot_state_publisher
                            roscpp
                            std_msgs
                            tf
                            xacro
                            moveit_core
                            moveit_visual_tools
                            moveit_ros_planning
                            moveit_ros_planning_interface
                            controller_interface
                            hardware_interface)
    
    # System dependencies are found with CMake's conventions
    find_package(Boost REQUIRED COMPONENTS filesystem)
    
    # ################################################################################################################################
    # catkin specific configuration ##
    # ################################################################################################################################
    # The catkin_package macro generates cmake config files for your package Declare things to be passed to dependent projects
    catkin_package(
            CATKIN_DEPENDS
                   moveit_core
                   moveit_visual_tools
                   moveit_ros_planning_interface
                   controller_interface
                   hardware_interface
                   pluginlib
    #       DEPENDS
    #              system_lib
            )
    
    # ################################################################################################################################
    # Build ##
    # ################################################################################################################################
    
    # Specify additional locations of header files Your package locations should be listed before other locations
    include_directories(${catkin_INCLUDE_DIRS})
    
    ## Declare C++ executables
    add_executable(${PROJECT_NAME}_robot_state_initializer_node src/robot_state_initializer.cpp)
    
    ## Declare C++ libraries
    add_library(${PROJECT_NAME}_controllers_lib src/joint_position_controller.cpp)
    
    
    ## Add cmake target dependencies of the library
    ## as an example, code may need to be generated before libraries
    ## either from message generation or dynamic reconfigure
    
    
    ## Rename C++ executable without prefix
    ## The above recommended prefix causes long target names, the following renames the
    ## target back to the shorter version for ease of user use
    ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
    set_target_properties(${PROJECT_NAME}_robot_state_initializer_node PROPERTIES OUTPUT_NAME robot_state_initializer_node PREFIX "")
    
    
    # Specify libraries to link a library or executable target against
    target_link_libraries(${PROJECT_NAME}_controllers_lib ${catkin_LIBRARIES})
    target_link_libraries(${PROJECT_NAME}_robot_state_initializer_node ${catkin_LIBRARIES})
    
    #############
    ## Install ##
    #############
    
    # all install targets should use catkin DESTINATION variables
    # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
    
    ## Mark executable scripts (Python etc.) for installation
    ## in contrast to setup.py, you can choose the destination
    # catkin_install_python(PROGRAMS
    #   scripts/my_python_script
    #   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
    # )
    
    ## Mark executables for installation
    ## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
    # install(TARGETS ${PROJECT_NAME}_node
    #   RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
    # )
    
    ## Mark libraries for installation
    ## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
    # install(TARGETS ${PROJECT_NAME}
    #   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
    #   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
    #   RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
    # )
    
    ## Mark cpp header files for installation
    # install(DIRECTORY include/${PROJECT_NAME}/
    #   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
    #   FILES_MATCHING PATTERN "*.h"
    #   PATTERN ".svn" EXCLUDE
    # )
    
    ## Mark other files for installation (e.g. launch and bag files, etc.)
    # install(FILES
    #   # myfile1
    #   # myfile2
    #   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
    # )
    
    #############
    ## Testing ##
    #############
    
    ## Add gtest based cpp test target and link libraries
    # catkin_add_gtest(${PROJECT_NAME}-test test/test_gazebo_zones.cpp)
    # if(TARGET ${PROJECT_NAME}-test)
    #   target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
    # endif()
    
    ## Add folders to be run by python nosetests
    # catkin_add_nosetests(test)