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

Michael Stauffer mstauff at verizon.net
Tue Feb 1 15:01:13 EST 2011


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.

Could someone help me out?

Cheers,
Michael



More information about the Insight-developers mailing list