From ca5e9603df2cded0441b4c149c0bd9f8fa7fa483 Mon Sep 17 00:00:00 2001 From: Vivien Delmon Date: Wed, 27 Feb 2013 15:51:50 +0100 Subject: [PATCH] Add a way to deactivate libstatgrab when installed. --- cmake/dependencies.cmake | 14 ++++++++------ common/CMakeLists.txt | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) 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) -- 2.47.1