QtCreator Debug settings ?

Hi all.

At the moment I am editing CMakeCache.txt to set CMAKE_BUILD_TYPE:STRING=Debug but I would like to be able to switch from release to debug build within QtCreator.

So I have added a new build configuration, named it Debug but now I don’t know where to put the -CMAKE_BUILD_TYPE=Debug (if this is the correct syntax) http://wiki.blender.org/index.php/Dev:Doc/IDE_Configuration/Linux_CMake_QtCreator is not quite detailed in that respect.

Please help.

The way I generally set this up is to have 2 out-of-source builds…

/src/blender – blenders git code
/src/cmake_release – cmake release build
/src/cmake_debug – cmake debug build

The release build typically has no debug symbols, so theres not much use having QtCreator reference it at all, you can simply run the executable, its fast - use for testing optimizations or general usage.

The debug build is referenced from QtCreator and holds the project files.

If you really want, you could setup a separate project file in /src/cmake_release - then you would just open a different project to run the release build from QtCreator. (but both reference same source files)

Thank you, that seems like a viable solution.

So

Debugging

You need to set CMAKE_BUILD_TYPE to Debug.

in the wiki doesn’t mean changing a setting in qtcreator but rather using cmakegui or editing CMakeCache.txt like I did ?

@Marv - You can use ccmake, cmake-gui or edit CMakeCache.txt directly.

Maybe QtCreator can be setup to re-configure cmake, but not sure its worth it.

An advantage with this setup is you can switch the same CMake project to a different IDE without much trouble. Though so far I’ve not been that impressed by the alternatives.

I see, thanks !