]> Creatis software - clitk.git/blobdiff - common/CMakeLists.txt
add memory usage
[clitk.git] / common / CMakeLists.txt
index 76e9179a825f4cf4905ff21dd9a73741270974bc..2060486baad50703accf39863addd1f41598df6d 100644 (file)
@@ -29,10 +29,24 @@ SET(clitkCommon_SRC
   clitkOrientation.cxx
   vvImage.cxx
   clitkImageToImageGenericFilterBase.cxx
+  clitkExceptionObject.cxx
   clitkFilterBase.cxx
+  clitkMemoryUsage.cxx
 )  
 
+### Declare clitkCommon library
 ADD_LIBRARY(clitkCommon STATIC ${clitkCommon_SRC})
+
+### if LIBSTATGRAB is installed, add clitkMemoryUsage.cxx in the library
+IF(CLITK_MEMORY_INFO)
+  FIND_PROGRAM(LIBSTATGRAB NAMES statgrab PATHS)
+  IF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
+    MESSAGE( FATAL_ERROR "libstatgrab NOT FOUND -> please install http://www.i-scream.org/libstatgrab/")
+  ELSE (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
+    TARGET_LINK_LIBRARIES(clitkCommon statgrab)
+  ENDIF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")  
+ENDIF(CLITK_MEMORY_INFO)
+
 TARGET_LINK_LIBRARIES(clitkCommon vtkCommon vtkImaging vtkHybrid ITKBasicFilters)
 
 ADD_LIBRARY(clitkDicomRTStruct STATIC