ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

help in cmake for qt ros

asked 2014-07-17 15:29:08 -0600

VahidD gravatar image

updated 2022-01-22 16:16:28 -0600

Evgeny gravatar image

Hi there,

I have a problem and i don't know what is this, if anybody can help i appreciate it, this is my cmake and i get this warning, how can i solve it? warning ==>

    CMake Warning at /opt/ros/hydro/share/catkin/cmake/catkin_package.cmake:409 (message):
      catkin_package() include dir
      '/home/vahid/catkin_ws/src/jur_segmentation/jur_gui_segmentation/build/devel/include'
      should be placed in the devel space instead of the build space
    Call Stack (most recent call first):
      /opt/ros/hydro/share/catkin/cmake/catkin_package.cmake:98 (_catkin_package)
      CMakeLists.txt:22 (catkin_package)

CMAKE ==>

cmake_minimum_required(VERSION 2.8.3)
SET(CMAKE_BUILD_TYPE Release)
project(jur_gui_segmentation)

find_package(catkin REQUIRED COMPONENTS
             qt_build
             roscpp
             sensor_msgs
             message_generation
             cv_bridge
)

find_package(OpenCV 2.4.9 REQUIRED)

include_directories(${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME})

add_service_files(FILES jur_segmentation_service.srv)

generate_messages(DEPENDENCIES sensor_msgs)

catkin_package(
#    CATKIN_DEPENDS
#        qt_build
#        roscpp
#        sensor_msgs
#        message_runtime
#        cv_bridge
#    DEPENDS
#        opencv
)

## Qt
rosbuild_prepare_qt4(QtCore QtGui)

file(GLOB QT_FORMS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ui/*.ui)
file(GLOB QT_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} resources/*.qrc)
file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS include/jur_gui_segmentation/*.h)

QT4_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES})
QT4_WRAP_UI(QT_FORMS_HPP ${QT_FORMS})
QT4_WRAP_CPP(QT_MOC_HPP ${QT_MOC})

file(GLOB_RECURSE QT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS src/*.cpp)
qt4_automoc(QT_SOURCES)

## Declare a cpp executable
add_executable(${PROJECT_NAME} ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP})
target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})

## Mark executables and/or libraries for installation
install(TARGETS ${PROJECT_NAME}
        ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
        LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
        RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(DIRECTORY launch/
        DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
        PATTERN ".svn" EXCLUDE
)
edit retag flag offensive close merge delete

Comments

1

I started seeing this warning myself some time ago and it's due to the MOC compiled files ending up in the build space not the devel space. However, in your case there seems to be another problem that you are using rosbuild commands in your cmakelists in a catkinized workspace.

Andrzej Pronobis gravatar image Andrzej Pronobis  ( 2014-07-20 00:34:34 -0600 )edit

Thanks for tip about rosbuild, I've changed my cmake and i've added qt without any rosbuild macro, by the way, how we can solve this warning, what was your solution?

VahidD gravatar image VahidD  ( 2014-07-21 16:44:54 -0600 )edit

No solution so far unfortunately. This warning appears for any package using QT and MOC, including the standard ROS hydro packages.

Andrzej Pronobis gravatar image Andrzej Pronobis  ( 2014-07-22 14:27:37 -0600 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2014-07-21 17:31:14 -0600

VahidD gravatar image

there is a discussion about same problem

edit flag offensive delete link more

Comments

Is that the same problem indeed? I cannot see any reference to the warning there?

Andrzej Pronobis gravatar image Andrzej Pronobis  ( 2014-07-22 14:26:39 -0600 )edit

Yes, because when i compile code from qtcreator or run cmake alone, i get this warning, but with running catkin_make, there is not any warning. they didn't speak directly about my warning but the problem is same as me.

VahidD gravatar image VahidD  ( 2014-07-22 14:48:21 -0600 )edit

In my case I get the warning when running catkin_make.

Javier V. Gómez gravatar image Javier V. Gómez  ( 2015-08-03 05:57:41 -0600 )edit
0

answered 2016-12-04 19:12:52 -0600

AndyZe gravatar image

updated 2016-12-05 10:49:35 -0600

gvdhoorn gravatar image

I eventually solved this by changing from:

install(TARGETS ${PROJECT_NAME}
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

to...

install(TARGETS ${PROJECT_NAME}
   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-07-17 15:29:08 -0600

Seen: 2,503 times

Last updated: Dec 05 '16