+SET(_pfx cpInstances)
+
+## ======================
+## == Base itk objects ==
+## ======================
SET(
- _definitions
- BaseObjects
- Transforms
- BoundingBox
- Mesh
- ScalarImages
- ComplexImages
- ColorImages
- VectorImages
- MatrixImages
- Image
- ImageIterators
- ImageInterpolators
- NeighborhoodImageIterators
- BaseImageFilters
- ComplexImageFilters
- ImagesIO
- UnaryFunctorFilters
- BinaryFunctorFilters
- DistanceMapFilters
- ImageSliceFilters
- ImageSeparableFilters
- ExtractImageFilters
- ITKDifferenceImageFilters
- ITKAnisotropicSmoothing
- ITKLevelSetFilters
- ITKImageFeatureFilters
- PolyLineParametricPath
- Simple3DCurve
- Skeleton
+ _base
+ ITKBaseObjects
)
+FOREACH(_b ${_base})
+ CreateLib(${_pfx}${_b} SHARED ${CMAKE_CURRENT_SOURCE_DIR}/${_b}.i)
+ TARGET_LINK_LIBRARIES(${_pfx}${_b} ${ITK_LIBRARIES})
+ENDFOREACH(_b ${_base})
-## =======================
-## == Compile instances ==
-## =======================
-
-SET(_all_libs)
-FOREACH(_d ${_definitions})
- FILE(GLOB _files ${CMAKE_CURRENT_SOURCE_DIR}/${_d}.*)
- CreateLib(cpInstances${_d} SHARED ${_files})
- TARGET_LINK_LIBRARIES(
- cpInstances${_d}
- ${ITK_LIBRARIES} ${VTK_LIBRARIES}
- )
- LIST(APPEND _all_libs cpInstances${_d})
-ENDFOREACH(_d)
-
-## =====================
-## == Further linking ==
-## =====================
+## ===========================
+## == Base itk data objects ==
+## ===========================
-SET(_pfx cpInstances)
-TARGET_LINK_LIBRARIES(${_pfx}BoundingBox ${_pfx}BaseObjects cpPlugins)
-TARGET_LINK_LIBRARIES(${_pfx}Transforms ${_pfx}BaseObjects)
-TARGET_LINK_LIBRARIES(${_pfx}Mesh ${_pfx}BoundingBox)
-TARGET_LINK_LIBRARIES(${_pfx}ScalarImages ${_pfx}BaseObjects)
-TARGET_LINK_LIBRARIES(${_pfx}ComplexImages ${_pfx}ScalarImages)
-TARGET_LINK_LIBRARIES(${_pfx}ColorImages ${_pfx}ScalarImages)
-TARGET_LINK_LIBRARIES(${_pfx}VectorImages ${_pfx}ScalarImages)
-TARGET_LINK_LIBRARIES(${_pfx}MatrixImages ${_pfx}ScalarImages)
-TARGET_LINK_LIBRARIES(
- ${_pfx}Image
- ${_pfx}ScalarImages
- ${_pfx}ComplexImages
- ${_pfx}ColorImages
- ${_pfx}VectorImages
- ${_pfx}MatrixImages
- cpPlugins
+CreateLib(
+ ${_pfx}ITKDataObjects
+ SHARED
+ ${CMAKE_CURRENT_SOURCE_DIR}/ITKBoundingBoxes.i
+ ${CMAKE_CURRENT_SOURCE_DIR}/ITKImages.i
+ ${CMAKE_CURRENT_SOURCE_DIR}/ITKMeshes.i
+ ${CMAKE_CURRENT_SOURCE_DIR}/ITKPaths.i
+ ${CMAKE_CURRENT_SOURCE_DIR}/ITKTransforms.i
+ ${CMAKE_CURRENT_SOURCE_DIR}/ITKImageInterpolators.i
)
-TARGET_LINK_LIBRARIES(${_pfx}ImageIterators ${_pfx}Image)
-TARGET_LINK_LIBRARIES(${_pfx}ImageInterpolators ${_pfx}Image)
-TARGET_LINK_LIBRARIES(${_pfx}NeighborhoodImageIterators ${_pfx}Image)
-TARGET_LINK_LIBRARIES(${_pfx}BaseImageFilters ${_pfx}ImageIterators)
TARGET_LINK_LIBRARIES(
- ${_pfx}ComplexImageFilters
- ${_pfx}ImageIterators
- ${_pfx}NeighborhoodImageIterators
+ ${_pfx}ITKDataObjects
+ ${_pfx}ITKBaseObjects ${VTK_LIBRARIES}
)
-TARGET_LINK_LIBRARIES(
- ${_pfx}ImagesIO
- ${_pfx}ScalarImages
- ${_pfx}ColorImages
- ${_pfx}VectorImages
- ${_pfx}Image
- ${_pfx}ImageIterators
- ${_pfx}BaseImageFilters
+
+CreateLib(
+ ${_pfx}ITKImageIterators
+ SHARED
+ ${CMAKE_CURRENT_SOURCE_DIR}/ITKSimpleImageIterators.i
+ ${CMAKE_CURRENT_SOURCE_DIR}/ITKNeighborhoodImageIterators.i
)
TARGET_LINK_LIBRARIES(
- ${_pfx}UnaryFunctorFilters
- ${_pfx}Image
- ${_pfx}ImageIterators
- ${_pfx}BaseImageFilters
+ ${_pfx}ITKImageIterators
+ ${_pfx}ITKDataObjects
)
-TARGET_LINK_LIBRARIES(
- ${_pfx}BinaryFunctorFilters
- ${_pfx}Image
- ${_pfx}ImageIterators
- ${_pfx}BaseImageFilters
+
+CreateLib(
+ ${_pfx}ITKBaseImageFilters
+ SHARED
+ ${CMAKE_CURRENT_SOURCE_DIR}/ITKBaseImageFilters.i
+ ${CMAKE_CURRENT_SOURCE_DIR}/ITK2VTKImageFilters.i
)
TARGET_LINK_LIBRARIES(
- ${_pfx}DistanceMapFilters
- ${_pfx}UnaryFunctorFilters
- ${_pfx}Image
- ${_pfx}ImageIterators
- ${_pfx}NeighborhoodImageIterators
- ${_pfx}BaseImageFilters
+ ${_pfx}ITKBaseImageFilters
+ ${_pfx}ITKImageIterators
)
-TARGET_LINK_LIBRARIES(
- ${_pfx}PolyLineParametricPath
- ${_pfx}BaseObjects
- cpPlugins
+
+CreateLib(
+ cpPluginsDataObjects
+ SHARED
+ ${CMAKE_CURRENT_SOURCE_DIR}/Image.cxx
+ ${CMAKE_CURRENT_SOURCE_DIR}/Image.d
+ ${CMAKE_CURRENT_SOURCE_DIR}/Image.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/Mesh.cxx
+ ${CMAKE_CURRENT_SOURCE_DIR}/Mesh.d
+ ${CMAKE_CURRENT_SOURCE_DIR}/Mesh.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/PolyLineParametricPath.cxx
+ ${CMAKE_CURRENT_SOURCE_DIR}/PolyLineParametricPath.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/PolyLineParametricPath.d
+ ${CMAKE_CURRENT_SOURCE_DIR}/BoundingBox.cxx
+ ${CMAKE_CURRENT_SOURCE_DIR}/BoundingBox.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/Skeleton.cxx
+ ${CMAKE_CURRENT_SOURCE_DIR}/Skeleton.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/Skeleton.d
)
+
TARGET_LINK_LIBRARIES(
- ${_pfx}Simple3DCurve
- cpExtensions
+ cpPluginsDataObjects
cpPlugins
- )
-TARGET_LINK_LIBRARIES(
- ${_pfx}Skeleton
- ${_pfx}PolyLineParametricPath
- )
-TARGET_LINK_LIBRARIES(
- ${_pfx}ImageSliceFilters
- ${_pfx}Image
- ${_pfx}ImageIterators
- ${_pfx}NeighborhoodImageIterators
- ${_pfx}ImageInterpolators
- ${_pfx}BaseImageFilters
- ${_pfx}ComplexImageFilters
- ${_pfx}ExtractImageFilters
- ${_pfx}Transforms
- ${_pfx}Simple3DCurve
- )
-TARGET_LINK_LIBRARIES(
- ${_pfx}ImageSeparableFilters
- ${_pfx}Image
- ${_pfx}BaseImageFilters
- ${_pfx}UnaryFunctorFilters
- )
-TARGET_LINK_LIBRARIES(
- ${_pfx}ExtractImageFilters
- ${_pfx}Image
- ${_pfx}BaseImageFilters
- ${_pfx}ComplexImageFilters
- )
-TARGET_LINK_LIBRARIES(
- ${_pfx}ITKImageFeatureFilters
- ${_pfx}Image
- ${_pfx}BaseImageFilters
- ${_pfx}ComplexImageFilters
- ${_pfx}NeighborhoodImageIterators
- )
-TARGET_LINK_LIBRARIES(
- ${_pfx}ITKDifferenceImageFilters
- ${_pfx}Image
- ${_pfx}BaseImageFilters
- ${_pfx}ComplexImageFilters
- )
-TARGET_LINK_LIBRARIES(
- ${_pfx}ITKAnisotropicSmoothing
- ${_pfx}ITKDifferenceImageFilters
- )
-TARGET_LINK_LIBRARIES(
- ${_pfx}ITKLevelSetFilters
- ${_pfx}ITKAnisotropicSmoothing
- ${_pfx}UnaryFunctorFilters
- ${_pfx}Image
- ${_pfx}ImageIterators
- ${_pfx}NeighborhoodImageIterators
- ${_pfx}BaseImageFilters
- ${_pfx}ImageInterpolators
- ${_pfx}ExtractImageFilters
- ${_pfx}ITKImageFeatureFilters
+ ${_pfx}ITKBaseImageFilters
)
## ===================================================
## ===================================================
SET(
- cpPlugins_AllInstances ${_all_libs}
+ cpPlugins_AllInstances
+ ${_pfx}ITKBaseObjects
+ ${_pfx}ITKDataObjects
+ ${_pfx}ITKImageIterators
+ ${_pfx}ITKBaseImageFilters
CACHE INTERNAL "All valid instances." FORCE
)