FW: [Insight-users] ITK/Eclipse configuration problem
Fleming, Matthew
mfleming at mcw.edu
Mon May 21 10:48:15 EDT 2007
________________________________
From: Mike Jackson [mailto:imikejackson at gmail.com]
Sent: Mon 5/21/2007 9:34 AM
To: Fleming, Matthew
Subject: Re: [Insight-users] ITK/Eclipse configuration problem
I am not on the Insight Mail list any more, so forward this to the
list if you want to.
The idea of configurations for standard make builds is not well
supported, if at all, in Eclipse 3.2 with CDT 3.1.2. From the looks
of Eclipse 3.3M7 and CDT RC0 it looks like that is changing. I can
now have a named configuration(s) even with standard make projects.
The easiest way to take advantage of this might be to have 2 build
directories inside your project (Debug and Release) and then create a
"configuration" that points "make -C Debug or make -C Release.
I have been using the Eclipse 3.3 Milestones and so far 3.3M7 and
CDT RC0 is working pretty decently. 3.3M7 + CDT RC1 wasn't so great
on my setup (OS X 10.4.9 Intel). Mainly the indexing regressed and
did not work well.
Hope that helps.
Also, concerning the wiki, let me know what spots gave you troubles
and I will get it updated ASAP. The tutorial was written quickly with
my 2 kids playing in the background so I might have missed something.
I will be happy to correct or add detail where you think it is
needed. My goal is to have the combination of Cmake and Eclipse be a
happy one so more people are drawn to both systems.
--
Mike Jackson Senior Research Engineer
Innovative Management & Technology Services
On May 21, 2007, at 9:50 AM, Fleming, Matthew wrote:
>
> Yes, you are quite correct, the problem was that the programs were
> being compiled without the -g flags. If I add the "-g" flag to
> CMAKE_CXX_FLAGS, I am able to debug.
>
> What seems odd to me is that the -g flag is left off even if
> CMakeLists.txt includes 'SET(CMAKE_BUILD_TYPE "Debug")'.
>
> Perhaps the author of http://www.cmake.org/Wiki/
> CMake_Editors_Support (Mike Jackson) could have a look at this -- I
> have cc'd him this message. There seem to be one or two other
> errors in that page anyway, it doesn't quite work if you follow the
> directions because the directories aren't specified quite right.
> Ideally it would be possible to incorporate a CMake project into
> Eclipse so that there would be both Debug and Release
> configurations -- this seems to be what Eclipse does automagically
> for Managed Make Projects. Probably there is no easy way to make
> this happen with a CMake project. Anyway, I have the CMake book on
> order, and hope to understand the problem better once it arrives.
>
> Thanks to you and Mr. Jackson for your assistance.
>
> Matthew Fleming
>
> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
> Sent: Sat 5/19/2007 5:05 PM
> To: Fleming, Matthew
> Cc: insight-users at itk.org
> Subject: Re: [Insight-users] ITK/Eclipse configuration problem
>
>
> Hi Matthew,
>
> From your description it seems that the Debug compilation
> flags are not making it into the Makefile.
>
> Please do a recursive grep in the project directory in
> search of the "-g" flag in the Makefiles.
>
> You can also take the resulting executable, and try to
> run it from gdb or ddd to see if you manage to set
> breakpoints. If breakpoints don't work in gdb or ddd
> then your executable was probably built without -g.
>
> As a temporary fix, you can simply add the "-g" flag
> to the CMAKE_C_FLAGS and CMAKE_CXX_FLAGS.
>
>
> Please let us know what you find.
>
>
> Thanks,
>
>
> Luis
>
>
> ----------------------
> Fleming, Matthew wrote:
>> Folks,
>>
>> I would like to use Eclipse for ITK programming. (I am new to
>> both, so if the following has an obvious solution that I have
>> missed, please excuse me.) I installed Eclipse with CDT and the
>> CMake plug-in, as well as ITK, on Ubuntu Linux. I then used the
>> example from InsightToolkit-3.2.0/Examples/Installation, building
>> the Makefile with CMake and importing the project into Eclipse as
>> a "Standard C++ Makefile Project". In this, I was basically
>> following the instructions from http://www.cmake.org/Wiki/
>> CMake_Editors_Support. Everything worked as advertised, except
>> for one problem; I was able to use CMake from within Eclipse to
>> regenerate the Makefile and clean, build, and run the HelloWorld
>> application. The problem is that debugging doesn't quite work.
>> When I start the debug, execution stops at the beginning of the
>> program, and when I then press the "Resume" button, it runs to
>> completion, even if breakpoints are set. Presumably this problem
>> has a simple solution, but I've been
> looking at it for awhile now, and can't determine what it is. Any
> suggestions would be much appreciated.
>>
>> I've included the contents of my CmakeLists.txt below.
>>
>> Thanks,
>>
>> Matthew Fleming
>>
>> # This project is designed to be built outside the Insight source
>> tree.
>> PROJECT(HelloWorld)
>>
>> # Find ITK.
>> FIND_PACKAGE(ITK REQUIRED)
>> IF(ITK_FOUND)
>> INCLUDE(${ITK_USE_FILE})
>> ENDIF(ITK_FOUND)
>>
>> IF(CMAKE_COMPILER_IS_GNUCC)
>> SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
>> ENDIF(CMAKE_COMPILER_IS_GNUCC)
>> IF(CMAKE_COMPILER_IS_GNUCXX)
>> SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
>> ENDIF(CMAKE_COMPILER_IS_GNUCXX)
>>
>> SET(CMAKE_VERBOSE_MAKEFILE ON)
>>
>> SET(CMAKE_BUILD_TYPE "Debug")
>>
>>
>> ADD_EXECUTABLE(HelloWorld HelloWorld.cxx )
>>
>> TARGET_LINK_LIBRARIES(HelloWorld ITKCommon)
>> _______________________________________________
>> 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