]> Creatis software - clitk.git/commitdiff
Add a way to deactivate libstatgrab when installed.
authorVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Wed, 27 Feb 2013 14:51:50 +0000 (15:51 +0100)
committerVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Wed, 27 Feb 2013 14:51:50 +0000 (15:51 +0100)
cmake/dependencies.cmake
common/CMakeLists.txt

index 065469736579253f50c44b57c55730da2d518617..4396d093127c0ee6016ff35c72a67ff288097d85 100644 (file)
@@ -44,11 +44,13 @@ FIND_PACKAGE(Gengetopt)
 
 #=========================================================
 # Find libstatgrab is installed, add clitkMemoryUsage.cxx in the library
-FIND_LIBRARY(LIBSTATGRAB NAMES statgrab PATHS)
-IF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
+IF (NOT DEFINED CLITK_MEMORY_INFO OR CLITK_MEMORY_INFO)
+  FIND_LIBRARY(LIBSTATGRAB NAMES statgrab PATHS)
+  IF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
 #  MESSAGE("Install libstatgrab (http://www.i-scream.org/libstatgrab/) for memory usage information")
-  SET(CLITK_MEMORY_INFO OFF)
-ELSE (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
-  SET(CLITK_MEMORY_INFO ON)
-ENDIF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")  
+    SET(CLITK_MEMORY_INFO OFF)
+  ELSE (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
+    SET(CLITK_MEMORY_INFO ON)
+  ENDIF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")  
+ENDIF()
 #=========================================================
index 3c7a5803ed801494be97bbb0580604cb7d42a50a..ed51fd85016860a3db0f38be51a3eb1441ab903a 100644 (file)
@@ -55,9 +55,9 @@ ENDIF(CLITK_PRIVATE_FEATURES)
 ### Declare clitkCommon library
 ADD_LIBRARY(clitkCommon STATIC ${clitkCommon_SRC})
 
-IF(NOT ${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
+IF(CLITK_MEMORY_INFO)
   TARGET_LINK_LIBRARIES(clitkCommon statgrab)
-ENDIF(NOT ${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
+ENDIF(CLITK_MEMORY_INFO)
 
 ### Check if ITK was compiled with SYSTEM_GDCM = ON and set the gdcm libraries accordingly
 SET(CLITK_USE_SYSTEM_GDCM FALSE)