]> Creatis software - cpPlugins.git/blobdiff - lib/Instances/CMakeLists.txt
Windows compilation 3/3
[cpPlugins.git] / lib / Instances / CMakeLists.txt
index 7fdb21474b53704660e5a1f7af280b6158880286..bf7d66505243d96188cc31d2d63d7e77d90b9ede 100644 (file)
@@ -1,47 +1,34 @@
-## =================================
-## == Compile instances libraries ==
-## =================================
+## ===========================
+## == Compile each instance ==
+## ===========================
 
-SET(pfx "cpPlugins_Instances_")
-SET(arg ${pfx} ${prj_VERSION} ${prj_SHORT_VERSION})
+FILE(GLOB _instances "${CMAKE_CURRENT_SOURCE_DIR}/*.i")
 SET(_all_instances)
-
-FILE(GLOB _intances "${CMAKE_CURRENT_SOURCE_DIR}/*.i")
-FOREACH(_i ${_intances})
-  cpPlugins_WrapInstances(_instance ${_i} ${arg})
-  SET(_all_instances ${_all_instances} ${_instance})
-ENDFOREACH(_i)
+FOREACH(_instance ${_instances})
+  CompileInstances(
+    _lib_name
+       ${PROJECT_BINARY_DIR}/lib
+    ${_instance} ${cpPlugins_NUMBER_OF_FILES}
+    "" "${prj_VERSION}" "${prj_SHORT_VERSION}"
+    )
+  LIST(APPEND _all_instances ${_lib_name})
+ENDFOREACH(_instance)
 SET(
   cpPlugins_Instances ${_all_instances}
   CACHE INTERNAL "All valid instances." FORCE
   )
 
-## ===============
-## == Link them ==
-## ===============
-
-TARGET_LINK_LIBRARIES(${pfx}BaseObjects ${ITK_LIBRARIES} ${VTK_LIBRARIES})
-TARGET_LINK_LIBRARIES(${pfx}BaseImages ${pfx}BaseObjects)
-TARGET_LINK_LIBRARIES(${pfx}Mesh ${pfx}BaseObjects)
-TARGET_LINK_LIBRARIES(${pfx}Paths ${pfx}BaseObjects)
-TARGET_LINK_LIBRARIES(${pfx}Transforms ${pfx}BaseObjects)
-TARGET_LINK_LIBRARIES(${pfx}ScalarImages ${pfx}BaseImages)
-TARGET_LINK_LIBRARIES(${pfx}ColorImages ${pfx}BaseImages)
-TARGET_LINK_LIBRARIES(${pfx}VectorImages ${pfx}BaseImages)
-TARGET_LINK_LIBRARIES(${pfx}MedialnessFilters ${pfx}ScalarImages ${pfx}VectorImages)
-TARGET_LINK_LIBRARIES(${pfx}NeighborhoodIterators ${pfx}ScalarImages)
-TARGET_LINK_LIBRARIES(${pfx}BaseImageFilters ${pfx}ScalarImages ${pfx}ColorImages ${pfx}VectorImages)
-TARGET_LINK_LIBRARIES(${pfx}ImageReaders ${pfx}BaseImageFilters)
-TARGET_LINK_LIBRARIES(${pfx}ImageWriters ${pfx}BaseImageFilters)
-TARGET_LINK_LIBRARIES(${pfx}ScalarImagesFilters ${pfx}BaseImageFilters)
-TARGET_LINK_LIBRARIES(${pfx}CastImageFilters ${pfx}ScalarImagesFilters)
-TARGET_LINK_LIBRARIES(${pfx}BitwiseImageFilters ${pfx}ScalarImagesFilters)
-TARGET_LINK_LIBRARIES(${pfx}ThresholdFilters ${pfx}ScalarImagesFilters)
-TARGET_LINK_LIBRARIES(${pfx}ExtractImageFilters ${pfx}ScalarImagesFilters)
-TARGET_LINK_LIBRARIES(${pfx}DistanceMapFilters ${pfx}ThresholdFilters ${pfx}NeighborhoodIterators)
-TARGET_LINK_LIBRARIES(${pfx}MorphologicalImageFilters ${pfx}ScalarImagesFilters ${pfx}ThresholdFilters)
-TARGET_LINK_LIBRARIES(${pfx}GaussianImageFilters ${cpExtensions_LIB} ${pfx}ScalarImagesFilters ${pfx}VectorImages)
-TARGET_LINK_LIBRARIES(${pfx}ResamplingFilters ${pfx}ScalarImagesFilters ${pfx}Transforms)
-TARGET_LINK_LIBRARIES(${pfx}ImageMeshFilters ${pfx}ScalarImagesFilters ${pfx}Mesh)
+## ===========
+## == Links ==
+## ===========
+SET(_pfx "cpPlugins_")
+TARGET_LINK_LIBRARIES(${_pfx}BaseObjects ${ITK_LIBRARIES})
+TARGET_LINK_LIBRARIES(${_pfx}Images ${_pfx}BaseObjects)
+TARGET_LINK_LIBRARIES(${_pfx}BoundingBoxes ${_pfx}BaseObjects)
+TARGET_LINK_LIBRARIES(${_pfx}Meshes ${_pfx}BoundingBoxes)
+TARGET_LINK_LIBRARIES(${_pfx}ImageIterators ${_pfx}Images)
+TARGET_LINK_LIBRARIES(${_pfx}ImageFilters ${_pfx}Images ${_pfx}ImageIterators)
+TARGET_LINK_LIBRARIES(${_pfx}ImageNeighborhoodIterators ${_pfx}Images)
+TARGET_LINK_LIBRARIES(${_pfx}Paths ${_pfx}Images)
 
 ## eof - $RCSfile$