[Insight-users] Problem with debugging code using ITK, cmake, and qt creator

Merrem, Andreas a.merrem at dkfz-heidelberg.de
Mon Oct 1 11:17:49 EDT 2012


Hello,

I am working with a program that uses ITK functions and would like to debug it with qt creator. Running it works fine, however, I can't use the debugger and set break points.

I added a custom build step to the project with the following information:
    *
      Name
          o
            cmake
    *
      Command
          o
            /usr/bin/cmake
    *
      Working directory
          o
            $BUILDDIR
    *
      Commandline arguments
          o
            -DCMAKE_BUILD_TYPE=Debug .

When I tried to execute this build step, it first didn't find ITK, when I added the line

SET (ITK_DIR /home/merrem/ITK/build) (i.e. the directory with the ITKConfig.cmake file)

to the CmakeLists.txt file, it apparently managed to find ITK, but didn't really like what it found, and told me:

Running build steps for project VascuSynth...
Starting: /usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug
CMake Error at /home/merrem/ITK/itksource/CMake/ITKModuleAPI.cmake:50 (message):
No such module: "IN"
Call Stack (most recent call first):
/home/merrem/ITK/itksource/CMake/ITKModuleAPI.cmake:25 (itk_module_load)
/home/merrem/ITK/itksource/CMake/ITKModuleAPI.cmake:30 (_itk_module_config_recurse)
/home/merrem/ITK/itksource/CMake/ITKModuleAPI.cmake:67 (_itk_module_config_recurse)
/home/merrem/ITK/build/ITKConfig.cmake:74 (itk_module_config)
/usr/share/cmake/Modules/FindITK.cmake:78 (INCLUDE)
CMakeLists.txt:14 (find_package)

-- Configuring incomplete, errors occurred!
Exited with code 1.
Error while building project VascuSynth
When executing build step 'cmake'


How can I use the debugger on programs using ITK functions? I don't want to look into the ITK functions themselves, so is there a way to avoid rebuilding ITK in the debug mode? If not, how do I link everything once I built ITK in debug mode so that I can use my programming environment the normal way (click on debug if I want to debug, click on run if I want to run, not getting tangled up in a spider web of linking problems and having to change everything each time I want to do something)? Can I do that using only one cmake file?

I would appreciate your help very much, 

Andreas


More information about the Insight-users mailing list