help in cmake for qt ros
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
)
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.
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?
No solution so far unfortunately. This warning appears for any package using QT and MOC, including the standard ROS hydro packages.