From: Vivien Delmon Date: Wed, 27 Feb 2013 14:51:50 +0000 (+0100) Subject: Add a way to deactivate libstatgrab when installed. X-Git-Tag: v1.4.0~239^2~3^2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=ca5e9603df2cded0441b4c149c0bd9f8fa7fa483;p=clitk.git Add a way to deactivate libstatgrab when installed. --- diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 0654697..4396d09 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -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() #========================================================= diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 3c7a580..ed51fd8 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -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)