[Insight-users] debugging Itk code

Xavier Mellado Esteban xavier.mellado at upf.edu
Tue Mar 20 05:14:33 EST 2007


   Hi, Felix:

   Yes, as you said, you need to alter the build with ccmake, if you are 
using the "interactive" CMake. If you are using the command "cmake" you 
will need to alter the itk sources root CMakeList.txt file, but never 
the cache one...

   To be sure about what you are doing, set on the interactive ccmake 
always to "Release" or "Debug" in CMAKE_BUILD_TYPE setting, and do not 
touch release and debug flags set by CMake. Otherwise, if no build type 
is set, ITK will be compiled with the compiler default settings (I think 
if you do not specify anything to gcc, it uses -O2, so is a "release" 
build). Many people coming from Windows doesn't set properly this 
setting, because in .NET you select this using the compiler IDE, but not 
when create the project files with CMake.

                  I hope this helps you:
                                                       Xavi


Felix Bollenbeck escribió:
> Hi Xavier,
> thanks for your reply.
>
> does that mean I have to alter the build with ccmake or in the 
> CMakeLists.txt in the InsightToolkitSources, or is there anything else 
> to do?
>
> Cheers,
>
> Felix.
>
> Xavier Mellado Esteban schrieb:
>>
>>   Hello:
>>
>>   Yes. You need to build two times ITK, one in Release mode and 
>> another one in Debug mode, and link your executable/class with them 
>> depending on the mode you want.
>>
>>   As far as I know, CMake doesn't allow you to link release with 
>> debug libraries or gcc with intel compiler (for example), so for each 
>> combination, you need to build ITK again.
>>
>>               I hope this helps you:
>>                                                       Xavi
>>
>> Felix Bollenbeck escribió:
>>> hi all,
>>> im trying to debug itk code in kdevelop. therefore i set the build 
>>> target
>>>
>>> in CMakeLists.txt:
>>>
>>> SET(CMAKE_BUILD_TYPE=debug)
>>>
>>> in CMakeCache.txt:
>>>
>>> CMAKE_CXX_FLAGS_DEBUG:STRING='-g'
>>>
>>> buildig:
>>>
>>> Warning: CMake is forcing CMAKE_CXX_FLAGS_DEBUG to "" to match that 
>>> imported from ITK. If this message appears for more than one 
>>> imported project, you have conflicting options and will have to 
>>> re-build one of those projects.
>>>
>>> I therefore cant debug the program. Do i have to re-build the whole 
>>> library for debugging?
>>>
>>> cheers,
>>>
>>> felix.
>>>
>>> _______________________________________________
>>> Insight-users mailing list
>>> Insight-users at itk.org
>>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>


-- 
___________________________________

Xavier Mellado Esteban
Computational Imaging Lab
Department of Technology - D. 328
Pompeu Fabra University
Pg. Circumval·lació 8
08003 Barcelona - Spain

Phone: +34 93 542 1323
E-mail: xavier.mellado at upf.edu
Skype: xavier.mellado



More information about the Insight-users mailing list