Skip to content
Snippets Groups Projects
Commit 8b9ae0f3 authored by Farid Alijani's avatar Farid Alijani
Browse files

how to build catkin package in QT

parent d195095c
No related branches found
No related tags found
No related merge requests found
--------------------- How to open a catkin package in QT creator --------------------
1. create the pkg
catkin_create_pkg <package name> [depend 1] [depend 2] [depend 3]
2. catkin_make --source .
to make build, devel and CMakeLists.txt file
3. source ./devel/setup.bash
4.
5. remove the CMakeLists.txt in the folder u have catkin package (not the one inside the package)
6. go to opt/ros/hydro/share/catkin/cmake
copy "toplevel.cmake" to the folder u have package
7. 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})
-----------------------------------------------------------------
8. open a QT (go to QT folder and run the file) from a terminal that u've sourced the setup.bash file
9. In QT creator ...
open project -> go to the folder of a package -> open "CMakeLists.txt"
10. Build Location: choose "build" folder from the folder of a package
11. Run Cmake : -DCATKIN_DEVEL_PREFIX=../devel -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=Debug
12.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment