title: Setup GDB with QtCreator
body: <p>I have a simple project using OpenCV and cmake, and has two source files only segmentation.h and segmentation.cpp.</p>
  
  <p>Here is the cmakefile:</p>
  
  <pre><code>project(Segment)
  cmake_minimum_required(VERSION 2.8)
  
  SET(CMAKE_BUILD_TYPE Debug)
  SET(CMAKE_VERBOSE_MAKEFILE true)
  
  if(CMAKE_COMPILER_IS_GNUCXX)
      message(STATUS "GCC detected, adding compile flags")
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -std=c++98 -Wall")
  endif(CMAKE_COMPILER_IS_GNUCXX)
  
  find_package(OpenCV REQUIRED)
  add_executable(Lulu segmentation.cpp segmentation.h)
  target_link_libraries(Lulu ${OpenCV_LIBS})
  </code></pre>
  
  <p>I created a Debug build with argument sent to cmake: -DCMAKE_BUILD_TYPE=Debug . However QtCreator still skip the break points, and can't start gdb properly:</p>
  
  <pre><code>&amp;"warning: GDB: Failed to set controlling terminal: Inappropriate ioctl for device\n"
  </code></pre>
  
  <p>How to fix this problem?</p>