X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=CMakeLists.txt;h=6f3a808b32ac68a1442317950512230e03110907;hb=15a5a2146a9429085a0827e1edf57c2cf0fa3861;hp=b8fb33daeb433b66bed0243abc8024c06a102d84;hpb=f6d1d7ca3b026997694d41f3afe1d16de2d06927;p=clitk.git diff --git a/CMakeLists.txt b/CMakeLists.txt index b8fb33d..6f3a808 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,10 +16,9 @@ INCLUDE(cmake/common.cmake) # Find ITK (required) FIND_PACKAGE(ITK) IF(ITK_FOUND) - INCLUDE(${ITK_USE_FILE}) + 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) #========================================================= @@ -27,7 +26,7 @@ ENDIF(ITK_FOUND) # Find VTK (required) FIND_PACKAGE(VTK REQUIRED) IF(VTK_FOUND) - INCLUDE(${VTK_USE_FILE}) + INCLUDE("${VTK_USE_FILE}") ELSE(VTK_FOUND) MESSAGE(FATAL_ERROR "Please set VTK_DIR.") ENDIF(VTK_FOUND) @@ -41,6 +40,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}) @@ -57,34 +76,35 @@ ENDIF(MSVC) #========================================================= #========================================================= -INCLUDE_DIRECTORIES(itk filters ${PROJECT_BINARY_DIR}) +INCLUDE_DIRECTORIES(itk filters segmentation registration tools ${PROJECT_BINARY_DIR}) # Select what is compiled ADD_SUBDIRECTORY(common) -ADD_SUBDIRECTORY(filters) +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_BUILD_VV "Build vv the 4D visualizer (requires VTK and QT)" ON) IF (CLITK_BUILD_VV) add_subdirectory(vv) ENDIF(CLITK_BUILD_VV) -OPTION(CLITK_BUILD_TOOLS "Build command-line tools" OFF) -IF (CLITK_BUILD_TOOLS) - add_subdirectory(tools) -ENDIF(CLITK_BUILD_TOOLS) -OPTION(CLITK_BUILD_SEGMENTATION "Build segmentation tools" OFF) -IF (CLITK_BUILD_SEGMENTATION) - add_subdirectory(segmentation) -ENDIF (CLITK_BUILD_SEGMENTATION) +#========================================================= +#Support for the CTest dashboard testing system +INCLUDE(CTest) +#========================================================= +add_subdirectory(tests) +add_subdirectory(tests/tools) +#========================================================= -OPTION(CLITK_BUILD_REGISTRATION "Build command-line registration tools" OFF) -IF (CLITK_BUILD_REGISTRATION) - add_subdirectory(registration) -ENDIF(CLITK_BUILD_REGISTRATION) #=========================================================