X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=CMakeLists.txt;h=75f52c44af3ac5c5e3af2b0b07c5c7df068f541b;hb=afede09ad631dcf7297e3189aeb1d2288fb25902;hp=c007a11c870295618cbd5497d25253bf1a5fa006;hpb=39e22c039d0de25c4f1e1c60027e4351cb30e445;p=clitk.git diff --git a/CMakeLists.txt b/CMakeLists.txt index c007a11..75f52c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,101 +1,23 @@ #========================================================= # CLITK = Command Line ITK -cmake_minimum_required(VERSION 2.4) -cmake_policy(VERSION 2.4) +cmake_minimum_required(VERSION 2.8) +cmake_policy(VERSION 2.8) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) PROJECT(clitk) +SET(CLITK_SOURCE_DIR ${PROJECT_SOURCE_DIR}) #========================================================= #========================================================= INCLUDE(cmake/common.cmake) +INCLUDE(cmake/dependencies.cmake) +INCLUDE(cmake/build_opt.cmake) #========================================================= - -#========================================================= -# Find ITK (required) -FIND_PACKAGE(ITK) -IF(ITK_FOUND) - INCLUDE("${ITK_USE_FILE}") -ELSE(ITK_FOUND) - MESSAGE(FATAL_ERROR "Cannot build without ITK. Please set ITK_DIR.") -ENDIF(ITK_FOUND) -#========================================================= - -#========================================================= -# Find VTK (required) -FIND_PACKAGE(VTK REQUIRED) -IF(VTK_FOUND) - INCLUDE("${VTK_USE_FILE}") -ELSE(VTK_FOUND) - MESSAGE(FATAL_ERROR "Please set VTK_DIR.") -ENDIF(VTK_FOUND) -#========================================================= - -#========================================================= -# Find gengetopt -FIND_PATH(CLITK_GENGETOPT gengetopt) -IF (CLITK_GENGETOPT STREQUAL "CLITK_GENGETOPT-NOTFOUND") - MESSAGE("gengetopt not found, please install it (see http://www.gnu.org/software/gengetopt/gengetopt.html)") -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") -#========================================================= - -#========================================================= -# Building in the source tree is forbidden -IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR}) - MESSAGE(FATAL_ERROR "Building in the source tree is not allowed ! Quit; remove the file 'CMakeCache.txt' and the folder 'CMakeFiles' an -d build outside the sources (for example 'mkdir build ; cmake '.") -ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR}) -#========================================================= - -#========================================================= -# Remove some MS Visual c++ flags -IF(MSVC) - ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS) -ENDIF(MSVC) -#========================================================= - -#========================================================= -INCLUDE_DIRECTORIES(itk filters segmentation registration tools ${PROJECT_BINARY_DIR}) - # Select what is compiled ADD_SUBDIRECTORY(common) -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) - - -#========================================================= -#Support for the CTest dashboard testing system -INCLUDE(CTest) -#========================================================= -add_subdirectory(tests) -add_subdirectory(tests/tools) -#========================================================= - - -#========================================================= - +ADD_SUBDIRECTORY(tools) +ADD_SUBDIRECTORY(segmentation) +ADD_SUBDIRECTORY(registration)