[Insight-users] Problem with KDevelop and Cmake

Bill Lorensen bill.lorensen at gmail.com
Fri Aug 22 14:44:18 EDT 2008


Kayhan,

In your CMakeCache.txt file, set
CMAKE_CXX_FLAGS_DEBUG:STRING=-g3 -O0
CMAKE_C_FLAGS_DEBUG:STRING=-g3 -O0
and
CMAKE_BUILD_TYPE:STRING=Debug

You can either edit the CMakeCache.txt file or use ccmake.

Bill

On Fri, Aug 22, 2008 at 1:07 PM, Kayhan Batmanghelich
<kayhan_batman at yahoo.com> wrote:
> Hello Everybody,
>
> Has anybody tried to debug a CMake itk project in kdevelop? Should I change
> something in CMakeList.txt in order to be able to place a breakpoint?
> Here is what I did, I create a kdevelop project by "-G KDevelop3 - Unix
> Makefiles" which makes both Kdevelop and Makefile (cmake-ver2.6). Then I
> opened the project in Kdevelop. It is built fine and even one can debug it
> in gdb by by "break", "run", etc. But when I opened it in Kdevelop and tried
> to stop the program on a breakpoint and step through, nothing happen. It
> seems that program stops somewhere but it does not show where! I have used
> kdevelop for debugging purpose before but not for a Cmake project, this is
> why I think that I must be missing something very obvious for an expert. I
> read somewhere [1] that I should compile my program with "-g3 -O0" but I
> don't where I should put that option in Cmake. I am assuming that it has
> already had "-g" because I am able to debug using gdb.
>
> I would be thankful if you can help.
>
> [1] http://www.kdevelop.org/mediawiki/index.php/FAQ#Debug_FAQs
>
>
> Regards,
> Kayhan
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list