X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=CMakeLists.txt;h=fd3ea26bc9571c0e971224ea779a229663d5ad5a;hb=5bff4d89c8ca42336267c36974e9ceb6fe2ac843;hp=0becec0cc565972e71d1c1089fe252cab7053c65;hpb=f401a57ad3503c83537ea869cf4cd246d842bfc0;p=clitk.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 0becec0..fd3ea26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ #========================================================= # 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) @@ -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) #========================================================= #========================================================= @@ -36,24 +42,31 @@ 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 gengetopt, will create a target exe if not found +SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) +FIND_PACKAGE(Gengetopt) #========================================================= #========================================================= # 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") +# 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}) @@ -74,9 +87,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) @@ -86,8 +100,32 @@ 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) + +#========================================================= +# Install scripts when running make install +SET(SCRIPTS + scripts/calculate_motion_amplitude.sh + scripts/midp_common.sh + scripts/registration.sh + scripts/create_midP.sh + scripts/create_midP-2.0.sh + scripts/create_mhd_4D.sh + scripts/create_mhd_4D_pattern.sh + scripts/create_midP_masks.sh + scripts/create_midP_masks-2.0.sh + scripts/pts_to_landmarks.sh + scripts/create_mhd_3D.sh + scripts/dicom_info.sh +) + +INSTALL (FILES ${SCRIPTS} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)