X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=cmake%2Fdependencies.cmake;h=7091fffe04d8ade7c75ef4d846bcc3388a8fdae1;hb=69ca7b4f56b0873c4446859655712091b44e6434;hp=065469736579253f50c44b57c55730da2d518617;hpb=7aba6921403659f09228753f6f452f710cf18faf;p=clitk.git diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 0654697..7091fff 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -44,11 +44,30 @@ 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() #========================================================= + + +#========================================================= +### Check if ITK was compiled with SYSTEM_GDCM = ON +SET(CLITK_USE_SYSTEM_GDCM FALSE) +IF(ITK_VERSION_MAJOR LESS "4") + IF(ITK_USE_SYSTEM_GDCM) + SET(CLITK_USE_SYSTEM_GDCM TRUE) + ENDIF(ITK_USE_SYSTEM_GDCM) +ELSE() + # ITK4 creates a target for each gdcm library when it compiles GDCM + get_target_property(GDCMDICTTARG gdcmDICT TYPE ) + IF(NOT GDCMDICTTARG) + SET(CLITK_USE_SYSTEM_GDCM TRUE) + ENDIF() +ENDIF() +