+## ===========================================
+## == Directories containing instantiations ==
+## ===========================================
SET(
- _definitions
+ _directories
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
+ Images
+ Geometries
+ Extensions
)
-## =======================
-## == Compile instances ==
-## =======================
+## =========================
+## == Real instantiations ==
+## =========================
-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)
+SET(_pfx cpInstances_)
-## =====================
-## == Further linking ==
-## =====================
-
-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
- )
-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
- )
-TARGET_LINK_LIBRARIES(
- ${_pfx}ImagesIO
- ${_pfx}ScalarImages
- ${_pfx}ColorImages
- ${_pfx}VectorImages
- ${_pfx}Image
- ${_pfx}ImageIterators
- ${_pfx}BaseImageFilters
- )
-TARGET_LINK_LIBRARIES(
- ${_pfx}UnaryFunctorFilters
- ${_pfx}Image
- ${_pfx}ImageIterators
- ${_pfx}BaseImageFilters
- )
-TARGET_LINK_LIBRARIES(
- ${_pfx}BinaryFunctorFilters
- ${_pfx}Image
- ${_pfx}ImageIterators
- ${_pfx}BaseImageFilters
- )
-TARGET_LINK_LIBRARIES(
- ${_pfx}DistanceMapFilters
- ${_pfx}UnaryFunctorFilters
- ${_pfx}Image
- ${_pfx}ImageIterators
- ${_pfx}NeighborhoodImageIterators
- ${_pfx}BaseImageFilters
- )
-TARGET_LINK_LIBRARIES(
- ${_pfx}PolyLineParametricPath
- ${_pfx}BaseObjects
- cpPlugins
+INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}/BaseObjects
+ ${CMAKE_CURRENT_BINARY_DIR}/BaseObjects
+ ${CMAKE_CURRENT_SOURCE_DIR}/Images
+ ${CMAKE_CURRENT_BINARY_DIR}/Images
)
+FOREACH(_dir ${_directories})
+ cpPlugins_BuildLibrary(${_pfx}${_dir} SHARED ${_dir})
+ENDFOREACH(_dir)
+
+## ===========
+## == Links ==
+## ===========
+
+TARGET_LINK_LIBRARIES(${_pfx}BaseObjects ${ITK_LIBRARIES})
+TARGET_LINK_LIBRARIES(${_pfx}Images ${_pfx}BaseObjects ${VTK_LIBRARIES})
+TARGET_LINK_LIBRARIES(${_pfx}Geometries ${_pfx}BaseObjects)
+TARGET_LINK_LIBRARIES(${_pfx}Extensions cpExtensions ${_pfx}Geometries)
+
+## ==========================
+## == Generic data objects ==
+## ==========================
+
+cpPlugins_BuildLibrary(cpPluginsDataObjects SHARED DataObjects)
TARGET_LINK_LIBRARIES(
- ${_pfx}Simple3DCurve
+ cpPluginsDataObjects
cpExtensions
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
- )
-
-## ===================================================
-## == Keep track of all created instances libraries ==
-## ===================================================
-
-SET(
- cpPlugins_AllInstances ${_all_libs}
- CACHE INTERNAL "All valid instances." FORCE
+ ${_pfx}Images ${_pfx}Geometries ${_pfx}Extensions
)
## eof - $RCSfile$