[Insight-developers] How to add a non-templated class?

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Tue Feb 1 21:07:37 EST 2011


Le 1 févr. 11 à 15:01, Michael Stauffer a écrit :

> Hi,
>
> I'm trying to add a non-templated class to Code/Review.
> I have review mode enabled via ccmake, and .h/.txx sources in Code/ 
> Review are building fine.
>
> In Code/Review/CMakeLists.txt, I added  
> itkCompositeTransformReader.cxx to "set(ITKReview_SRCS" as show in  
> this section:
>
> set(ITKReview_SRCS
>  itkGeometryUtilities.cxx
>  itkCompositeTransformReader.cxx
>  )
> add_library(ITKReview ${ITK_REVIEW_BUILD_TYPE} ${ITKReview_SRCS})
> target_link_libraries(ITKReview ITKCommon ${VXL_NUMERICS_LIBRARIES} )
> if(ITK_LIBRARY_PROPERTIES)
>  set_target_properties(ITKReview PROPERTIES ${ITK_LIBRARY_PROPERTIES})
> endif(ITK_LIBRARY_PROPERTIES)
> if(NOT ITK_INSTALL_NO_LIBRARIES)
>  install(TARGETS ITKReview
>    RUNTIME DESTINATION ${ITK_INSTALL_BIN_DIR_CM24} COMPONENT  
> RuntimeLibraries
>    LIBRARY DESTINATION ${ITK_INSTALL_LIB_DIR_CM24} COMPONENT  
> RuntimeLibraries
>    ARCHIVE DESTINATION ${ITK_INSTALL_LIB_DIR_CM24} COMPONENT  
> Development)
> endif(NOT ITK_INSTALL_NO_LIBRARIES)
>
> Cmake is find the file, because if I put a nonsense filename in  
> "set(ITKReview_SRCS", I get an error. But my source file isn't being  
> compiled and linked - the linker can't find the objects from the  
> file. My guess from the references to "add_library" and  
> "target_link_libraries" is that this should building it, but I  
> really don't know.

Hi Michael,

I think this part is correct, and that the class is added as it should  
to the lib.

>
> Could someone help me out?



Have you added "ITKReview" in the libs of the program you are building?
For example, for itkReviewTests3, there is this code:

   set(ReviewTest3_LIBS
     ITKIOReview
     ITKReview
     ITKIO
     ITKStatistics
     )

Note that ITKReview is listed only for itkReviewTests3 and  
itkReviewTests4.

Regards,

Gaëtan


-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.itk.org
http://www.mandriva.org  http://www.bepo.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110201/7d7e7732/attachment.pgp>


More information about the Insight-developers mailing list