[Insight-users] Makefile structure

Karthik Krishnan Karthik.Krishnan at kitware.com
Thu Aug 24 19:02:29 EDT 2006


Did you add your MySpatialObjectBlob.cxx (if you have a .cxx source) 
sources to the ITKSpatialObject library. If you did, it should get 
compiled and installed for you.

Or did you create your own library with it ? In that case, you will need 
to use CMake to install the target library and install the sources.

See for instance how its done for the SpatialObjects :
  
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/SpatialObject/CMakeLists.txt?annotate=1.10&root=Insight

The lines 

  INSTALL_TARGETS(/lib/InsightToolkit ITKSpatialObject)
  INSTALL_FILES(/include/InsightToolkit/SpatialObject "(\\.h|\\.txx)$")

install the library and the sources.

Kajetan Berlinger wrote:

>Hi Luis,
>
>unfortunately just copying the files to the specific library directory and 
>calling cmake is not enough to add own classes to the itklib.
>The files are not compiled, only the .h and .cxx/txx files are copied 
>
There is no need to copy the .cxx files. The txx and .h files need to be 
copied. The cxx files are compiled into the library and the library 
needs to installed.

>to the 
>include folder. Therefore you can include it, but not use it.
>
>What will I have to do to really integrate my own class to the lib?
>(any changes in config files ?? )
>  
>
>Thanks!
>Kaj
>
>
>
>On Thursday 24 August 2006 10:42, Kajetan Berlinger wrote:
>  
>
>>Hi Luis,
>>
>>ok now with using cmake before and certainly without building the examples
>>and tests everything is fine. Building takes now only a few seconds.
>>
>>And with respect to add own class to ITK, I just added the src files to the
>>specific directory and cmake took care about it.
>>
>>Thanks again!
>>Kaj
>>
>>On Thursday 24 August 2006 10:08, Kajetan Berlinger wrote:
>>    
>>
>>>Hi Luis,
>>>
>>>On Thursday 24 August 2006 05:27, Luis Ibanez wrote:
>>>      
>>>
>>>>Hi Kajetan,
>>>>
>>>>The amount of code that is recompiled depends on how basic
>>>>are the classes that you are modifying.  CMake analyzes
>>>>the dependencies of the source code and build the libraries
>>>>accordingly. Only libraries that depend on the modified code
>>>>should be recompiled.
>>>>        
>>>>
>>>I did not use cmake again, I just used the Makefile, which was created
>>>during the initial installation. I guess this is the mistake?
>>>
>>>      
>>>
>>>>What specific file are you modifying ?
>>>>        
>>>>
>>>The SpacialObject classes (mainly BlobSpatialObject).
>>>Btw, how can I easily add classes to ITK? For example to have a class
>>>MyBlobSpatialObject in the SpatialObject Lib?
>>>
>>>      
>>>
>>>>When you say that it takes a long time to build,
>>>>how much time is this ?
>>>>        
>>>>
>>>'Make intall' takes about 10 minutes. (Centrino 1.73 GHz).
>>>
>>>      
>>>
>>>>Did you enable TESTING and/or EXAMPLES when you
>>>>configured ITK using CMake ?
>>>>        
>>>>
>>>Yes it is enabled. You are right. I did not think about calling cmake
>>>again.
>>>
>>>      
>>>
>>>>    Regards,
>>>>
>>>>
>>>>       Luis
>>>>        
>>>>
>>>Thanks!
>>>Kaj
>>>
>>>      
>>>
>>>>--------------------------
>>>>
>>>>Kajetan Berlinger wrote:
>>>>        
>>>>
>>>>>Hello,
>>>>>
>>>>>when I make some changes in the ITK Code just for debugging purposes,
>>>>>I always call 'make' with the changed file as target, e.g. 'make
>>>>>BlobSpatialObject'. Thus, I spare compiling all the code.
>>>>>But after that to install the libs (I use shared libs) I call 'make
>>>>>install' and that takes very long. So my question is, if there is a
>>>>>possibility to build only the changed libraries with the itk makefile
>>>>>structure?
>>>>>
>>>>>Thanks a lot!
>>>>>Kaj
>>>>>_______________________________________________
>>>>>Insight-users mailing list
>>>>>Insight-users at itk.org
>>>>>http://www.itk.org/mailman/listinfo/insight-users
>>>>>          
>>>>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>>      
>>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>>    
>>
>_______________________________________________
>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