I have a simple project using OpenCV and cmake, and has two source files only segmentation.h and segmentation.cpp.
Here is the cmakefile:
project(Seg
Go to Project, Run and in the run settings check the box that say Run in Terminal. It will make QT Creator launch the program inside a XTerm (default) that plays well with gdb and makes the &"warning: GDB: Failed to set controlling terminal: Inappropriate ioctl for device\n" problem go away.
By default, when launching the debugger, it will also bring QT Creator to the foreground and thus hide the terminal that was brought up. To stop this behaviour go to: Tools, Options, Debugger. In the General tab, untick the check box that say Bring Qt Creator to foreground when application interrupts.
If you want to change the terminal, you can do so in Options, Environment. In the System section the Terminal to what you want. For native Ubuntu / Gnome terminal, set it to /usr/bin/gnome-terminal -x. The parameters in this setting must tell the terminal to execute an external command or program.