Ask Your Question
0

Including uic auto generated header files in .cpp file

asked 2013-02-28 15:12:41 -0600

newToRos gravatar image

updated 2014-01-28 17:15:28 -0600

ngrennan gravatar image

This may seem like a very stupid question, but I have a QT project that is built using rosbuild and CMake. The ui_form.h file is generated in the CMake build directory. I need to include this file in form.cpp to be able to access my buttons so I currently have (form.cpp is in a src subdirectory):

#include "../build/ui_form.h"

Is this the best way to do it since the build path could change? I could not think of any other way to do it, but I am sure I am missing something.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2015-03-10 19:53:32 -0600

GreatSuccess gravatar image

I just encountered this when moving a package from catkin to rosbuild.

The solution I used was to add the line:

include_directories(include ${PROJECT_SOURCE_DIR}/build)

to the CMakeLists.txt

Then you'd be able to include your file as such:

#include "ui_form.h"
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-02-28 15:12:41 -0600

Seen: 890 times

Last updated: Mar 10 '15