X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=CMakeLists.txt;h=6554e49bda4910e3ed6b395fc5a41d6013e06c03;hb=HEAD;hp=0e56357df0282a466c4ffb584b128ec63c79bcbf;hpb=ec55f1d5b6e32c6e4bc0cfa2e3174706729a156e;p=clitk.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e56357..6554e49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,84 +1,45 @@ #========================================================= # CLITK = Command Line ITK -cmake_minimum_required(VERSION 2.4) -cmake_policy(VERSION 2.4) +project(clitk) +cmake_minimum_required(VERSION 2.8) +cmake_policy(VERSION 2.8) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) + cmake_policy(SET CMP0007 NEW) + cmake_policy(SET CMP0053 NEW) endif(COMMAND cmake_policy) -PROJECT(clitk) +if(NOT DEFINED CLITK_SOURCE_DIR) + set(CLITK_SOURCE_DIR ${PROJECT_SOURCE_DIR}) +endif(NOT DEFINED CLITK_SOURCE_DIR) +# Default build type +IF(NOT CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE Release CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." + FORCE) +ENDIF(NOT CMAKE_BUILD_TYPE) #========================================================= -#========================================================= -INCLUDE(cmake/common.cmake) -#========================================================= -#Support for the CTest dashboard testing system -INCLUDE(CTest) -#========================================================= - -#========================================================= -# 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) -#========================================================= +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) -#========================================================= -# 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") -#========================================================= +if(MSVC) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj" ) + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj" ) +endif(MSVC) -#========================================================= -# 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}) -#========================================================= +if(${CLITK_USE_PACS_CONNECTION}) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgdcmMEXD" ) +endif(${CLITK_USE_PACS_CONNECTION}) #========================================================= -# 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(${CLITK_SOURCE_DIR}/cmake/common.cmake) +include(${CLITK_SOURCE_DIR}/cmake/dependencies.cmake) +include(${CLITK_SOURCE_DIR}/cmake/build_opt.cmake) #========================================================= - #========================================================= -INCLUDE_DIRECTORIES(itk filters segmentation registration tools ${PROJECT_BINARY_DIR}) - +SET(vvPacsConnection true) # 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_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) -ENDIF(CLITK_BUILD_VV) - -#========================================================= - +add_subdirectory(${CLITK_SOURCE_DIR}/common ${PROJECT_BINARY_DIR}/common) +add_subdirectory(${CLITK_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools) +add_subdirectory(${CLITK_SOURCE_DIR}/segmentation ${PROJECT_BINARY_DIR}/segmentation) +add_subdirectory(${CLITK_SOURCE_DIR}/registration ${PROJECT_BINARY_DIR}/registration) +add_subdirectory(${CLITK_SOURCE_DIR}/cluster_tools ${PROJECT_BINARY_DIR}/cluster_tools)