X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=CMakeLists.txt;h=8ce5b58371c0804f5ff99368987b438c9306422d;hb=fa8ffff2bc630030df29be49e0779da63398d7ba;hp=563db003a99f5d6111703fda6b9fe480b7b18b20;hpb=9553e9c6ccc78a65b4dfb5d9b661ff4da05ce2c4;p=clitk.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 563db00..8ce5b58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,9 +10,15 @@ 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) + OPTION(CLITK_BUILD_TESTING "Test ITK" ON) + INCLUDE(CTest) +ENDIF(BUILD_TESTING) #========================================================= #========================================================= @@ -45,12 +51,24 @@ ENDIF (CLITK_GENGETOPT STREQUAL "CLITK_GENGETOPT-NOTFOUND") #========================================================= # Find libstatgrab is installed, add clitkMemoryUsage.cxx in the library -FIND_PROGRAM(LIBSTATGRAB NAMES statgrab PATHS) +FIND_LIBRARY(LIBSTATGRAB NAMES statgrab PATHS) IF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND") - MESSAGE("Install libstatgrab (http://www.i-scream.org/libstatgrab/) for memory usage information") +# 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}) @@ -71,9 +89,10 @@ INCLUDE_DIRECTORIES(itk filters segmentation registration tools ${PROJECT_BINARY # Select what is compiled ADD_SUBDIRECTORY(common) -add_subdirectory(tools) -add_subdirectory(segmentation) -add_subdirectory(registration) +ADD_SUBDIRECTORY(tools) +ADD_SUBDIRECTORY(segmentation) +ADD_SUBDIRECTORY(registration) + # Compilation options OPTION(CLITK_EXPERIMENTAL "Enable experimental software and features" OFF) @@ -83,8 +102,12 @@ 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) + ADD_SUBDIRECTORY(vv) ENDIF(CLITK_BUILD_VV) -#========================================================= +#========================================================= +# Build test when vv has been compiled +IF(BUILD_TESTING) + ADD_SUBDIRECTORY(tests) +ENDIF(BUILD_TESTING)