X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=cmake%2Fdependencies.cmake;h=25b613bf4a069a8a9c6e015184486a366700cf27;hb=29b40d25daee279757fb44b7e2ecfdb38fd6c6f2;hp=bdd63163dd9f99822bef2e5d4743d0817d840f3e;hpb=d268b74408bad9a7388c864e01627d8217549bd6;p=clitk.git diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index bdd6316..25b613b 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -3,6 +3,9 @@ find_package(ITK) if(ITK_FOUND) include("${ITK_USE_FILE}") + if(ITK_VERSION VERSION_GREATER 5.0.0 OR ITK_VERSION VERSION_EQUAL 5.0.0) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif(ITK_VERSION VERSION_GREATER 5.0.0 OR ITK_VERSION VERSION_EQUAL 5.0.0) else(ITK_FOUND) message(FATAL_ERROR "Cannot build without ITK. Please set ITK_DIR.") endif(ITK_FOUND) @@ -44,24 +47,24 @@ find_package(Gengetopt) #========================================================= # Find libstatgrab is installed, add clitkMemoryUsage.cxx in the library -#if(NOT DEFINED CLITK_MEMORY_INFO OR CLITK_MEMORY_INFO) -# 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") -#endif() + 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 +### Check if ITK was compiled with SYSTEM_GDCM = ON (Not possible anymore with ITK 4.13) +### Add option to activate external GDCM in clitk set(CLITK_USE_SYSTEM_GDCM FALSE) -# ITK4 creates a target for each gdcm library when it compiles GDCM -get_target_property(GDCMDICTTARG gdcmDICT TYPE ) -if(NOT GDCMDICTTARG) +if(CLITK_EXTERNAL_GDCM) + message("Be sure to use external GDCM with ITK") set(CLITK_USE_SYSTEM_GDCM TRUE) endif()