[Insight-users] ITK&VTK Project in Visual C++

Luis Ibanez luis . ibanez at kitware . com
Tue, 30 Sep 2003 18:23:19 -0400


Hi Robert,


1) The CMakeLists.txt doesn't contain any C++ code.
    It simply specify all the elements that you need
    for building your project.  You may think of a
    CMakeLists.txt file as a generalized "Makefile".


2) You can write a visualization module using VTK.
    One way to go is to create a C++ class that
    contains as members all the VTK objects of the
    visualization pipelilne that you are using.

    You compile this module (class) independently
    and create a library with it.  Then, you use it
    from your application.


Regards,


   Luis


-----------------
Robert-Paul Buitendijk wrote:
 >
.... snip...
> 
> The CMakeList file exists of no source code right?
> It is only a way to tell CMake wich pieces of code to combine?
> How can i then change my code in the CMakeList file?
> 
> 
> My second question is about ITK&VTK.
> I wish to write the pieces of code i need for my project seperately.
> The application part is made in Visual c++ , and now i wish to build the VTK
> code also in Visual C++ but starting from a new file. So that i can Compile
> it and see if it works. That way when i put the VTK code in my
> application(wich is compiled -> no errors) i know that that part of the code
> is also without errors.
> 
> I hope this will make it a bit clearer.
> 
> tnx in andvance
> Robert
> 
> ---
> 
> In your message there seems to be a confusion between
> "libraries" and "header files":
> 
>  > Adding the code to  my project won't work because at that point the
>  > libraries are not yet included.
> 
> 
> 
> and between the VC++ workspace and the actual source
> code of the application:
> 
>  > But if i then use CMake to include them i then
>  > can not change the code.
> 
> 
> 
> Maybe you could rephrase these questions so we can
> provide a better advice.
> 
> 
> ---
> 
>  > Thus: How can i compile the ITK&VTK part of my
>  > code in a simple manner????
> 
> One option that you may consider is to encapsulate
> ITK + VTK into C++ classes that do not expose the
> API of ITK nor VTK.  This is pretty much the approach
> used for the VolView plugins.  In this way, you can
> create a library of components that is built independently
> of your application.
> 
> 
> 
> 
> Regards,
> 
> 
>     Luis
> 
> 
> 
> ------------------------------
> Robert-Paul Buitendijk wrote:
> 
>>Hello
>>
>>The CMakeList.txt file you send me helped a lot.
>>I did find the error, the libraries are now included.
>>
>>How can i make my VTK&ITK code in a efficient way.
>>Adding the code to  my project won't work because at that point the
>>libraries are not yet included.
>>But if i then use CMake to include them i then can not change the code.
>>
>>Thus: How can i compile the ITK&VTK part of my code in a simple manner????
>>
>>Tnx Robert
>>
>>-----Oorspronkelijk bericht-----
>>Van: insight-users-admin at itk . org
>>[mailto:insight-users-admin at itk . org]Namens Luis Ibanez
>>Verzonden: maandag 29 september 2003 22:09
>>Aan: Robert-Paul Buitendijk
>>CC: insight-users at itk . org
>>Onderwerp: Re: [Insight-users] ITK&VTK Project in Visual C++
>>
>>
>>Hi Robert,
>>
>>Can you please post your current CMakeLists.txt file ?
>>
>>Note that once you generate a Visual Studio project
>>from CMake, you should *NOT* modify this project from
>>the VC++ IDE. All changes must be made in the original
>>CMakeLists.txt file and from it the a new project file
>>must be generated.
>>
>>Please find attached the CMakeLists.txt file of a typical
>>application that is using ITK, VTK and FTLK.
>>
>>
>>Regards,
>>
>>
>>    Luis
>>
>>
>>-------------------------------
>>Robert-Paul Buitendijk wrote:
>>
>>
>>>Hello everone
>>>
>>>How do I correctly write a CMakeList.txt file including the ITK&VTK
>>>libraries maintaining
>>>my allready written C++ file.
>>>
>>>The Current CMakeLIST.txt file does add the requested libraries, but i
>>
>>loose
>>
>>
>>>all my info for my existing project.
>>>
>>>tnx in advance
>>>RP
>>>
>>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk . org
>>>http://www . itk . org/mailman/listinfo/insight-users
>>>
>>
>>
>>
>>
>>
>>
> 
> 
> 
> 
> 
> 
>