[Insight-users] Problem with KDevelop and Cmake

Kayhan Batmanghelich kayhan_batman at yahoo.com
Fri Aug 22 18:02:25 EDT 2008


Hi Bill,

Thank you very much for your reply.

I tried to change CMAKE_CXX_FLAGS_DEBUG and CMAKE_C_FLAGS_DEBUG from "-g" to "-g3 -O0" (as you said) but "-g" is imported from itk and CMake changes it back to "-g". CMake complains that :


--------------------------------------------------
Warning: CMake is forcing CMAKE_C_FLAGS_DEBUG to "-g" 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.

 Warning: CMake is forcing CMAKE_CXX_FLAGS_DEBUG to "-g" 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.

 CMake Warning (dev) in CMakeLists.txt:
   No cmake_minimum_required command is present.  A line of code such as

     cmake_minimum_required(VERSION 2.6)

   should be added at the top of the file.  The version specified may be lower
   if you wish to support older CMake versions for this project.  For more
   information run "cmake --help-policy CMP0000".
 This warning is for project developers.  Use -Wno-dev to suppress it.

---------------------------------

Do you think that I should re-compile ITK again with "-g3 -O0" options or there are some hack to get around it.

Thanks,
Kayhan




----- Original Message ----
From: Bill Lorensen <bill.lorensen at gmail.com>
To: Kayhan Batmanghelich <kayhan_batman at yahoo.com>
Cc: insight-users at itk.org
Sent: Friday, August 22, 2008 2:44:18 PM
Subject: Re: [Insight-users] Problem with KDevelop and Cmake

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
>
>



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080822/621ae5ae/attachment.htm>


More information about the Insight-users mailing list