Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

--------------------- How to open a catkin package in QT creator --------------------

  1. create the pkg

catkin_create_pkg <package name=""> [depend 1] [depend 2] [depend 3]

  1. catkin_make --source .

to make build, devel and CMakeLists.txt file

  1. source ./devel/setup.bash

    1. remove the CMakeLists.txt in the folder u have catkin package (not the one inside the package)
  2. go to opt/ros/hydro/share/catkin/cmake

copy "toplevel.cmake" to the folder u have package

  1. Rename it to "CMakeLists.txt"

copy the following lines @ the end of this file:

Add all files in subdirectories of the project in

a dummy_target so qtcreator have access to all files

FILE(GLOB children ${CMAKE_SOURCE_DIR}/) FOREACH(child ${children}) IF(IS_DIRECTORY ${child}) file(GLOB_RECURSE dir_files "${child}/") LIST(APPEND extra_files ${dir_files}) ENDIF() ENDFOREACH()

add_custom_target(dummy_${PROJECT_NAME} SOURCES ${extra_files})

  1. open a QT (go to QT folder and run the file) from a terminal that u've sourced the setup.bash file

  2. In QT creator ... open project -> go to the folder of a package -> open "CMakeLists.txt"

  3. Build Location: choose "build" folder from the folder of a package


  5. 12.