[Insight-users] [insight-users] Eclipse setup : debug, viewing sources and correct project tree

Mike Jackson mike.jackson at bluequartz.net
Tue Mar 9 18:51:28 EST 2010


http://www.cmake.org/Wiki/CMake:Eclipse_UNIX_Tutorial

_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio



On Tue, Mar 9, 2010 at 5:14 PM, Antonin Perrot-Audet
<antonin07130 at gmail.com> wrote:
> Hello,
> After spending some time configuring ITK with Xcode, I figured out that the
> code completion was not working, and as I'd like to have a confortable
> environment to code (I like to have a graphical debugger ... etc...), I
> decided to give Eclipse a try... But :
>
> *I have (much) trouble configuring ITK with Eclipse CDT :*
>
> 1)    First of all, when I import the project I get a lot of warnings :
> "
> Invalid project path: Include path not found
> (/Users/antonin/[...]/Programming/ITK/Antonin/TrainEclipse/bin/(framework).
> TRAINPROJ-
> "
> 2)    I can "build all", and get a nice executable in /TrainEclipse/bin/src/
> which works perfectly when executed via a terminal, BUT, I cannot use the
> hammer icon : build the active configuration for the active project...
> 3)    I cannot debug, Eclipse seems not to find the executable it just
> made... The debug configuration is almost empty, and it tells me that there
> should not be an "@" in the configuration name...
> 4)    the generated project doesn't show my sources, it seems like the
> project root is the "build" directory, and my sources are not in the project
> tree
>
> Here is how I organized my sources : (there is only main.cxx for testing
> purpose)
>
> TrainEclipse
> |
> |CMakeLists.txt //content described in CMakeLists I
> |
> |
> |--src
> |    |main.cxx
> |    |CMakeLists.txt //content described in CMakeLists II
> |
> |--lib
> |    |CMakeLists.txt //content described in CMakeLists III
> |
> |--build
> |    |(Cmake generated files for the eclipse project with the
> .project...etc...)
> |
>
> Here are my CMakeLists :
>
> *CMakeLists I :*
> "
> # CmakeList.txt in root of project : structure of project (OMG this is
> heavy)
>
> cmake_minimum_required(VERSION 2.6)
>
> # Name of the project
> PROJECT(TRAINPROJ)
>
> # Project structure
> # add_subdirectory (lib) for now, no lib...
> add_subdirectory (src)
> "
>
>
>
> *CMakeLists II :*
> "
> #CmakeList.txt from the src directory
>
> # Find ITK.
> FIND_PACKAGE(ITK REQUIRED)
> IF(ITK_FOUND)
>   INCLUDE(${ITK_USE_FILE})
> ENDIF(ITK_FOUND)
>
> # Make sure the compiler can find include files from our lib folder
> library(ies).
> INCLUDE_DIRECTORIES(${TRAINPROJ_SOURCE_DIR}/lib)
>
> # Add binary called "main" that is built from the source file "main.cxx".
> # The extension is automatically found.
> ADD_EXECUTABLE(main main.cxx)
>
>
> # Link the executable to the library(ies). (add lib after main)
> TARGET_LINK_LIBRARIES(main ITKNumerics ITKIO itkgdcm itkvcl itkvnl
> ITKAlgorithms ITKBasicFilters ITKCommon )
> "
>
>
>
> *CMakeLists III :*
> "
> # CmakeLists.txt in lib dir
> # Adds a library called lib (liblib.a under Linux) from the source file
> lib.cpp
> # ADD_LIBRARY( lib lib.cpp )
> "
>
>
>
> And Here is how I generated the project for eclipse :
>
> in a terminal, from the build directory :
> "
> cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../
> "
> I simply imported the project in eclipse, specifying the /build folder where
> the .project is.
>
>
>
> Any help would be greatly appreciated,
>
> Regards,
>
> Antonin
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list