X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=CMakeLists.txt;h=a29891d347014c1b27f9be585561c90dff68996a;hb=1ec47c5838e94f0ff1606093ae3998fc239a3191;hp=0e56357df0282a466c4ffb584b128ec63c79bcbf;hpb=ec55f1d5b6e32c6e4bc0cfa2e3174706729a156e;p=clitk.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e56357..a29891d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,9 +10,14 @@ PROJECT(clitk) #========================================================= INCLUDE(cmake/common.cmake) +#========================================================= + #========================================================= #Support for the CTest dashboard testing system -INCLUDE(CTest) +OPTION(BUILD_TESTING "Build the testing tree" OFF) +IF (BUILD_TESTING) + INCLUDE(CTest) +ENDIF(BUILD_TESTING) #========================================================= #========================================================= @@ -21,8 +26,7 @@ FIND_PACKAGE(ITK) IF(ITK_FOUND) INCLUDE("${ITK_USE_FILE}") ELSE(ITK_FOUND) - MESSAGE(FATAL_ERROR - "Cannot build without ITK. Please set ITK_DIR.") + MESSAGE(FATAL_ERROR "Cannot build without ITK. Please set ITK_DIR.") ENDIF(ITK_FOUND) #========================================================= @@ -44,6 +48,26 @@ IF (CLITK_GENGETOPT STREQUAL "CLITK_GENGETOPT-NOTFOUND") ENDIF (CLITK_GENGETOPT STREQUAL "CLITK_GENGETOPT-NOTFOUND") #========================================================= +#========================================================= +# Find libstatgrab is installed, add clitkMemoryUsage.cxx in the library +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") +#========================================================= + +#========================================================= +# If the user choose to build documentation, then search for Doxygen executables. +OPTION(BUILD_DOXYGEN "Build Doxygen Documentation" OFF) +IF(BUILD_DOXYGEN) + FIND_PACKAGE(Doxygen) + ADD_SUBDIRECTORY(Doxygen) +ENDIF(BUILD_DOXYGEN) +#========================================================= + #========================================================= # Building in the source tree is forbidden IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR}) @@ -68,17 +92,18 @@ add_subdirectory(tools) add_subdirectory(segmentation) add_subdirectory(registration) + # Compilation options OPTION(CLITK_EXPERIMENTAL "Enable experimental software and features" OFF) OPTION(CLITK_BUILD_TOOLS "Build command-line tools" OFF) OPTION(CLITK_BUILD_SEGMENTATION "Build command-line segmentation tools" OFF) OPTION(CLITK_BUILD_REGISTRATION "Build command-line registration tools" OFF) -OPTION(CLITK_MEMORY_INFO "Enable memory information" OFF) OPTION(CLITK_BUILD_VV "Build vv the 4D visualizer (requires VTK and QT)" ON) IF (CLITK_BUILD_VV) - add_subdirectory(vv) + ADD_SUBDIRECTORY(vv) ENDIF(CLITK_BUILD_VV) + #=========================================================