]> Creatis software - clitk.git/commitdiff
STYLE: Move CMake commands to match new conventions
authorHans Johnson <hans-johnson@uiowa.edu>
Thu, 5 Jun 2014 15:59:00 +0000 (10:59 -0500)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Tue, 10 Jun 2014 11:48:48 +0000 (13:48 +0200)
The next step in removing end-of-lines is to run through all the
CMakeLists.txt files and clean them up.

This also changes all the key words to lower
case. The primary reason for changing key words is that all documentation for
CMakeLists.txt now shows the key words as lower case. Even the printed
“Mastering CMake v5” uses lower case. I’ve come across this several
times in my class where students stumble over the fact that the
documentation about Cmake does not match the implementation in ITK.

I have a script (a wrapper around a vim macro) written that can make
these substituions reliably (Tested on the BRAINS tree, the Slicer3
tree, and the ITK tree without causing any errors).  more complete
documentaiton can be found attached to

19 files changed:
CMakeLists.txt
CTestConfig.cmake
Doxygen/CMakeLists.txt
cluster_tools/CMakeLists.txt
cmake/FindGengetopt.cmake
cmake/FindROOT.cmake
cmake/build_opt.cmake
cmake/common.cmake
cmake/dependencies.cmake
common/CMakeLists.txt
registration/CMakeLists.txt
segmentation/CMakeLists.txt
superbuild/CMakeLists.txt
tests/CMakeLists.txt
tests/tools/CMakeLists.txt
tools/CMakeLists.txt
utilities/CxImage/CMakeLists.txt
utilities/gengetopt/CMakeLists.txt
vv/CMakeLists.txt

index 7bc48eb54f426638398215452f1ebd7dfcf7a7d0..ee3b2a79fd307fd537fef992be4147c063fcaba7 100644 (file)
@@ -1,33 +1,33 @@
 #=========================================================
 # CLITK = Command Line ITK
-PROJECT(clitk)
+project(clitk)
 cmake_minimum_required(VERSION 2.8)
 cmake_policy(VERSION 2.8)
 if(COMMAND cmake_policy)
     cmake_policy(SET CMP0003 NEW)
 endif(COMMAND cmake_policy)
-IF(NOT DEFINED CLITK_SOURCE_DIR)
-  SET(CLITK_SOURCE_DIR ${PROJECT_SOURCE_DIR})
-ENDIF(NOT DEFINED CLITK_SOURCE_DIR)
+if(NOT DEFINED CLITK_SOURCE_DIR)
+  set(CLITK_SOURCE_DIR ${PROJECT_SOURCE_DIR})
+endif(NOT DEFINED CLITK_SOURCE_DIR)
 #=========================================================
 
-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 
-IF(MSVC)
-  SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj" )
-  SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj" )
-ENDIF(MSVC)
+if(MSVC)
+  set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj" )
+  set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj" )
+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(${CLITK_SOURCE_DIR}/cmake/common.cmake)
+include(${CLITK_SOURCE_DIR}/cmake/dependencies.cmake)
+include(${CLITK_SOURCE_DIR}/cmake/build_opt.cmake)
 #=========================================================
 #=========================================================
 
 # Select what is compiled
-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)
+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)
index 15bbadd615cfa17269b85c13408d813e1e3237dc..3a20d28372ab8aae7b947179f545767d77a20839 100644 (file)
@@ -1,8 +1,8 @@
-MACRO(SET_IF_NOT_SET var val)
-  IF(NOT DEFINED "${var}")
-    SET("${var}" "${val}")
-  ENDIF(NOT DEFINED "${var}")
-ENDMACRO(SET_IF_NOT_SET)
+macro(SET_IF_NOT_SET var val)
+  if(NOT DEFINED "${var}")
+    set("${var}" "${val}")
+  endif(NOT DEFINED "${var}")
+endmacro(SET_IF_NOT_SET)
 
 # Those are set for running a classical make Experimental
 SET_IF_NOT_SET(CTEST_DROP_METHOD "http")
index 6c57945a532dd7ff80d34dfb756f3cfb64669a63..1e48ba8d2fe5c2dde15e48a581e242c9db1081db 100644 (file)
@@ -1,24 +1,24 @@
 #
 # Build the documentation
 #
-INCLUDE (${CMAKE_ROOT}/Modules/Documentation.cmake)
+include(${CMAKE_ROOT}/Modules/Documentation.cmake)
 
-IF (BUILD_DOXYGEN)
+if(BUILD_DOXYGEN)
 
   #
   # Configure the script and the doxyfile, then add target
   #
-  CONFIGURE_FILE(${CLITK_SOURCE_DIR}/Doxygen/doxygen.config.in
+  configure_file(${CLITK_SOURCE_DIR}/Doxygen/doxygen.config.in
                  ${PROJECT_BINARY_DIR}/Doxygen/doxygen.config)
 
-               CONFIGURE_FILE(${CLITK_SOURCE_DIR}/Doxygen/itkdoxygen.pl.in
+               configure_file(${CLITK_SOURCE_DIR}/Doxygen/itkdoxygen.pl.in
                  ${PROJECT_BINARY_DIR}/Doxygen/itkdoxygen.pl)
 
-  ADD_CUSTOM_TARGET(Documentation 
+  add_custom_target(Documentation
     COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxygen/doxygen.config
     MAIN_DEPENDENCY ${PROJECT_BINARY_DIR}/Doxygen/doxygen.config
     DEPENDS         ${PROJECT_BINARY_DIR}/Doxygen/itkdoxygen.pl
     WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/Doxygen
     )
 
-ENDIF (BUILD_DOXYGEN)
+endif(BUILD_DOXYGEN)
index 5ef6a060f4dd93ef9057dd9302d22307934a6a13..caeb178bba217ab7afc3de2c596a72ab6596739e 100644 (file)
@@ -1,7 +1,7 @@
-IF (CLITK_BUILD_TOOLS)
+if(CLITK_BUILD_TOOLS)
   #=========================================================
   # Install scripts when running make install
-  SET(SCRIPTS
+  set(SCRIPTS
     gate_job_cluster.job
     gate_make_merge_release.sh
     gate_make_release.sh
@@ -13,6 +13,6 @@ IF (CLITK_BUILD_TOOLS)
     mergeStatFile.sh
     )
 
-  INSTALL (FILES ${SCRIPTS} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
+  install(FILES ${SCRIPTS} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
 
-ENDIF(CLITK_BUILD_TOOLS)
+endif(CLITK_BUILD_TOOLS)
index 95f2a474897059f2a7248f1b80267c053b84c268..090303cde90177fb391475fb7fe003d77c35c29d 100644 (file)
@@ -1,22 +1,22 @@
 
 # Attempt to find gengetopt. If not found, compile it.
-FIND_PROGRAM(GENGETOPT gengetopt)
-IF (GENGETOPT STREQUAL "GENGETOPT-NOTFOUND")
-  GET_FILENAME_COMPONENT(CLITK_CMAKE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
-  ADD_SUBDIRECTORY(${CLITK_CMAKE_DIR}/../utilities/gengetopt ${CMAKE_CURRENT_BINARY_DIR}/gengetopt)
-ELSE(GENGETOPT STREQUAL "GENGETOPT-NOTFOUND")
-  ADD_EXECUTABLE(gengetopt IMPORTED)
-  SET_PROPERTY(TARGET gengetopt PROPERTY IMPORTED_LOCATION ${GENGETOPT})
-ENDIF(GENGETOPT STREQUAL "GENGETOPT-NOTFOUND")
+find_program(GENGETOPT gengetopt)
+if(GENGETOPT STREQUAL "GENGETOPT-NOTFOUND")
+  get_filename_component(CLITK_CMAKE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+  add_subdirectory(${CLITK_CMAKE_DIR}/../utilities/gengetopt ${CMAKE_CURRENT_BINARY_DIR}/gengetopt)
+else(GENGETOPT STREQUAL "GENGETOPT-NOTFOUND")
+  add_executable(gengetopt IMPORTED)
+  set_property(TARGET gengetopt PROPERTY IMPORTED_LOCATION ${GENGETOPT})
+endif(GENGETOPT STREQUAL "GENGETOPT-NOTFOUND")
 
-MACRO (WRAP_GGO GGO_SRCS)
-  FOREACH(GGO_FILE ${ARGN})
-    GET_FILENAME_COMPONENT(GGO_BASEFILENAME ${GGO_FILE} NAME_WE)
-    GET_FILENAME_COMPONENT(GGO_FILE_ABS ${GGO_FILE} ABSOLUTE)
-    SET(GGO_H ${GGO_BASEFILENAME}_ggo.h)
-    SET(GGO_C ${GGO_BASEFILENAME}_ggo.c)
-    SET(GGO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${GGO_H} ${CMAKE_CURRENT_BINARY_DIR}/${GGO_C})
-    ADD_CUSTOM_COMMAND(OUTPUT ${GGO_OUTPUT}
+macro(WRAP_GGO GGO_SRCS)
+  foreach(GGO_FILE ${ARGN})
+    get_filename_component(GGO_BASEFILENAME ${GGO_FILE} NAME_WE)
+    get_filename_component(GGO_FILE_ABS ${GGO_FILE} ABSOLUTE)
+    set(GGO_H ${GGO_BASEFILENAME}_ggo.h)
+    set(GGO_C ${GGO_BASEFILENAME}_ggo.c)
+    set(GGO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${GGO_H} ${CMAKE_CURRENT_BINARY_DIR}/${GGO_C})
+    add_custom_command(OUTPUT ${GGO_OUTPUT}
                        COMMAND gengetopt
                        ARGS < ${GGO_FILE_ABS}
                               --output-dir=${CMAKE_CURRENT_BINARY_DIR}
@@ -28,15 +28,15 @@ MACRO (WRAP_GGO GGO_SRCS)
                               --include-getopt
                        DEPENDS ${GGO_FILE_ABS}
                       )
-    SET(${GGO_SRCS} ${${GGO_SRCS}} ${GGO_OUTPUT})
-    INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
-  ENDFOREACH(GGO_FILE)
-  SET_SOURCE_FILES_PROPERTIES(${${GGO_SRCS}} PROPERTIES GENERATED TRUE)
-  IF(CMAKE_COMPILER_IS_GNUCXX)
-    FIND_PROGRAM(DEFAULT_GCC gcc)
-    EXEC_PROGRAM(${DEFAULT_GCC} ARGS "-dumpversion" OUTPUT_VARIABLE GCCVER)
-    IF("${GCCVER}" VERSION_GREATER "4.5.2")
-      SET_SOURCE_FILES_PROPERTIES(${${GGO_SRCS}} PROPERTIES COMPILE_FLAGS "-Wno-unused-but-set-variable")
-    ENDIF("${GCCVER}" VERSION_GREATER "4.5.2")
-  ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-ENDMACRO (WRAP_GGO)
+    set(${GGO_SRCS} ${${GGO_SRCS}} ${GGO_OUTPUT})
+    include_directories(${CMAKE_CURRENT_BINARY_DIR})
+  endforeach(GGO_FILE)
+  set_source_files_properties(${${GGO_SRCS}} PROPERTIES GENERATED TRUE)
+  if(CMAKE_COMPILER_IS_GNUCXX)
+    find_program(DEFAULT_GCC gcc)
+    exec_program(${DEFAULT_GCC} ARGS "-dumpversion" OUTPUT_VARIABLE GCCVER)
+    if("${GCCVER}" VERSION_GREATER "4.5.2")
+      set_source_files_properties(${${GGO_SRCS}} PROPERTIES COMPILE_FLAGS "-Wno-unused-but-set-variable")
+    endif("${GCCVER}" VERSION_GREATER "4.5.2")
+  endif(CMAKE_COMPILER_IS_GNUCXX)
+endmacro(WRAP_GGO)
index db14f988662d855e6bd8a44129ad86137f2aa6e2..f0482994223dcde4db584e6045f1eb314290cf9e 100644 (file)
 # It tries to find the root-config script which gives you all the needed information.
 # If the system variable ROOTSYS is set this is straight forward.
 # If not the module uses the pathes given in ROOT_CONFIG_SEARCHPATH.
-# If you need an other path you should add this path to this varaible.  
+# If you need an other path you should add this path to this varaible.
 # The root-config script is then used to detect basically everything else.
 # This module defines a number of key variables and macros.
 
 
-MESSAGE(STATUS "Looking for Root...")
+message(STATUS "Looking for Root...")
 
-SET(ROOT_DEFINITIONS "")
+set(ROOT_DEFINITIONS "")
 
-SET(ROOT_INSTALLED_VERSION_TOO_OLD FALSE)
+set(ROOT_INSTALLED_VERSION_TOO_OLD FALSE)
 
-SET(ROOT_CONFIG_EXECUTABLE ROOT_CONFIG_EXECUTABLE-NOTFOUND)
+set(ROOT_CONFIG_EXECUTABLE ROOT_CONFIG_EXECUTABLE-NOTFOUND)
 
-FIND_PROGRAM(ROOT_CONFIG_EXECUTABLE NAMES root-config PATHS)
-    
-IF (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND")
-  MESSAGE( FATAL_ERROR "ROOT not installed in the searchpath and ROOTSYS is not set. Please
+find_program(ROOT_CONFIG_EXECUTABLE NAMES root-config PATHS)
+
+if(${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND")
+  message( FATAL_ERROR "ROOT not installed in the searchpath and ROOTSYS is not set. Please
  set ROOTSYS or add the path to your ROOT installation in the Macro FindROOT.cmake in the
  subdirectory cmake/modules.")
-ELSE (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND")
-               MESSAGE(STATUS "root-config found")
-  STRING(REGEX REPLACE "(^.*)/bin/root-config" "\\1" test ${ROOT_CONFIG_EXECUTABLE}) 
-  SET( ENV{ROOTSYS} ${test})
+else(${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND")
+               message(STATUS "root-config found")
+  string(REGEX REPLACE "(^.*)/bin/root-config" "\\1" test ${ROOT_CONFIG_EXECUTABLE})
+  set( ENV{ROOTSYS} ${test})
   set( ROOTSYS ${test})
-ENDIF (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND")  
+endif(${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND")
+
+
+if(ROOT_CONFIG_EXECUTABLE)
 
-IF (ROOT_CONFIG_EXECUTABLE)
-   
-  SET(ROOT_FOUND FALSE)
+  set(ROOT_FOUND FALSE)
 
-  EXEC_PROGRAM(${ROOT_CONFIG_EXECUTABLE} ARGS "--version" OUTPUT_VARIABLE ROOTVERSION)
+  exec_program(${ROOT_CONFIG_EXECUTABLE} ARGS "--version" OUTPUT_VARIABLE ROOTVERSION)
 
-  MESSAGE(STATUS "Looking for Root... - found $ENV{ROOTSYS}/bin/root")
-  MESSAGE(STATUS "Looking for Root... - version ${ROOTVERSION} ")   
+  message(STATUS "Looking for Root... - found $ENV{ROOTSYS}/bin/root")
+  message(STATUS "Looking for Root... - version ${ROOTVERSION} ")
 
   # we need at least version 5.00/00
-  IF (NOT ROOT_MIN_VERSION)
-    SET(ROOT_MIN_VERSION "5.00/00")
-  ENDIF (NOT ROOT_MIN_VERSION)
-   
+  if(NOT ROOT_MIN_VERSION)
+    set(ROOT_MIN_VERSION "5.00/00")
+  endif(NOT ROOT_MIN_VERSION)
+
   # now parse the parts of the user given version string into variables
-  STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+" "\\1" req_root_major_vers "${ROOT_MIN_VERSION}")
-  STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" req_root_minor_vers "${ROOT_MIN_VERSION}")
-  STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+)" "\\1" req_root_patch_vers "${ROOT_MIN_VERSION}")
-   
+  string(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+" "\\1" req_root_major_vers "${ROOT_MIN_VERSION}")
+  string(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" req_root_minor_vers "${ROOT_MIN_VERSION}")
+  string(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+)" "\\1" req_root_patch_vers "${ROOT_MIN_VERSION}")
+
   # and now the version string given by qmake
-  STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+.*" "\\1" found_root_major_vers "${ROOTVERSION}")
-  STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" found_root_minor_vers "${ROOTVERSION}")
-  STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+).*" "\\1" found_root_patch_vers "${ROOTVERSION}")
+  string(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+.*" "\\1" found_root_major_vers "${ROOTVERSION}")
+  string(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" found_root_minor_vers "${ROOTVERSION}")
+  string(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+).*" "\\1" found_root_patch_vers "${ROOTVERSION}")
 
-  IF (found_root_major_vers LESS 5)
-    MESSAGE( FATAL_ERROR "Invalid ROOT version \"${ROOTERSION}\", at least major version 4 is required, e.g. \"5.00/00\"")
-  ENDIF (found_root_major_vers LESS 5)
+  if(found_root_major_vers LESS 5)
+    message( FATAL_ERROR "Invalid ROOT version \"${ROOTERSION}\", at least major version 4 is required, e.g. \"5.00/00\"")
+  endif(found_root_major_vers LESS 5)
 
   # compute an overall version number which can be compared at once
-  MATH(EXPR req_vers "${req_root_major_vers}*10000 + ${req_root_minor_vers}*100 + ${req_root_patch_vers}")
-  MATH(EXPR found_vers "${found_root_major_vers}*10000 + ${found_root_minor_vers}*100 + ${found_root_patch_vers}")
-   
-  IF (found_vers LESS req_vers)
-    SET(ROOT_FOUND FALSE)
-    SET(ROOT_INSTALLED_VERSION_TOO_OLD TRUE)
-  ELSE (found_vers LESS req_vers)
-    SET(ROOT_FOUND TRUE)
-  ENDIF (found_vers LESS req_vers)
+  math(EXPR req_vers "${req_root_major_vers}*10000 + ${req_root_minor_vers}*100 + ${req_root_patch_vers}")
+  math(EXPR found_vers "${found_root_major_vers}*10000 + ${found_root_minor_vers}*100 + ${found_root_patch_vers}")
+
+  if(found_vers LESS req_vers)
+    set(ROOT_FOUND FALSE)
+    set(ROOT_INSTALLED_VERSION_TOO_OLD TRUE)
+  else(found_vers LESS req_vers)
+    set(ROOT_FOUND TRUE)
+  endif(found_vers LESS req_vers)
 
-ENDIF (ROOT_CONFIG_EXECUTABLE)
+endif(ROOT_CONFIG_EXECUTABLE)
 
-#MESSAGE("root found = "${ROOT_FOUND})
+#message("root found = "${ROOT_FOUND})
 
-IF (ROOT_FOUND)
+if(ROOT_FOUND)
 
   # ask root-config for the library dir
   # Set ROOT_LIBRARY_DIR
 
-  EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE}
+  exec_program( ${ROOT_CONFIG_EXECUTABLE}
     ARGS "--libdir"
     OUTPUT_VARIABLE ROOT_LIBRARY_DIR_TMP )
 
-  IF(EXISTS "${ROOT_LIBRARY_DIR_TMP}")
-    SET(ROOT_LIBRARY_DIR ${ROOT_LIBRARY_DIR_TMP} )
-  ELSE(EXISTS "${ROOT_LIBRARY_DIR_TMP}")
-    MESSAGE("Warning: ROOT_CONFIG_EXECUTABLE reported ${ROOT_LIBRARY_DIR_TMP} as library path,")
-    MESSAGE("Warning: but ${ROOT_LIBRARY_DIR_TMP} does NOT exist, ROOT must NOT be installed correctly.")
-  ENDIF(EXISTS "${ROOT_LIBRARY_DIR_TMP}")
-    
+  if(EXISTS "${ROOT_LIBRARY_DIR_TMP}")
+    set(ROOT_LIBRARY_DIR ${ROOT_LIBRARY_DIR_TMP} )
+  else(EXISTS "${ROOT_LIBRARY_DIR_TMP}")
+    message("Warning: ROOT_CONFIG_EXECUTABLE reported ${ROOT_LIBRARY_DIR_TMP} as library path,")
+    message("Warning: but ${ROOT_LIBRARY_DIR_TMP} does NOT exist, ROOT must NOT be installed correctly.")
+  endif(EXISTS "${ROOT_LIBRARY_DIR_TMP}")
+
   # ask root-config for the binary dir
-  EXEC_PROGRAM(${ROOT_CONFIG_EXECUTABLE}
+  exec_program(${ROOT_CONFIG_EXECUTABLE}
     ARGS "--bindir"
     OUTPUT_VARIABLE root_bins )
-  SET(ROOT_BINARY_DIR ${root_bins})
+  set(ROOT_BINARY_DIR ${root_bins})
 
   # ask root-config for the include dir
-  EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE}
-    ARGS "--incdir" 
+  exec_program( ${ROOT_CONFIG_EXECUTABLE}
+    ARGS "--incdir"
     OUTPUT_VARIABLE root_headers )
-  SET(ROOT_INCLUDE_DIR ${root_headers})
+  set(ROOT_INCLUDE_DIR ${root_headers})
       # CACHE INTERNAL "")
 
   # ask root-config for the library varaibles
-  EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE}
-#    ARGS "--noldflags --noauxlibs --libs" 
-    ARGS "--glibs" 
+  exec_program( ${ROOT_CONFIG_EXECUTABLE}
+#    ARGS "--noldflags --noauxlibs --libs"
+    ARGS "--glibs"
     OUTPUT_VARIABLE root_flags )
 
-#  STRING(REGEX MATCHALL "([^ ])+"  root_libs_all ${root_flags})
-#  STRING(REGEX MATCHALL "-L([^ ])+"  root_library ${root_flags})
+#  string(REGEX MATCHALL "([^ ])+"  root_libs_all ${root_flags})
+#  string(REGEX MATCHALL "-L([^ ])+"  root_library ${root_flags})
 #  REMOVE_FROM_LIST(root_flags "${root_libs_all}" "${root_library}")
 
-  SET(ROOT_LIBRARIES ${root_flags})
+  set(ROOT_LIBRARIES ${root_flags})
 
   # Make variables changeble to the advanced user
-  MARK_AS_ADVANCED( ROOT_LIBRARY_DIR ROOT_INCLUDE_DIR ROOT_DEFINITIONS)
+  mark_as_advanced( ROOT_LIBRARY_DIR ROOT_INCLUDE_DIR ROOT_DEFINITIONS)
 
   # Set ROOT_INCLUDES
-  SET( ROOT_INCLUDES ${ROOT_INCLUDE_DIR})
+  set( ROOT_INCLUDES ${ROOT_INCLUDE_DIR})
 
-  SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${ROOT_LIBRARY_DIR})
+  set(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${ROOT_LIBRARY_DIR})
 
   #######################################
   #
-  #       Check the executables of ROOT 
-  #          ( rootcint ) 
+  #       Check the executables of ROOT
+  #          ( rootcint )
   #
   #######################################
 
-  FIND_PROGRAM(ROOT_CINT_EXECUTABLE
+  find_program(ROOT_CINT_EXECUTABLE
     NAMES rootcint
     PATHS ${ROOT_BINARY_DIR}
     NO_DEFAULT_PATH
     )
 
-ENDIF (ROOT_FOUND)
+endif(ROOT_FOUND)
 
 
-#MESSAGE("icici")
+#message("icici")
 
   ###########################################
   #
@@ -146,44 +146,44 @@ ENDIF (ROOT_FOUND)
   #
   ###########################################
 
-MACRO (ROOT_GENERATE_DICTIONARY_OLD )
-   set(INFILES "")    
+macro(ROOT_GENERATE_DICTIONARY_OLD )
+
+   set(INFILES "")
 
    foreach (_current_FILE ${ARGN})
 
-     IF (${_current_FILE} MATCHES "^.*\\.h$")
-       IF (${_current_FILE} MATCHES "^.*Link.*$")
+     if(${_current_FILE} MATCHES "^.*\\.h$")
+       if(${_current_FILE} MATCHES "^.*Link.*$")
          set(LINKDEF_FILE ${_current_FILE})
-       ELSE (${_current_FILE} MATCHES "^.*Link.*$")
+       else(${_current_FILE} MATCHES "^.*Link.*$")
          set(INFILES ${INFILES} ${_current_FILE})
-       ENDIF (${_current_FILE} MATCHES "^.*Link.*$")
-     ELSE (${_current_FILE} MATCHES "^.*\\.h$")
-       IF (${_current_FILE} MATCHES "^.*\\.cxx$")
+       endif(${_current_FILE} MATCHES "^.*Link.*$")
+     else(${_current_FILE} MATCHES "^.*\\.h$")
+       if(${_current_FILE} MATCHES "^.*\\.cxx$")
          set(OUTFILE ${_current_FILE})
-       ELSE (${_current_FILE} MATCHES "^.*\\.cxx$")
-         set(INCLUDE_DIRS ${INCLUDE_DIRS} -I${_current_FILE})   
-       ENDIF (${_current_FILE} MATCHES "^.*\\.cxx$")
-     ENDIF (${_current_FILE} MATCHES "^.*\\.h$")
-     
+       else(${_current_FILE} MATCHES "^.*\\.cxx$")
+         set(INCLUDE_DIRS ${INCLUDE_DIRS} -I${_current_FILE})
+       endif(${_current_FILE} MATCHES "^.*\\.cxx$")
+     endif(${_current_FILE} MATCHES "^.*\\.h$")
+
    endforeach (_current_FILE ${ARGN})
-   
-#  MESSAGE("INFILES: ${INFILES}")
-#  MESSAGE("OutFILE: ${OUTFILE}")
-#  MESSAGE("LINKDEF_FILE: ${LINKDEF_FILE}")
-#  MESSAGE("INCLUDE_DIRS: ${INCLUDE_DIRS}")
 
-   STRING(REGEX REPLACE "(^.*).cxx" "\\1.h" bla "${OUTFILE}")
-#   MESSAGE("BLA: ${bla}")
-   SET (OUTFILES ${OUTFILE} ${bla})
+#  message("INFILES: ${INFILES}")
+#  message("OutFILE: ${OUTFILE}")
+#  message("LINKDEF_FILE: ${LINKDEF_FILE}")
+#  message("INCLUDE_DIRS: ${INCLUDE_DIRS}")
 
-   ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES}
+   string(REGEX REPLACE "(^.*).cxx" "\\1.h" bla "${OUTFILE}")
+#   message("BLA: ${bla}")
+   set(OUTFILES ${OUTFILE} ${bla})
+
+   add_custom_command(OUTPUT ${OUTFILES}
       COMMAND ${ROOT_CINT_EXECUTABLE}
       ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES})
 
-#   MESSAGE("ROOT_CINT_EXECUTABLE has created the dictionary ${OUTFILE}")
+#   message("ROOT_CINT_EXECUTABLE has created the dictionary ${OUTFILE}")
 
-ENDMACRO (ROOT_GENERATE_DICTIONARY_OLD)
+endmacro(ROOT_GENERATE_DICTIONARY_OLD)
 
   ###########################################
   #
@@ -191,28 +191,28 @@ ENDMACRO (ROOT_GENERATE_DICTIONARY_OLD)
   #
   ###########################################
 
-MACRO (ROOT_GENERATE_DICTIONARY INFILES LINKDEF_FILE OUTFILE INCLUDE_DIRS_IN)
+macro(ROOT_GENERATE_DICTIONARY INFILES LINKDEF_FILE OUTFILE INCLUDE_DIRS_IN)
+
   set(INCLUDE_DIRS)
 
   foreach (_current_FILE ${INCLUDE_DIRS_IN})
-    set(INCLUDE_DIRS ${INCLUDE_DIRS} -I${_current_FILE})   
+    set(INCLUDE_DIRS ${INCLUDE_DIRS} -I${_current_FILE})
   endforeach (_current_FILE ${INCLUDE_DIRS_IN})
 
-#  MESSAGE("INFILES: ${INFILES}")
-#  MESSAGE("OutFILE: ${OUTFILE}")
-#  MESSAGE("LINKDEF_FILE: ${LINKDEF_FILE}")
-#  MESSAGE("INCLUDE_DIRS: ${INCLUDE_DIRS}")
 
-  STRING(REGEX REPLACE "^(.*)\\.(.*)$" "\\1.h" bla "${OUTFILE}")
-#  MESSAGE("BLA: ${bla}")
-  SET (OUTFILES ${OUTFILE} ${bla})
+#  message("INFILES: ${INFILES}")
+#  message("OutFILE: ${OUTFILE}")
+#  message("LINKDEF_FILE: ${LINKDEF_FILE}")
+#  message("INCLUDE_DIRS: ${INCLUDE_DIRS}")
+
+  string(REGEX REPLACE "^(.*)\\.(.*)$" "\\1.h" bla "${OUTFILE}")
+#  message("BLA: ${bla}")
+  set(OUTFILES ${OUTFILE} ${bla})
 
-  ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES}
+  add_custom_command(OUTPUT ${OUTFILES}
      COMMAND ${ROOT_CINT_EXECUTABLE}
      ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES})
 
-ENDMACRO (ROOT_GENERATE_DICTIONARY)
+endmacro(ROOT_GENERATE_DICTIONARY)
 
-#MESSAGE("la")
+#message("la")
index e836147db8578a98ead1f99bc175005b4561068c..4a2ca009a14689b04d37c7512d3c7e9b9ba13bbb 100644 (file)
@@ -1,37 +1,37 @@
 #=========================================================
 #Support for the CTest dashboard testing system
-OPTION(BUILD_TESTING "Build the testing tree" OFF)
-IF (BUILD_TESTING)
-  OPTION(CLITK_BUILD_TESTING "Test ITK" ON)
-  INCLUDE(CTest)
-ENDIF(BUILD_TESTING)
+option(BUILD_TESTING "Build the testing tree" OFF)
+if(BUILD_TESTING)
+  option(CLITK_BUILD_TESTING "Test ITK" ON)
+  include(CTest)
+endif(BUILD_TESTING)
 #=========================================================
 
 
 #=========================================================
 # 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(${CLITK_SOURCE_DIR}/Doxygen ${PROJECT_BINARY_DIR}/Doxygen)
-ENDIF(BUILD_DOXYGEN)
+option(BUILD_DOXYGEN "Build Doxygen Documentation" OFF)
+if(BUILD_DOXYGEN)
+  find_package(Doxygen)
+  add_subdirectory(${CLITK_SOURCE_DIR}/Doxygen ${PROJECT_BINARY_DIR}/Doxygen)
+endif(BUILD_DOXYGEN)
 #=========================================================
 
 # 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_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(${CLITK_SOURCE_DIR}/vv ${PROJECT_BINARY_DIR}/vv)
-ENDIF(CLITK_BUILD_VV)
+option(CLITK_BUILD_VV "Build vv the 4D visualizer (requires VTK and QT)" ON)
+if(CLITK_BUILD_VV)
+  add_subdirectory(${CLITK_SOURCE_DIR}/vv ${PROJECT_BINARY_DIR}/vv)
+endif(CLITK_BUILD_VV)
 
 #=========================================================
 # Build test when vv has been compiled
-IF(BUILD_TESTING)
-  ADD_SUBDIRECTORY(${CLITK_SOURCE_DIR}/tests ${PROJECT_BINARY_DIR}/tests)
-ENDIF(BUILD_TESTING)
+if(BUILD_TESTING)
+  add_subdirectory(${CLITK_SOURCE_DIR}/tests ${PROJECT_BINARY_DIR}/tests)
+endif(BUILD_TESTING)
 
 
index 771467b0780a567cae2dd975cf28339560c06685..226064867e3e23cc3563abcc4b5b87c394af33fb 100644 (file)
@@ -1,7 +1,7 @@
 #=========================================================
-MACRO (DD in)
-    MESSAGE(${in}=${${in}})
-ENDMACRO(DD)
+macro(DD in)
+    message(${in}=${${in}})
+endmacro(DD)
 #=========================================================
 
 #=========================================================
@@ -11,32 +11,32 @@ if (NOT CMAKE_BUILD_TYPE)
 endif (NOT CMAKE_BUILD_TYPE)
 
 #=========================================================
-INCLUDE_DIRECTORIES(${CLITK_SOURCE_DIR}/itk
+include_directories(${CLITK_SOURCE_DIR}/itk
   ${CLITK_SOURCE_DIR}/filters
   ${CLITK_SOURCE_DIR}/segmentation
   ${CLITK_SOURCE_DIR}/registration
   ${CLITK_SOURCE_DIR}/tools
   ${CLITK_SOURCE_DIR}/common
   ${PROJECT_BINARY_DIR})
-SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
-SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
-LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lib)
-INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/tools)         #For _ggo.h includes from other directories
-INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/segmentation)  #For _ggo.h includes from other directories
-INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/registration)  #For _ggo.h includes from other directories
+set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
+link_directories(${PROJECT_BINARY_DIR}/lib)
+include_directories(${PROJECT_BINARY_DIR}/tools)         #For _ggo.h includes from other directories
+include_directories(${PROJECT_BINARY_DIR}/segmentation)  #For _ggo.h includes from other directories
+include_directories(${PROJECT_BINARY_DIR}/registration)  #For _ggo.h includes from other directories
 #=========================================================
 
 #=========================================================
 # 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
+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 <CLITK_DIR>'.")
-ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
+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)
+if(MSVC)
+  add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
+endif(MSVC)
 #=========================================================
index 7091fffe04d8ade7c75ef4d846bcc3388a8fdae1..62a6a1503f4d0704db0810de062d85d12cd333b2 100644 (file)
@@ -1,20 +1,20 @@
 #=========================================================
 # 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_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}")
-  IF(VTK_VERSION VERSION_LESS 5.8.0)
-    SET ( VTK_LIBRARIES
+find_package(VTK REQUIRED)
+if(VTK_FOUND)
+  include("${VTK_USE_FILE}")
+  if(VTK_VERSION VERSION_LESS 5.8.0)
+    set( VTK_LIBRARIES
       vtkCommon
       vtkRendering
       vtkIO
@@ -24,50 +24,50 @@ IF(VTK_FOUND)
       vtkImaging
       vtkHybrid
       )
-  ENDIF(VTK_VERSION VERSION_LESS 5.8.0)
-  IF(VTK_VERSION VERSION_LESS 5.6.0)
-    SET ( VTK_LIBRARIES
+  endif(VTK_VERSION VERSION_LESS 5.8.0)
+  if(VTK_VERSION VERSION_LESS 5.6.0)
+    set( VTK_LIBRARIES
       ${VTK_LIBRARIES}
       vtkQVTK
     )
-  ENDIF(VTK_VERSION VERSION_LESS 5.6.0)
-ELSE(VTK_FOUND)
-  MESSAGE(FATAL_ERROR "Please set VTK_DIR.")
-ENDIF(VTK_FOUND)
+  endif(VTK_VERSION VERSION_LESS 5.6.0)
+else(VTK_FOUND)
+  message(FATAL_ERROR "Please set VTK_DIR.")
+endif(VTK_FOUND)
 #=========================================================
 
 #=========================================================
 # Find gengetopt, will create a target exe if not found
-SET(CMAKE_MODULE_PATH "${CLITK_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
-FIND_PACKAGE(Gengetopt)
+set(CMAKE_MODULE_PATH "${CLITK_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
+find_package(Gengetopt)
 #=========================================================
 
 #=========================================================
 # Find libstatgrab is installed, add clitkMemoryUsage.cxx in the library
-IF (NOT DEFINED CLITK_MEMORY_INFO OR CLITK_MEMORY_INFO)
-  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")  
-ENDIF()
+if(NOT DEFINED CLITK_MEMORY_INFO OR CLITK_MEMORY_INFO)
+  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")
+endif()
 #=========================================================
 
 
 #=========================================================
 ### Check if ITK was compiled with SYSTEM_GDCM = ON
-SET(CLITK_USE_SYSTEM_GDCM FALSE)
-IF(ITK_VERSION_MAJOR LESS "4")
-  IF(ITK_USE_SYSTEM_GDCM)
-    SET(CLITK_USE_SYSTEM_GDCM TRUE) 
-  ENDIF(ITK_USE_SYSTEM_GDCM)
-ELSE()
+set(CLITK_USE_SYSTEM_GDCM FALSE)
+if(ITK_VERSION_MAJOR LESS "4")
+  if(ITK_USE_SYSTEM_GDCM)
+    set(CLITK_USE_SYSTEM_GDCM TRUE)
+  endif(ITK_USE_SYSTEM_GDCM)
+else()
   # ITK4 creates a target for each gdcm library when it compiles GDCM
   get_target_property(GDCMDICTTARG gdcmDICT TYPE )
-  IF(NOT GDCMDICTTARG)
-    SET(CLITK_USE_SYSTEM_GDCM TRUE)
-  ENDIF()
-ENDIF()
+  if(NOT GDCMDICTTARG)
+    set(CLITK_USE_SYSTEM_GDCM TRUE)
+  endif()
+endif()
 
index bef0f36c799d76257671f6044a701d67479787b5..5a700ac45c6fd864a319b36491eaf8948b4dd2c8 100644 (file)
@@ -1,9 +1,9 @@
 #=========================================================
 # make clitk libraries*
-CONFIGURE_FILE(clitkConfiguration.h.in ${PROJECT_BINARY_DIR}/clitkConfiguration.h)
+configure_file(clitkConfiguration.h.in ${PROJECT_BINARY_DIR}/clitkConfiguration.h)
 
-SET(clitkCommon_SRC
-  clitkCommon.cxx 
+set(clitkCommon_SRC
+  clitkCommon.cxx
   clitkListOfPair.cxx
   clitkTimer.cxx
   clitkImageCommon.cxx
@@ -11,14 +11,14 @@ SET(clitkCommon_SRC
   clitkIO.cxx
   clitkGateAsciiImageIO.cxx
   clitkGateAsciiImageIOFactory.cxx
-  clitkVoxImageIO.cxx  
+  clitkVoxImageIO.cxx
   clitkVoxImageIOFactory.cxx
-  clitkVfImageIO.cxx  
+  clitkVfImageIO.cxx
   clitkVfImageIOFactory.cxx
-  clitkXdrImageIOReader.cxx  
-  clitkXdrImageIOWriter.cxx  
+  clitkXdrImageIOReader.cxx
+  clitkXdrImageIOWriter.cxx
   clitkXdrImageIOFactory.cxx
-  rtkHisImageIO.cxx  
+  rtkHisImageIO.cxx
   rtkHisImageIOFactory.cxx
   rtkHndImageIO.cxx
   rtkHndImageIOFactory.cxx
@@ -29,7 +29,7 @@ SET(clitkCommon_SRC
   rtkImagXImageIO.cxx
   rtkImagXImageIOFactory.cxx
   rtkImagXXMLFileReader.cxx
-  clitkEsrfHstImageIO.cxx  
+  clitkEsrfHstImageIO.cxx
   clitkEsrfHstImageIOFactory.cxx
   clitkEsrfHstXMLFileReader.cxx
   clitkDicomRTDoseIO.cxx
@@ -44,8 +44,8 @@ SET(clitkCommon_SRC
   vvImageReader.cxx
   vvImageWriter.cxx
 )
-IF(CLITK_PRIVATE_FEATURES)
-  SET(clitkCommon_SRC ${clitkCommon_SRC}
+if(CLITK_PRIVATE_FEATURES)
+  set(clitkCommon_SRC ${clitkCommon_SRC}
     ${PROJECT_SOURCE_DIR}/private_features/clitkUsfImageIO.cxx
     ${PROJECT_SOURCE_DIR}/private_features/clitkUsfImageIOFactory.cxx
     ${PROJECT_SOURCE_DIR}/private_features/clitkUSVoxImageIO.cxx
@@ -53,35 +53,35 @@ IF(CLITK_PRIVATE_FEATURES)
     ${PROJECT_SOURCE_DIR}/private_features/clitkSvlImageIO.cxx
     ${PROJECT_SOURCE_DIR}/private_features/clitkSvlImageIOFactory.cxx
     )
-ENDIF(CLITK_PRIVATE_FEATURES)
+endif(CLITK_PRIVATE_FEATURES)
 
 ### Declare clitkCommon library
-ADD_LIBRARY(clitkCommon STATIC ${clitkCommon_SRC})
+add_library(clitkCommon STATIC ${clitkCommon_SRC})
 
-IF(CLITK_MEMORY_INFO)
-  TARGET_LINK_LIBRARIES(clitkCommon statgrab)
-ENDIF(CLITK_MEMORY_INFO)
+if(CLITK_MEMORY_INFO)
+  target_link_libraries(clitkCommon statgrab)
+endif(CLITK_MEMORY_INFO)
 
 
 #=========================================================
-IF (CLITK_USE_SYSTEM_GDCM)
-  FIND_PACKAGE(GDCM REQUIRED)
+if(CLITK_USE_SYSTEM_GDCM)
+  find_package(GDCM REQUIRED)
   include(${GDCM_USE_FILE})
-  TARGET_LINK_LIBRARIES(clitkCommon vtkgdcm gdcmDICT gdcmMSFF)
-ENDIF()
+  target_link_libraries(clitkCommon vtkgdcm gdcmDICT gdcmMSFF)
+endif()
 #=========================================================
 
-TARGET_LINK_LIBRARIES(clitkCommon ${VTK_LIBRARIES} ${ITK_LIBRARIES})
+target_link_libraries(clitkCommon ${VTK_LIBRARIES} ${ITK_LIBRARIES})
 
-ADD_LIBRARY(clitkDicomRTStruct STATIC
+add_library(clitkDicomRTStruct STATIC
   clitkDicomRT_Contour.cxx
   clitkDicomRT_ROI.cxx
   clitkDicomRT_StructureSet.cxx
   clitkDicomRTStruct2ImageFilter.cxx
   )
 
-TARGET_LINK_LIBRARIES(clitkDicomRTStruct clitkCommon)
+target_link_libraries(clitkDicomRTStruct clitkCommon)
 
-#ADD_LIBRARY(clitkCommonShared SHARED ${clitkCommon_SRC})
-#SET_TARGET_PROPERTIES(clitkCommonShared PROPERTIES COMPILE_FLAGS -fPIC)
+#add_library(clitkCommonShared SHARED ${clitkCommon_SRC})
+#set_target_properties(clitkCommonShared PROPERTIES COMPILE_FLAGS -fPIC)
 
index 9c8d36254665a1e0f1cc28e6d15ae2f01ec50a04..1c7d3c003ca417a670be4f5703017aa48845f979 100644 (file)
@@ -2,7 +2,7 @@
 
 # Add Libraries used in vv and clitk to avoid recompilation
 WRAP_GGO(clitkAffineRegistration_GGO_C clitkAffineRegistration.ggo)
-ADD_LIBRARY(clitkAffineRegistrationLib 
+add_library(clitkAffineRegistrationLib
             clitkAffineRegistrationGenericFilter.cxx
             ${clitkAffineRegistration_GGO_C}
             clitkLBFGSBOptimizer.cxx
@@ -10,40 +10,40 @@ ADD_LIBRARY(clitkAffineRegistrationLib
 
 #=========================================================
 
-IF(CLITK_BUILD_REGISTRATION)
+if(CLITK_BUILD_REGISTRATION)
     ############################## registration algorithms
-    ADD_EXECUTABLE(clitkAffineRegistration clitkAffineRegistration.cxx)
-    TARGET_LINK_LIBRARIES(clitkAffineRegistration  clitkAffineRegistrationLib clitkCommon)
-    SET(REGISTRATION_INSTALL clitkAffineRegistration)
+    add_executable(clitkAffineRegistration clitkAffineRegistration.cxx)
+    target_link_libraries(clitkAffineRegistration  clitkAffineRegistrationLib clitkCommon)
+    set(REGISTRATION_INSTALL clitkAffineRegistration)
 
     WRAP_GGO(clitkDemonsDeformableRegistration_GGO_C clitkDemonsDeformableRegistration.ggo)
-    ADD_EXECUTABLE(clitkDemonsDeformableRegistration clitkDemonsDeformableRegistration.cxx ${clitkDemonsDeformableRegistration_GGO_C} clitkDemonsDeformableRegistrationGenericFilter.cxx)
-    TARGET_LINK_LIBRARIES(clitkDemonsDeformableRegistration clitkCommon)
-    SET(REGISTRATION_INSTALL ${REGISTRATION_INSTALL} clitkDemonsDeformableRegistration)
+    add_executable(clitkDemonsDeformableRegistration clitkDemonsDeformableRegistration.cxx ${clitkDemonsDeformableRegistration_GGO_C} clitkDemonsDeformableRegistrationGenericFilter.cxx)
+    target_link_libraries(clitkDemonsDeformableRegistration clitkCommon)
+    set(REGISTRATION_INSTALL ${REGISTRATION_INSTALL} clitkDemonsDeformableRegistration)
 
     WRAP_GGO(clitkBLUTDIR_GGO_C clitkBLUTDIR.ggo)
-    ADD_EXECUTABLE(clitkBLUTDIR  clitkBLUTDIR.cxx clitkBLUTDIRGenericFilter.cxx ${clitkBLUTDIR_GGO_C} clitkLBFGSBOptimizer.cxx )
-    TARGET_LINK_LIBRARIES(clitkBLUTDIR clitkCommon)
-    SET(REGISTRATION_INSTALL ${REGISTRATION_INSTALL} clitkBLUTDIR)
+    add_executable(clitkBLUTDIR  clitkBLUTDIR.cxx clitkBLUTDIRGenericFilter.cxx ${clitkBLUTDIR_GGO_C} clitkLBFGSBOptimizer.cxx )
+    target_link_libraries(clitkBLUTDIR clitkCommon)
+    set(REGISTRATION_INSTALL ${REGISTRATION_INSTALL} clitkBLUTDIR)
 
 
     ############################## registration-related tools to process points, bsplines, vf and image pyramids
     WRAP_GGO(clitkCalculateTRE_GGO_C clitkCalculateTRE.ggo)
-    ADD_EXECUTABLE(clitkCalculateTRE clitkCalculateTRE.cxx clitkCalculateTREGenericFilter.cxx ${clitkCalculateTRE_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkCalculateTRE clitkCommon)
-    SET(REGISTRATION_INSTALL ${REGISTRATION_INSTALL} clitkCalculateTRE)
+    add_executable(clitkCalculateTRE clitkCalculateTRE.cxx clitkCalculateTREGenericFilter.cxx ${clitkCalculateTRE_GGO_C})
+    target_link_libraries(clitkCalculateTRE clitkCommon)
+    set(REGISTRATION_INSTALL ${REGISTRATION_INSTALL} clitkCalculateTRE)
 
     WRAP_GGO(clitkMatrixTransformToVF_GGO_C clitkMatrixTransformToVF.ggo)
-    ADD_EXECUTABLE(clitkMatrixTransformToVF clitkMatrixTransformToVF.cxx clitkMatrixTransformToVFGenericFilter.cxx  ${clitkMatrixTransformToVF_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkMatrixTransformToVF clitkCommon)
-    SET(REGISTRATION_INSTALL ${REGISTRATION_INSTALL} clitkMatrixTransformToVF)
+    add_executable(clitkMatrixTransformToVF clitkMatrixTransformToVF.cxx clitkMatrixTransformToVFGenericFilter.cxx  ${clitkMatrixTransformToVF_GGO_C})
+    target_link_libraries(clitkMatrixTransformToVF clitkCommon)
+    set(REGISTRATION_INSTALL ${REGISTRATION_INSTALL} clitkMatrixTransformToVF)
 
     WRAP_GGO(clitkConvertBSplineDeformableTransformToVF_GGO_C clitkConvertBSplineDeformableTransformToVF.ggo)
-    ADD_EXECUTABLE(clitkConvertBSplineDeformableTransformToVF  clitkConvertBSplineDeformableTransformToVF.cxx clitkConvertBSplineDeformableTransformToVFGenericFilter.cxx  ${clitkConvertBSplineDeformableTransformToVF_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkConvertBSplineDeformableTransformToVF clitkCommon)
-    SET(REGISTRATION_INSTALL ${REGISTRATION_INSTALL} clitkConvertBSplineDeformableTransformToVF)
+    add_executable(clitkConvertBSplineDeformableTransformToVF  clitkConvertBSplineDeformableTransformToVF.cxx clitkConvertBSplineDeformableTransformToVFGenericFilter.cxx  ${clitkConvertBSplineDeformableTransformToVF_GGO_C})
+    target_link_libraries(clitkConvertBSplineDeformableTransformToVF clitkCommon)
+    set(REGISTRATION_INSTALL ${REGISTRATION_INSTALL} clitkConvertBSplineDeformableTransformToVF)
 
-    INSTALL (TARGETS ${REGISTRATION_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
+    install(TARGETS ${REGISTRATION_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
 
-ENDIF(CLITK_BUILD_REGISTRATION)
+endif(CLITK_BUILD_REGISTRATION)
 
index 5c16569f56b700e7104e1c3cec74786eb73c4d77..ecc136b62f217fae0f4bbf22d3698b65c46ceb66 100644 (file)
@@ -1,11 +1,11 @@
 #=========================================================
 
 # Add Libraries used in vv and clitk to avoid recompilation
-FOREACH(clitkTool clitkExtractLung clitkExtractPatient clitkConnectedComponentLabeling clitkRegionGrowing)
+foreach(clitkTool clitkExtractLung clitkExtractPatient clitkConnectedComponentLabeling clitkRegionGrowing)
     WRAP_GGO(${clitkTool}_GGO_C ${clitkTool}.ggo)
-    SET(GGO_C_FILES ${GGO_C_FILES} ${${clitkTool}_GGO_C})
-ENDFOREACH(clitkTool)
-ADD_LIBRARY(clitkSegmentationGgoLib
+    set(GGO_C_FILES ${GGO_C_FILES} ${${clitkTool}_GGO_C})
+endforeach(clitkTool)
+add_library(clitkSegmentationGgoLib
             clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx
             clitkAnatomicalFeatureDatabase.cxx
             clitkSliceBySliceRelativePositionFilter_uchar.cxx
@@ -13,51 +13,51 @@ ADD_LIBRARY(clitkSegmentationGgoLib
 
 #=========================================================
 
-IF(CLITK_BUILD_SEGMENTATION)
+if(CLITK_BUILD_SEGMENTATION)
     WRAP_GGO(clitkConnectedComponentLabeling_GGO_C clitkConnectedComponentLabeling.ggo)
-    ADD_EXECUTABLE(clitkConnectedComponentLabeling clitkConnectedComponentLabeling.cxx ${clitkConnectedComponentLabeling_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkConnectedComponentLabeling clitkCommon)
-    SET(SEGMENTATION_INSTALL clitkConnectedComponentLabeling)
+    add_executable(clitkConnectedComponentLabeling clitkConnectedComponentLabeling.cxx ${clitkConnectedComponentLabeling_GGO_C})
+    target_link_libraries(clitkConnectedComponentLabeling clitkCommon)
+    set(SEGMENTATION_INSTALL clitkConnectedComponentLabeling)
 
-    ADD_EXECUTABLE(clitkExtractPatient clitkExtractPatient.cxx ${clitkExtractPatient_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkExtractPatient clitkCommon clitkSegmentationGgoLib)
-    SET(SEGMENTATION_INSTALL ${SEGMENTATION_INSTALL} clitkExtractPatient)
+    add_executable(clitkExtractPatient clitkExtractPatient.cxx ${clitkExtractPatient_GGO_C})
+    target_link_libraries(clitkExtractPatient clitkCommon clitkSegmentationGgoLib)
+    set(SEGMENTATION_INSTALL ${SEGMENTATION_INSTALL} clitkExtractPatient)
 
-    ADD_EXECUTABLE(clitkExtractLung clitkExtractLung.cxx  ${clitkExtractLung_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkExtractLung clitkSegmentationGgoLib clitkCommon)
-    SET(SEGMENTATION_INSTALL ${SEGMENTATION_INSTALL} clitkExtractLung)
+    add_executable(clitkExtractLung clitkExtractLung.cxx  ${clitkExtractLung_GGO_C})
+    target_link_libraries(clitkExtractLung clitkSegmentationGgoLib clitkCommon)
+    set(SEGMENTATION_INSTALL ${SEGMENTATION_INSTALL} clitkExtractLung)
 
     WRAP_GGO(clitkExtractBones_GGO_C clitkExtractBones.ggo)
-    ADD_EXECUTABLE(clitkExtractBones clitkExtractBones.cxx ${clitkExtractBones_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkExtractBones clitkCommon clitkSegmentationGgoLib)
-    SET(SEGMENTATION_INSTALL ${SEGMENTATION_INSTALL} clitkExtractBones)
+    add_executable(clitkExtractBones clitkExtractBones.cxx ${clitkExtractBones_GGO_C})
+    target_link_libraries(clitkExtractBones clitkCommon clitkSegmentationGgoLib)
+    set(SEGMENTATION_INSTALL ${SEGMENTATION_INSTALL} clitkExtractBones)
 
     WRAP_GGO(clitkMorphoMath_GGO_C clitkMorphoMath.ggo)
-    ADD_EXECUTABLE(clitkMorphoMath clitkMorphoMath.cxx ${clitkMorphoMath_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkMorphoMath clitkCommon)
-    SET(SEGMENTATION_INSTALL ${SEGMENTATION_INSTALL} clitkMorphoMath)
+    add_executable(clitkMorphoMath clitkMorphoMath.cxx ${clitkMorphoMath_GGO_C})
+    target_link_libraries(clitkMorphoMath clitkCommon)
+    set(SEGMENTATION_INSTALL ${SEGMENTATION_INSTALL} clitkMorphoMath)
 
     WRAP_GGO(clitkDecomposeAndReconstruct_GGO_C clitkDecomposeAndReconstruct.ggo)
-    ADD_EXECUTABLE(clitkDecomposeAndReconstruct clitkDecomposeAndReconstruct.cxx clitkDecomposeAndReconstructGenericFilter.cxx ${clitkDecomposeAndReconstruct_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkDecomposeAndReconstruct clitkCommon)
-    SET(SEGMENTATION_INSTALL ${SEGMENTATION_INSTALL} clitkDecomposeAndReconstruct)
+    add_executable(clitkDecomposeAndReconstruct clitkDecomposeAndReconstruct.cxx clitkDecomposeAndReconstructGenericFilter.cxx ${clitkDecomposeAndReconstruct_GGO_C})
+    target_link_libraries(clitkDecomposeAndReconstruct clitkCommon)
+    set(SEGMENTATION_INSTALL ${SEGMENTATION_INSTALL} clitkDecomposeAndReconstruct)
 
     WRAP_GGO(clitkMotionMask_GGO_C clitkMotionMask.ggo)
-    ADD_EXECUTABLE(clitkMotionMask clitkMotionMask.cxx clitkMotionMaskGenericFilter.cxx ${clitkMotionMask_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkMotionMask clitkCommon)
-    SET(SEGMENTATION_INSTALL ${SEGMENTATION_INSTALL} clitkMotionMask)
-    
+    add_executable(clitkMotionMask clitkMotionMask.cxx clitkMotionMaskGenericFilter.cxx ${clitkMotionMask_GGO_C})
+    target_link_libraries(clitkMotionMask clitkCommon)
+    set(SEGMENTATION_INSTALL ${SEGMENTATION_INSTALL} clitkMotionMask)
+
     WRAP_GGO(clitkRegionGrowing_GGO_C clitkRegionGrowing.ggo)
-    ADD_EXECUTABLE(clitkRegionGrowing clitkRegionGrowing.cxx ${clitkRegionGrowing_GGO_C} ${clitkRelativePosition_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkRegionGrowing clitkCommon)
+    add_executable(clitkRegionGrowing clitkRegionGrowing.cxx ${clitkRegionGrowing_GGO_C} ${clitkRelativePosition_GGO_C})
+    target_link_libraries(clitkRegionGrowing clitkCommon)
 
-    INSTALL (TARGETS ${SEGMENTATION_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
+    install(TARGETS ${SEGMENTATION_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
 
-ENDIF(CLITK_BUILD_SEGMENTATION)
+endif(CLITK_BUILD_SEGMENTATION)
 
-# ADD_EXECUTABLE(ScalarImageMarkovRandomField1 ScalarImageMarkovRandomField1.cxx)
-# TARGET_LINK_LIBRARIES(ScalarImageMarkovRandomField1 clitkCommon ITKStatistics)
-# ADD_EXECUTABLE(ScalarImageKmeansClassifier ScalarImageKmeansClassifier.cxx)
-# TARGET_LINK_LIBRARIES(ScalarImageKmeansClassifier clitkCommon ITKStatistics)
+# add_executable(ScalarImageMarkovRandomField1 ScalarImageMarkovRandomField1.cxx)
+# target_link_libraries(ScalarImageMarkovRandomField1 clitkCommon ITKStatistics)
+# add_executable(ScalarImageKmeansClassifier ScalarImageKmeansClassifier.cxx)
+# target_link_libraries(ScalarImageKmeansClassifier clitkCommon ITKStatistics)
 
 
index 1a44162a36ed6435dc0c5df239dc7a05ced39712..988c1c1f972e57bdea40385df7ca628240010d7b 100644 (file)
@@ -9,9 +9,9 @@ set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Build configuration type"
 set(build_type ${CMAKE_BUILD_TYPE})
 
 #=========================================================
-MACRO (DD in)
-    MESSAGE(${in}=${${in}})
-ENDMACRO(DD)
+macro(DD in)
+    message(${in}=${${in}})
+endmacro(DD)
 #=========================================================
 
 project(SuperBuild_VV)
@@ -42,7 +42,7 @@ if( 1 EQUAL 1)
 #=========================================================
 # QT
 if(WIN32)
-SET(QtWinSpecFiles "${source_prefix}/qt/mkspecs/win32-msvc2003/qmake.conf;${source_prefix}/qt/mkspecs/win32-msvc2005/qmake.conf;${source_prefix}/qt/mkspecs/win32-msvc2008/qmake.conf;${source_prefix}/qt/mkspecs/win32-msvc2010/qmake.conf")
+set(QtWinSpecFiles "${source_prefix}/qt/mkspecs/win32-msvc2003/qmake.conf;${source_prefix}/qt/mkspecs/win32-msvc2005/qmake.conf;${source_prefix}/qt/mkspecs/win32-msvc2008/qmake.conf;${source_prefix}/qt/mkspecs/win32-msvc2010/qmake.conf")
 set(WINPATCH "sed -i \"s/\\-MD/-MT/g\" ${QtWinSpecFiles}")
 else()
 set(WINPATCH "")
@@ -54,7 +54,7 @@ ExternalProject_Add(
   GIT_TAG v4.8.6
   PATCH_COMMAND ${WINPATCH}
   CONFIGURE_COMMAND ${source_prefix}/qt/configure -confirm-license
-                                                  -static 
+                                                  -static
                                                   -fast
                                                   -opensource
                                                   -release
@@ -68,7 +68,7 @@ ExternalProject_Add(
                                                   -no-glib
   INSTALL_COMMAND ""
 )
-SET(qmake_executable "${build_prefix}/QT/bin/qmake")
+set(qmake_executable "${build_prefix}/QT/bin/qmake")
 set(VTK_DEPEND_QT QT)
 
 else()
@@ -79,12 +79,12 @@ endif()
 
 #=========================================================
 # VTK
-SET(VTK_CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES}")
-IF(MSVC)
-  SET(VTK_CMAKE_CXX_STANDARD_LIBRARIES "${VTK_CMAKE_CXX_STANDARD_LIBRARIES} Imm32.lib Winmm.lib Ws2_32.lib")
-ENDIF(MSVC)
+set(VTK_CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES}")
+if(MSVC)
+  set(VTK_CMAKE_CXX_STANDARD_LIBRARIES "${VTK_CMAKE_CXX_STANDARD_LIBRARIES} Imm32.lib Winmm.lib Ws2_32.lib")
+endif(MSVC)
 ExternalProject_Add(
-  VTK 
+  VTK
   DEPENDS ${VTK_DEPEND_QT}
   SOURCE_DIR ${source_prefix}/vtk
   GIT_REPOSITORY git://vtk.org/VTK.git
@@ -109,7 +109,7 @@ ExternalProject_Add(
     -DVTK_USE_QVTK_QTOPENGL:BOOL=ON
     -DCMAKE_CXX_STANDARD_LIBRARIES:STRING=${VTK_CMAKE_CXX_STANDARD_LIBRARIES}
 )
-SET(VTK_DIR ${build_prefix}/VTK)
+set(VTK_DIR ${build_prefix}/VTK)
 #=========================================================
 
 #=========================================================
@@ -117,7 +117,7 @@ SET(VTK_DIR ${build_prefix}/VTK)
    ExternalProject_Add(
    GDCM
    SOURCE_DIR ${source_prefix}/gdcm
-   GIT_REPOSITORY git://git.code.sf.net/p/gdcm/gdcm 
+   GIT_REPOSITORY git://git.code.sf.net/p/gdcm/gdcm
    GIT_TAG v2.2.4
    INSTALL_COMMAND ""
    CMAKE_ARGS
@@ -132,7 +132,7 @@ SET(VTK_DIR ${build_prefix}/VTK)
    -DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_PREFIX}
    -DCMAKE_BUILD_TYPE:STRING=${build_type}
 )
-SET(GDCM_DIR ${build_prefix}/GDCM)
+set(GDCM_DIR ${build_prefix}/GDCM)
 #=========================================================
 
 #=========================================================
@@ -158,24 +158,24 @@ ExternalProject_Add(
     -DBUILD_EXAMPLES:BOOL=OFF
     -DBUILD_TESTING:BOOL=OFF
 )
-SET(ITK_DIR ${build_prefix}/ITK)
+set(ITK_DIR ${build_prefix}/ITK)
 #=========================================================
 
 #=========================================================
 # VV
-SET(VV_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+set(VV_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
 if(MSVC)
-  SET(VV_CMAKE_CXX_FLAGS "${VV_CMAKE_CXX_FLAGS} /bigobj")
+  set(VV_CMAKE_CXX_FLAGS "${VV_CMAKE_CXX_FLAGS} /bigobj")
 endif(MSVC)
 
-SET(VV_CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
+set(VV_CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
 if(CMAKE_COMPILER_IS_GNUCXX)
-  SET(VV_CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
+  set(VV_CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
 endif(CMAKE_COMPILER_IS_GNUCXX)
 
-SET(MAKE_COMMAND "make")
+set(MAKE_COMMAND "make")
 if(MSVC)
-  SET(MAKE_COMMAND "nmake")
+  set(MAKE_COMMAND "nmake")
 endif(MSVC)
 
 ExternalProject_Add(
@@ -184,7 +184,7 @@ ExternalProject_Add(
   SOURCE_DIR ${source_prefix}/vv
   GIT_REPOSITORY git://git.creatis.insa-lyon.fr/clitk
   INSTALL_DIR ${install_prefix}
-  INSTALL_COMMAND  make install 
+  INSTALL_COMMAND  make install
   CMAKE_ARGS
     -DQT_QMAKE_EXECUTABLE:FILEPATH=${qmake_executable}
     -DGDCM_DIR:PATH=${GDCM_DIR}
index 30beaaaeb2d97781361eae18e0be9181ddfcd7c5..d91dee6a93c88a7222feae05e91795b86abf870f 100644 (file)
@@ -2,31 +2,31 @@ cmake_policy(SET CMP0005 NEW)
 #=========================================================
 #=========================================================
 # Data tests path
-FIND_PATH(CLITK_TEST_DATA_PATH Lung3D.mhd)
-IF(NOT ${CLITK_TEST_DATA_PATH} MATCHES "NOTFOUND$")
SET(CLITK_TEST_DATA_PATH "${CLITK_TEST_DATA_PATH}/")
-ENDIF()
-ADD_DEFINITIONS(-DCLITK_TEST_DATA_PATH="${CLITK_TEST_DATA_PATH}")
+find_path(CLITK_TEST_DATA_PATH Lung3D.mhd)
+if(NOT ${CLITK_TEST_DATA_PATH} MATCHES "NOTFOUND$")
set(CLITK_TEST_DATA_PATH "${CLITK_TEST_DATA_PATH}/")
+endif()
+add_definitions(-DCLITK_TEST_DATA_PATH="${CLITK_TEST_DATA_PATH}")
 #=========================================================
 #=========================================================
-SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/tests/bin)
-SET(BUILDNAME ${CMAKE_SYSTEM_NAME}${CMAKE_OSX_ARCHITECTURES} CACHE INTERNAL DOCSTRING)
+set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/tests/bin)
+set(BUILDNAME ${CMAKE_SYSTEM_NAME}${CMAKE_OSX_ARCHITECTURES} CACHE INTERNAL DOCSTRING)
 #=========================================================
 #=========================================================
 # Enabled options to test
-IF(CLITK_BUILD_TOOLS)
-  ADD_SUBDIRECTORY(tools)
-ENDIF()
-#IF(CLITK_BUILD_VV)
-#  ADD_SUBDIRECTORY(vv)
-#ENDIF()
-# IF(CLITK_BUILD_SEGMENTATION)
-#   ADD_SUBDIRECTORY(segmentation)
-# ENDIF()
-# 
-# IF(CLITK_BUILD_REGISTATION)
-#   ADD_SUBDIRECTORY(registration)
-# ENDIF()
-#ADD_SUBDIRECTORY(common)
+if(CLITK_BUILD_TOOLS)
+  add_subdirectory(tools)
+endif()
+#if(CLITK_BUILD_VV)
+#  add_subdirectory(vv)
+#endif()
+# if(CLITK_BUILD_SEGMENTATION)
+#   add_subdirectory(segmentation)
+# endif()
+#
+# if(CLITK_BUILD_REGISTATION)
+#   add_subdirectory(registration)
+# endif()
+#add_subdirectory(common)
 #=========================================================
 
index 7282ac49f7b62862434b9f6a310fb57a3ebacf10..c480699cd49f57f71725d96c5201ce1eadf01623 100644 (file)
@@ -3,76 +3,76 @@ include_directories(
   ${PROJECT_SOURCE_DIR}/tools
 )
 
-SET(BUILDNAME ${BUILDNAME}_tools CACHE INTERNAL DOCSTRING)
-ADD_DEFINITIONS(-DCLITK_TEST_TOOLS_PATH=\"${PROJECT_BINARY_DIR}/bin/\")
-SET (srcs
+set(BUILDNAME ${BUILDNAME}_tools CACHE INTERNAL DOCSTRING)
+add_definitions(-DCLITK_TEST_TOOLS_PATH=\"${PROJECT_BINARY_DIR}/bin/\")
+set(srcs
   toolTestRunner.cxx
 )
 
-ADD_EXECUTABLE(toolTestRunner ${srcs})
-TARGET_LINK_LIBRARIES(toolTestRunner ${ITK_LIBRARIES})
-SET(exe ${EXECUTABLE_OUTPUT_PATH}/toolTestRunner) 
-SET(p ${CLITK_TEST_DATA_PATH})
+add_executable(toolTestRunner ${srcs})
+target_link_libraries(toolTestRunner ${ITK_LIBRARIES})
+set(exe ${EXECUTABLE_OUTPUT_PATH}/toolTestRunner)
+set(p ${CLITK_TEST_DATA_PATH})
 #=========================================================
 # clitkImageInfo
-ADD_TEST(clitkImageInfo_4d    ${exe} clitkImageInfo ${p}Deformation4D.mhd ${p}Deformation4D_ref.info)
-ADD_TEST(clitkImageInfo_3d    ${exe} clitkImageInfo ${p}Lung3D.mhd      ${p}Lung3D_ref.info)
+add_test(clitkImageInfo_4d    ${exe} clitkImageInfo ${p}Deformation4D.mhd ${p}Deformation4D_ref.info)
+add_test(clitkImageInfo_3d    ${exe} clitkImageInfo ${p}Lung3D.mhd      ${p}Lung3D_ref.info)
 #=========================================================
 # clitkGetSpacing
-ADD_TEST(clitkGetSpacing_4d   ${exe} clitkGetSpacing -i ${p}Deformation4D.mhd ${p}Deformation4D_ref.spacing)
-ADD_TEST(clitkGetSpacing_3d   ${exe} clitkGetSpacing -i ${p}Lung3D.mhd              ${p}Lung3D_ref.spacing)
+add_test(clitkGetSpacing_4d   ${exe} clitkGetSpacing -i ${p}Deformation4D.mhd ${p}Deformation4D_ref.spacing)
+add_test(clitkGetSpacing_3d   ${exe} clitkGetSpacing -i ${p}Lung3D.mhd              ${p}Lung3D_ref.spacing)
 #=========================================================
 # clitkGetOrigin
-ADD_TEST(clitkGetOrigin_4d    ${exe} clitkGetOrigin -i ${p}Deformation4D.mhd ${p}Deformation4D_ref.origin)
-ADD_TEST(clitkGetOrigin_3d    ${exe} clitkGetOrigin -i ${p}Lung3D.mhd      ${p}Lung3D_ref.origin)
+add_test(clitkGetOrigin_4d    ${exe} clitkGetOrigin -i ${p}Deformation4D.mhd ${p}Deformation4D_ref.origin)
+add_test(clitkGetOrigin_3d    ${exe} clitkGetOrigin -i ${p}Lung3D.mhd      ${p}Lung3D_ref.origin)
 #=========================================================
 # clitkGetSize
-ADD_TEST(clitkGetSize_4d      ${exe} clitkGetSize -i ${p}Deformation4D.mhd   ${p}Deformation4D_ref.size)
-ADD_TEST(clitkGetSize_3d     ${exe} clitkGetSize -i ${p}Lung3D.mhd         ${p}Lung3D_ref.size)
+add_test(clitkGetSize_4d      ${exe} clitkGetSize -i ${p}Deformation4D.mhd   ${p}Deformation4D_ref.size)
+add_test(clitkGetSize_3d     ${exe} clitkGetSize -i ${p}Lung3D.mhd         ${p}Lung3D_ref.size)
 #=========================================================
 # clitkGetDirection
-ADD_TEST(clitkGetDirection_4d ${exe} clitkGetDirection -i ${p}Deformation4D.mhd  ${p}Deformation4D_ref.direction)
-ADD_TEST(clitkGetDirection_3d ${exe} clitkGetDirection -i ${p}Lung3D.mhd       ${p}Lung3D_ref.direction)
+add_test(clitkGetDirection_4d ${exe} clitkGetDirection -i ${p}Deformation4D.mhd  ${p}Deformation4D_ref.direction)
+add_test(clitkGetDirection_3d ${exe} clitkGetDirection -i ${p}Lung3D.mhd       ${p}Lung3D_ref.direction)
 #=========================================================
 # clitkBinarize
-ADD_TEST(clitkBinarizeBGl0.1356_4d ${exe} clitkBinarizeImage -i ${p}Deformation4D.mhd --mode BG -l 0.1356 -o Deformation4D_ref.binarizeBGl0.1356.mhd ${p}Deformation4D_ref.binarizeBGl0.1356.mhd)
-ADD_TEST(clitkBinarizeFGl0.1556_3d ${exe} clitkBinarizeImage -i ${p}Lung3D.mhd        --mode FG -l 0.1556 -o Lung3D_ref.binarizeFGl0.1556.mhd ${p}Lung3D_ref.binarizeFGl0.1556.mhd)
+add_test(clitkBinarizeBGl0.1356_4d ${exe} clitkBinarizeImage -i ${p}Deformation4D.mhd --mode BG -l 0.1356 -o Deformation4D_ref.binarizeBGl0.1356.mhd ${p}Deformation4D_ref.binarizeBGl0.1356.mhd)
+add_test(clitkBinarizeFGl0.1556_3d ${exe} clitkBinarizeImage -i ${p}Lung3D.mhd        --mode FG -l 0.1556 -o Lung3D_ref.binarizeFGl0.1556.mhd ${p}Lung3D_ref.binarizeFGl0.1556.mhd)
 #=========================================================
 # clitkImageArithm
-ADD_TEST(clitkImageArithm0_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 0 -o Lung3D_ref.arithm0.mhd ${p}Lung3D_ref.arithm0.mhd)
-ADD_TEST(clitkImageArithm1_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 1 -o Lung3D_ref.arithm1.mhd ${p}Lung3D_ref.arithm1.mhd)
-ADD_TEST(clitkImageArithm2_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 2 -o Lung3D_ref.arithm2.mhd ${p}Lung3D_ref.arithm2.mhd)
-ADD_TEST(clitkImageArithm3_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 3 -o Lung3D_ref.arithm3.mhd ${p}Lung3D_ref.arithm3.mhd)
-ADD_TEST(clitkImageArithm4_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 4 -o Lung3D_ref.arithm4.mhd ${p}Lung3D_ref.arithm4.mhd)
-ADD_TEST(clitkImageArithm5_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 5 -o Lung3D_ref.arithm5.mhd ${p}Lung3D_ref.arithm5.mhd)
-ADD_TEST(clitkImageArithm6_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 6 -o Lung3D_ref.arithm6.mhd ${p}Lung3D_ref.arithm6.mhd)
+add_test(clitkImageArithm0_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 0 -o Lung3D_ref.arithm0.mhd ${p}Lung3D_ref.arithm0.mhd)
+add_test(clitkImageArithm1_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 1 -o Lung3D_ref.arithm1.mhd ${p}Lung3D_ref.arithm1.mhd)
+add_test(clitkImageArithm2_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 2 -o Lung3D_ref.arithm2.mhd ${p}Lung3D_ref.arithm2.mhd)
+add_test(clitkImageArithm3_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 3 -o Lung3D_ref.arithm3.mhd ${p}Lung3D_ref.arithm3.mhd)
+add_test(clitkImageArithm4_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 4 -o Lung3D_ref.arithm4.mhd ${p}Lung3D_ref.arithm4.mhd)
+add_test(clitkImageArithm5_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 5 -o Lung3D_ref.arithm5.mhd ${p}Lung3D_ref.arithm5.mhd)
+add_test(clitkImageArithm6_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 6 -o Lung3D_ref.arithm6.mhd ${p}Lung3D_ref.arithm6.mhd)
 
-ADD_TEST(clitkImageArithm0_4d ${exe} clitkImageArithm -i ${p}Deformation4D.mhd -j ${p}Deformation4D.mhd -t 0 -o Deformation4D_ref.arithm0.mhd ${p}Deformation4D_ref.arithm0.mhd)
-ADD_TEST(clitkImageArithm2_4d ${exe} clitkImageArithm -i ${p}Deformation4D.mhd -j ${p}Deformation4D.mhd -t 2 -o Deformation4D_ref.arithm2.mhd ${p}Deformation4D_ref.arithm2.mhd)
+add_test(clitkImageArithm0_4d ${exe} clitkImageArithm -i ${p}Deformation4D.mhd -j ${p}Deformation4D.mhd -t 0 -o Deformation4D_ref.arithm0.mhd ${p}Deformation4D_ref.arithm0.mhd)
+add_test(clitkImageArithm2_4d ${exe} clitkImageArithm -i ${p}Deformation4D.mhd -j ${p}Deformation4D.mhd -t 2 -o Deformation4D_ref.arithm2.mhd ${p}Deformation4D_ref.arithm2.mhd)
 #=========================================================
 # clitkCropImage
-ADD_TEST(clitkCropImage_3d ${exe} clitkCropImage -i ${p}Lung3D.mhd -b 1,4,0,2,2,3 -o Lung3D_ref.cropImage.1.4.0.2.2.3.mhd ${p}Lung3D_ref.cropImage.1.4.0.2.2.3.mhd)
+add_test(clitkCropImage_3d ${exe} clitkCropImage -i ${p}Lung3D.mhd -b 1,4,0,2,2,3 -o Lung3D_ref.cropImage.1.4.0.2.2.3.mhd ${p}Lung3D_ref.cropImage.1.4.0.2.2.3.mhd)
 #=========================================================
 #clitkMorphoMath
-ADD_TEST(clitkMorphoMath0_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t0.mhd ${p}Lung3D_ref.morphoMath.t0.mhd)
-ADD_TEST(clitkMorphoMath1_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t1.mhd ${p}Lung3D_ref.morphoMath.t1.mhd)
-ADD_TEST(clitkMorphoMath2_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t2.mhd ${p}Lung3D_ref.morphoMath.t2.mhd)
-ADD_TEST(clitkMorphoMath3_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t3.mhd ${p}Lung3D_ref.morphoMath.t3.mhd)
-ADD_TEST(clitkMorphoMath4_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t4.mhd ${p}Lung3D_ref.morphoMath.t4.mhd)
-ADD_TEST(clitkMorphoMath5_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t5.mhd ${p}Lung3D_ref.morphoMath.t5.mhd)
+add_test(clitkMorphoMath0_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t0.mhd ${p}Lung3D_ref.morphoMath.t0.mhd)
+add_test(clitkMorphoMath1_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t1.mhd ${p}Lung3D_ref.morphoMath.t1.mhd)
+add_test(clitkMorphoMath2_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t2.mhd ${p}Lung3D_ref.morphoMath.t2.mhd)
+add_test(clitkMorphoMath3_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t3.mhd ${p}Lung3D_ref.morphoMath.t3.mhd)
+add_test(clitkMorphoMath4_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t4.mhd ${p}Lung3D_ref.morphoMath.t4.mhd)
+add_test(clitkMorphoMath5_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t5.mhd ${p}Lung3D_ref.morphoMath.t5.mhd)
 
-ADD_TEST(clitkMorphoMath0_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t0.mhd ${p}Deformation4D_ref.morphoMath.t0.mhd)
-ADD_TEST(clitkMorphoMath1_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t1.mhd ${p}Deformation4D_ref.morphoMath.t1.mhd)
-ADD_TEST(clitkMorphoMath2_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t2.mhd ${p}Deformation4D_ref.morphoMath.t2.mhd)
-ADD_TEST(clitkMorphoMath3_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t3.mhd ${p}Deformation4D_ref.morphoMath.t3.mhd)
-ADD_TEST(clitkMorphoMath4_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t4.mhd ${p}Deformation4D_ref.morphoMath.t4.mhd)
-ADD_TEST(clitkMorphoMath5_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t5.mhd ${p}Deformation4D_ref.morphoMath.t5.mhd)
+add_test(clitkMorphoMath0_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t0.mhd ${p}Deformation4D_ref.morphoMath.t0.mhd)
+add_test(clitkMorphoMath1_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t1.mhd ${p}Deformation4D_ref.morphoMath.t1.mhd)
+add_test(clitkMorphoMath2_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t2.mhd ${p}Deformation4D_ref.morphoMath.t2.mhd)
+add_test(clitkMorphoMath3_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t3.mhd ${p}Deformation4D_ref.morphoMath.t3.mhd)
+add_test(clitkMorphoMath4_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t4.mhd ${p}Deformation4D_ref.morphoMath.t4.mhd)
+add_test(clitkMorphoMath5_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t5.mhd ${p}Deformation4D_ref.morphoMath.t5.mhd)
 #=========================================================
 #clitkSetBackground
-ADD_TEST(clitkSetBackground_4d ${exe} clitkSetBackground -i ${p}Deformation4D.mhd -m ${p}Deformation4D.mhd -o Deformation4D_ref.setBackground.mhd ${p}Deformation4D_ref.setBackground.mhd)
-ADD_TEST(clitkSetBackground_3d ${exe} clitkSetBackground -i ${p}Lung3D.mhd -m ${p}Lung3D.mhd -o Lung3D_ref.setBackground.mhd ${p}Lung3D_ref.setBackground.mhd)
+add_test(clitkSetBackground_4d ${exe} clitkSetBackground -i ${p}Deformation4D.mhd -m ${p}Deformation4D.mhd -o Deformation4D_ref.setBackground.mhd ${p}Deformation4D_ref.setBackground.mhd)
+add_test(clitkSetBackground_3d ${exe} clitkSetBackground -i ${p}Lung3D.mhd -m ${p}Lung3D.mhd -o Lung3D_ref.setBackground.mhd ${p}Lung3D_ref.setBackground.mhd)
 #clitkWarpImage
-ADD_TEST(clitkWarpImage_3d ${exe} clitkWarpImage -i ${p}00-P.mhd --vf ${p}vf50-P_1.mhd -o 00-P_ref.warpImage.mhd ${p}00-P_ref.warpImage.mhd)
+add_test(clitkWarpImage_3d ${exe} clitkWarpImage -i ${p}00-P.mhd --vf ${p}vf50-P_1.mhd -o 00-P_ref.warpImage.mhd ${p}00-P_ref.warpImage.mhd)
 
 
 
@@ -82,6 +82,6 @@ ADD_TEST(clitkWarpImage_3d ${exe} clitkWarpImage -i ${p}00-P.mhd --vf ${p}vf50-P
 
 
 
-UNSET(exe)
-UNSET(p)
+unset(exe)
+unset(p)
 
index 08c4a25fb575ba67df26a8c6e101cce69caf7ca4..107aafac0e936da62c8bae6ca472821916f33297 100644 (file)
 #=========================================================
 # Add Libraries used in vv and clitk to avoid recompilation
 WRAP_GGO(clitkCropImage_GGO_C clitkCropImage.ggo)
-ADD_LIBRARY(clitkCropImageLib clitkCropImageGenericFilter.cxx ${clitkCropImage_GGO_C})
+add_library(clitkCropImageLib clitkCropImageGenericFilter.cxx ${clitkCropImage_GGO_C})
 
 WRAP_GGO(clitkImageConvert_GGO_C clitkImageConvert.ggo)
-ADD_LIBRARY(clitkImageConvertLib clitkImageConvertGenericFilter.cxx ${clitkImageConvert_GGO_C})
+add_library(clitkImageConvertLib clitkImageConvertGenericFilter.cxx ${clitkImageConvert_GGO_C})
 
 WRAP_GGO(clitkBinarizeImage_GGO_C clitkBinarizeImage.ggo)
-ADD_LIBRARY(clitkBinarizeImageLib clitkBinarizeImageGenericFilter.cxx ${clitkBinarizeImage_GGO_C})
+add_library(clitkBinarizeImageLib clitkBinarizeImageGenericFilter.cxx ${clitkBinarizeImage_GGO_C})
 
 WRAP_GGO(clitkImageArithm_GGO_C clitkImageArithm.ggo)
-ADD_LIBRARY(clitkImageArithmImageLib clitkImageArithmGenericFilter.cxx ${clitkImageArithm_GGO_C})
+add_library(clitkImageArithmImageLib clitkImageArithmGenericFilter.cxx ${clitkImageArithm_GGO_C})
 
 WRAP_GGO(clitkVectorArithm_GGO_C clitkVectorArithm.ggo)
-ADD_LIBRARY(clitkVectorArithmLib clitkVectorArithmGenericFilter.cxx ${clitkVectorArithm_GGO_C})
+add_library(clitkVectorArithmLib clitkVectorArithmGenericFilter.cxx ${clitkVectorArithm_GGO_C})
 
 WRAP_GGO(clitkResampleImage_GGO_C clitkResampleImage.ggo)
-ADD_LIBRARY(clitkResampleImageLib clitkResampleImageGenericFilter.cxx ${clitkResampleImage_GGO_C})
+add_library(clitkResampleImageLib clitkResampleImageGenericFilter.cxx ${clitkResampleImage_GGO_C})
 
 WRAP_GGO(clitkMIP_GGO_C clitkMIP.ggo)
-ADD_LIBRARY(clitkMIPLib clitkMIPGenericFilter.cxx ${clitkMIP_GGO_C})
+add_library(clitkMIPLib clitkMIPGenericFilter.cxx ${clitkMIP_GGO_C})
 
 WRAP_GGO(clitkMedianImageFilter_GGO_C clitkMedianImageFilter.ggo)
-ADD_LIBRARY(clitkMedianImageFilterLib clitkMedianImageGenericFilter.cxx ${clitkMedianImageFilter_GGO_C})
+add_library(clitkMedianImageFilterLib clitkMedianImageGenericFilter.cxx ${clitkMedianImageFilter_GGO_C})
 
 #=========================================================
-IF (CLITK_BUILD_TOOLS)
+if(CLITK_BUILD_TOOLS)
 
   WRAP_GGO(clitkDicomInfo_GGO_C clitkDicomInfo.ggo)
-  ADD_EXECUTABLE(clitkDicomInfo clitkDicomInfo.cxx ${clitkDicomInfo_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkDicomInfo clitkCommon)
+  add_executable(clitkDicomInfo clitkDicomInfo.cxx ${clitkDicomInfo_GGO_C})
+  target_link_libraries(clitkDicomInfo clitkCommon)
   # set_target_properties(clitkDicomInfo
   #   PROPERTIES
   #   LINK_INTERFACE_LIBRARIES ""
   #   )
-  SET(TOOLS_INSTALL clitkDicomInfo)
+  set(TOOLS_INSTALL clitkDicomInfo)
 
   WRAP_GGO(clitkDicom2Image_GGO_C clitkDicom2Image.ggo)
-  ADD_EXECUTABLE(clitkDicom2Image clitkDicom2Image.cxx ${clitkDicom2Image_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkDicom2Image clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDicom2Image)
+  add_executable(clitkDicom2Image clitkDicom2Image.cxx ${clitkDicom2Image_GGO_C})
+  target_link_libraries(clitkDicom2Image clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDicom2Image)
 
   WRAP_GGO(clitkDicomWave2Text_GGO_C clitkDicomWave2Text.ggo)
-  ADD_EXECUTABLE(clitkDicomWave2Text clitkDicomWave2Text.cxx ${clitkDicomWave2Text_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkDicomWave2Text clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDicomWave2Text)
+  add_executable(clitkDicomWave2Text clitkDicomWave2Text.cxx ${clitkDicomWave2Text_GGO_C})
+  target_link_libraries(clitkDicomWave2Text clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDicomWave2Text)
 
   WRAP_GGO(clitkImageInfo_GGO_C clitkImageInfo.ggo)
-  ADD_EXECUTABLE(clitkImageInfo clitkImageInfo.cxx ${clitkImageInfo_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkImageInfo clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageInfo)
+  add_executable(clitkImageInfo clitkImageInfo.cxx ${clitkImageInfo_GGO_C})
+  target_link_libraries(clitkImageInfo clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageInfo)
 
-  ADD_EXECUTABLE(clitkImageConvert clitkImageConvert.cxx)
-  TARGET_LINK_LIBRARIES(clitkImageConvert clitkImageConvertLib clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageConvert)
+  add_executable(clitkImageConvert clitkImageConvert.cxx)
+  target_link_libraries(clitkImageConvert clitkImageConvertLib clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageConvert)
 
-  ADD_EXECUTABLE(clitkBinarizeImage clitkBinarizeImage.cxx)
-  TARGET_LINK_LIBRARIES(clitkBinarizeImage clitkBinarizeImageLib clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkBinarizeImage)
+  add_executable(clitkBinarizeImage clitkBinarizeImage.cxx)
+  target_link_libraries(clitkBinarizeImage clitkBinarizeImageLib clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkBinarizeImage)
 
   WRAP_GGO(clitkVFResample_GGO_C clitkVFResample.ggo)
-  ADD_EXECUTABLE(clitkVFResample clitkVFResample.cxx clitkVFResampleGenericFilter.cxx ${clitkVFResample_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkVFResample clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkVFResample)
+  add_executable(clitkVFResample clitkVFResample.cxx clitkVFResampleGenericFilter.cxx ${clitkVFResample_GGO_C})
+  target_link_libraries(clitkVFResample clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkVFResample)
 
   WRAP_GGO(clitkVFInterpolate_GGO_C clitkVFInterpolate.ggo)
-  ADD_EXECUTABLE(clitkVFInterpolate clitkVFInterpolate.cxx clitkVFInterpolateGenericFilter.cxx ${clitkVFInterpolate_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkVFInterpolate clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkVFInterpolate)
+  add_executable(clitkVFInterpolate clitkVFInterpolate.cxx clitkVFInterpolateGenericFilter.cxx ${clitkVFInterpolate_GGO_C})
+  target_link_libraries(clitkVFInterpolate clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkVFInterpolate)
 
   WRAP_GGO(clitkImageCreate_GGO_C clitkImageCreate.ggo)
-  ADD_EXECUTABLE(clitkImageCreate clitkImageCreate.cxx ${clitkImageCreate_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkImageCreate clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageCreate)
+  add_executable(clitkImageCreate clitkImageCreate.cxx ${clitkImageCreate_GGO_C})
+  target_link_libraries(clitkImageCreate clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageCreate)
 
   WRAP_GGO(clitkZeroVF_GGO_C clitkZeroVF.ggo)
-  ADD_EXECUTABLE(clitkZeroVF clitkZeroVF.cxx ${clitkZeroVF_GGO_C} clitkZeroVFGenericFilter.cxx)
-  TARGET_LINK_LIBRARIES(clitkZeroVF clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkZeroVF)
+  add_executable(clitkZeroVF clitkZeroVF.cxx ${clitkZeroVF_GGO_C} clitkZeroVFGenericFilter.cxx)
+  target_link_libraries(clitkZeroVF clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkZeroVF)
 
   WRAP_GGO(clitkSplitImage_GGO_C clitkSplitImage.ggo)
-  ADD_EXECUTABLE(clitkSplitImage clitkSplitImage.cxx clitkSplitImageGenericFilter.cxx ${clitkSplitImage_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkSplitImage clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkSplitImage)
+  add_executable(clitkSplitImage clitkSplitImage.cxx clitkSplitImageGenericFilter.cxx ${clitkSplitImage_GGO_C})
+  target_link_libraries(clitkSplitImage clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkSplitImage)
 
   WRAP_GGO(clitkWriteDicomSeries_GGO_C clitkWriteDicomSeries.ggo)
-  ADD_EXECUTABLE(clitkWriteDicomSeries clitkWriteDicomSeries.cxx ${clitkWriteDicomSeries_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkWriteDicomSeries clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkWriteDicomSeries)
+  add_executable(clitkWriteDicomSeries clitkWriteDicomSeries.cxx ${clitkWriteDicomSeries_GGO_C})
+  target_link_libraries(clitkWriteDicomSeries clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkWriteDicomSeries)
 
   WRAP_GGO(clitkMedianTemporalDimension_GGO_C clitkMedianTemporalDimension.ggo)
-  ADD_EXECUTABLE(clitkMedianTemporalDimension clitkMedianTemporalDimension.cxx
+  add_executable(clitkMedianTemporalDimension clitkMedianTemporalDimension.cxx
     ${clitkMedianTemporalDimension_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkMedianTemporalDimension clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMedianTemporalDimension)
+  target_link_libraries(clitkMedianTemporalDimension clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMedianTemporalDimension)
 
   WRAP_GGO(clitkWarpImage_GGO_C clitkWarpImage.ggo)
-  ADD_EXECUTABLE(clitkWarpImage clitkWarpImage.cxx ${clitkWarpImage_GGO_C} clitkWarpImageGenericFilter.cxx)
-  TARGET_LINK_LIBRARIES(clitkWarpImage clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkWarpImage)
+  add_executable(clitkWarpImage clitkWarpImage.cxx ${clitkWarpImage_GGO_C} clitkWarpImageGenericFilter.cxx)
+  target_link_libraries(clitkWarpImage clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkWarpImage)
 
   WRAP_GGO(clitkInvertVF_GGO_C clitkInvertVF.ggo)
-  ADD_EXECUTABLE(clitkInvertVF clitkInvertVF.cxx ${clitkInvertVF_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkInvertVF clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkInvertVF)
+  add_executable(clitkInvertVF clitkInvertVF.cxx ${clitkInvertVF_GGO_C})
+  target_link_libraries(clitkInvertVF clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkInvertVF)
 
   WRAP_GGO(clitkAffineTransform_GGO_C clitkAffineTransform.ggo)
-  ADD_EXECUTABLE(clitkAffineTransform clitkAffineTransform.cxx ${clitkAffineTransform_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkAffineTransform clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkAffineTransform)
+  add_executable(clitkAffineTransform clitkAffineTransform.cxx ${clitkAffineTransform_GGO_C})
+  target_link_libraries(clitkAffineTransform clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkAffineTransform)
 
   WRAP_GGO(clitkElastixTransformToMatrix_GGO_C clitkElastixTransformToMatrix.ggo)
-  ADD_EXECUTABLE(clitkElastixTransformToMatrix clitkElastixTransformToMatrix.cxx ${clitkElastixTransformToMatrix_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkElastixTransformToMatrix clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkElastixTransformToMatrix)
+  add_executable(clitkElastixTransformToMatrix clitkElastixTransformToMatrix.cxx ${clitkElastixTransformToMatrix_GGO_C})
+  target_link_libraries(clitkElastixTransformToMatrix clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkElastixTransformToMatrix)
 
   WRAP_GGO(clitkMatrixToElastixTransform_GGO_C clitkMatrixToElastixTransform.ggo)
-  ADD_EXECUTABLE(clitkMatrixToElastixTransform clitkMatrixToElastixTransform.cxx ${clitkMatrixToElastixTransform_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkMatrixToElastixTransform clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMatrixToElastixTransform)
+  add_executable(clitkMatrixToElastixTransform clitkMatrixToElastixTransform.cxx ${clitkMatrixToElastixTransform_GGO_C})
+  target_link_libraries(clitkMatrixToElastixTransform clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMatrixToElastixTransform)
 
   WRAP_GGO(clitkMatrixMultiply_GGO_C clitkMatrixMultiply.ggo)
-  ADD_EXECUTABLE(clitkMatrixMultiply clitkMatrixMultiply.cxx ${clitkMatrixMultiply_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkMatrixMultiply clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMatrixMultiply)
+  add_executable(clitkMatrixMultiply clitkMatrixMultiply.cxx ${clitkMatrixMultiply_GGO_C})
+  target_link_libraries(clitkMatrixMultiply clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMatrixMultiply)
 
   WRAP_GGO(clitkMatrixInverse_GGO_C clitkMatrixInverse.ggo)
-  ADD_EXECUTABLE(clitkMatrixInverse clitkMatrixInverse.cxx ${clitkMatrixInverse_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkMatrixInverse clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMatrixInverse)
+  add_executable(clitkMatrixInverse clitkMatrixInverse.cxx ${clitkMatrixInverse_GGO_C})
+  target_link_libraries(clitkMatrixInverse clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMatrixInverse)
 
   WRAP_GGO(clitkSetBackground_GGO_C clitkSetBackground.ggo)
-  ADD_EXECUTABLE(clitkSetBackground clitkSetBackground.cxx clitkSetBackgroundGenericFilter.cxx ${clitkSetBackground_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkSetBackground clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkSetBackground)
+  add_executable(clitkSetBackground clitkSetBackground.cxx clitkSetBackgroundGenericFilter.cxx ${clitkSetBackground_GGO_C})
+  target_link_libraries(clitkSetBackground clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkSetBackground)
 
   WRAP_GGO(clitkGammaIndex_GGO_C clitkGammaIndex.ggo)
-  ADD_EXECUTABLE(clitkGammaIndex clitkGammaIndex.cxx ${clitkGammaIndex_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkGammaIndex clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkGammaIndex)
+  add_executable(clitkGammaIndex clitkGammaIndex.cxx ${clitkGammaIndex_GGO_C})
+  target_link_libraries(clitkGammaIndex clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkGammaIndex)
 
-  ADD_EXECUTABLE(clitkImageArithm clitkImageArithm.cxx)
-  TARGET_LINK_LIBRARIES(clitkImageArithm clitkImageArithmImageLib clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageArithm)
+  add_executable(clitkImageArithm clitkImageArithm.cxx)
+  target_link_libraries(clitkImageArithm clitkImageArithmImageLib clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageArithm)
 
-  ADD_EXECUTABLE(clitkVectorArithm clitkVectorArithm.cxx)
-  TARGET_LINK_LIBRARIES(clitkVectorArithm clitkVectorArithmLib clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkVectorArithm)
+  add_executable(clitkVectorArithm clitkVectorArithm.cxx)
+  target_link_libraries(clitkVectorArithm clitkVectorArithmLib clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkVectorArithm)
 
   WRAP_GGO(clitkUnsharpMask_GGO_C clitkUnsharpMask.ggo)
-  ADD_EXECUTABLE(clitkUnsharpMask clitkUnsharpMask.cxx ${clitkUnsharpMask_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkUnsharpMask clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkUnsharpMask)
+  add_executable(clitkUnsharpMask clitkUnsharpMask.cxx ${clitkUnsharpMask_GGO_C})
+  target_link_libraries(clitkUnsharpMask clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkUnsharpMask)
 
   WRAP_GGO(clitkFooImage_GGO_C clitkFooImage.ggo)
-  ADD_EXECUTABLE(clitkFooImage clitkFooImage.cxx ${clitkFooImage_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkFooImage clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkFooImage)
+  add_executable(clitkFooImage clitkFooImage.cxx ${clitkFooImage_GGO_C})
+  target_link_libraries(clitkFooImage clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkFooImage)
 
   WRAP_GGO(clitkMedianImageFilter_GGO_C clitkMedianImageFilter.ggo)
-  ADD_EXECUTABLE(clitkMedianImageFilter clitkMedianImageFilter.cxx ${clitkMedianImageFilter_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkMedianImageFilter clitkMedianImageFilterLib clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMedianImageFilter)
+  add_executable(clitkMedianImageFilter clitkMedianImageFilter.cxx ${clitkMedianImageFilter_GGO_C})
+  target_link_libraries(clitkMedianImageFilter clitkMedianImageFilterLib clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMedianImageFilter)
 
-  ADD_EXECUTABLE(clitkResampleImage clitkResampleImage.cxx)
-  TARGET_LINK_LIBRARIES(clitkResampleImage clitkResampleImageLib clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkResampleImage)
+  add_executable(clitkResampleImage clitkResampleImage.cxx)
+  target_link_libraries(clitkResampleImage clitkResampleImageLib clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkResampleImage)
 
   WRAP_GGO(clitkMinMaxMask_GGO_C clitkMinMaxMask.ggo)
-  ADD_EXECUTABLE(clitkMinMaxMask clitkMinMaxMask.cxx ${clitkMinMaxMask_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkMinMaxMask clitkCommon  )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMinMaxMask)
+  add_executable(clitkMinMaxMask clitkMinMaxMask.cxx ${clitkMinMaxMask_GGO_C})
+  target_link_libraries(clitkMinMaxMask clitkCommon  )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMinMaxMask)
 
   WRAP_GGO(clitkAutoCrop_GGO_C clitkAutoCrop.ggo)
-  ADD_EXECUTABLE(clitkAutoCrop clitkAutoCrop.cxx ${clitkAutoCrop_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkAutoCrop clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkAutoCrop)
+  add_executable(clitkAutoCrop clitkAutoCrop.cxx ${clitkAutoCrop_GGO_C})
+  target_link_libraries(clitkAutoCrop clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkAutoCrop)
 
   WRAP_GGO(clitkDicomRTStruct2Image_GGO_C clitkDicomRTStruct2Image.ggo)
-  ADD_EXECUTABLE(clitkDicomRTStruct2Image clitkDicomRTStruct2Image.cxx ${clitkDicomRTStruct2Image_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkDicomRTStruct2Image clitkDicomRTStruct)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDicomRTStruct2Image)
+  add_executable(clitkDicomRTStruct2Image clitkDicomRTStruct2Image.cxx ${clitkDicomRTStruct2Image_GGO_C})
+  target_link_libraries(clitkDicomRTStruct2Image clitkDicomRTStruct)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDicomRTStruct2Image)
 
-  IF(CLITK_USE_SYSTEM_GDCM)
+  if(CLITK_USE_SYSTEM_GDCM)
     WRAP_GGO(clitkImage2DicomRTStruct_GGO_C clitkImage2DicomRTStruct.ggo)
-    ADD_EXECUTABLE(clitkImage2DicomRTStruct clitkImage2DicomRTStruct.cxx ${clitkImage2DicomRTStruct_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkImage2DicomRTStruct clitkDicomRTStruct)
-  ENDIF()
+    add_executable(clitkImage2DicomRTStruct clitkImage2DicomRTStruct.cxx ${clitkImage2DicomRTStruct_GGO_C})
+    target_link_libraries(clitkImage2DicomRTStruct clitkDicomRTStruct)
+  endif()
 
   WRAP_GGO(clitkComposeVF_GGO_C clitkComposeVF.ggo)
-  ADD_EXECUTABLE(clitkComposeVF clitkComposeVFGenericFilter.cxx clitkComposeVF.cxx ${clitkComposeVF_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkComposeVF clitkCommon  )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkComposeVF)
+  add_executable(clitkComposeVF clitkComposeVFGenericFilter.cxx clitkComposeVF.cxx ${clitkComposeVF_GGO_C})
+  target_link_libraries(clitkComposeVF clitkCommon  )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkComposeVF)
 
   WRAP_GGO(clitkMergeSequence_GGO_C clitkMergeSequence.ggo)
-  ADD_EXECUTABLE(clitkMergeSequence clitkMergeSequence.cxx clitkMergeSequenceGenericFilter.cxx ${clitkMergeSequence_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkMergeSequence clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMergeSequence)
+  add_executable(clitkMergeSequence clitkMergeSequence.cxx clitkMergeSequenceGenericFilter.cxx ${clitkMergeSequence_GGO_C})
+  target_link_libraries(clitkMergeSequence clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMergeSequence)
 
   WRAP_GGO(clitkBackProjectImage_GGO_C clitkBackProjectImage.ggo)
-  ADD_EXECUTABLE(clitkBackProjectImage clitkBackProjectImage.cxx clitkBackProjectImageGenericFilter.cxx ${clitkBackProjectImage_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkBackProjectImage clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkBackProjectImage)
+  add_executable(clitkBackProjectImage clitkBackProjectImage.cxx clitkBackProjectImageGenericFilter.cxx ${clitkBackProjectImage_GGO_C})
+  target_link_libraries(clitkBackProjectImage clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkBackProjectImage)
 
-  ADD_EXECUTABLE(clitkCropImage clitkCropImage.cxx ${clitkCropImage_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkCropImage clitkCropImageLib clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkCropImage)
+  add_executable(clitkCropImage clitkCropImage.cxx ${clitkCropImage_GGO_C})
+  target_link_libraries(clitkCropImage clitkCropImageLib clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkCropImage)
 
   # WRAP_GGO(clitkExtractSlice_GGO_C clitkExtractSlice.ggo)
-  # ADD_EXECUTABLE(clitkExtractSlice clitkExtractSlice.cxx clitkExtractSliceGenericFilter.cxx ${clitkExtractSlice_GGO_C})
-  # TARGET_LINK_LIBRARIES(clitkExtractSlice clitkCommon)
-  #SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkExtractSlice)
+  # add_executable(clitkExtractSlice clitkExtractSlice.cxx clitkExtractSliceGenericFilter.cxx ${clitkExtractSlice_GGO_C})
+  # target_link_libraries(clitkExtractSlice clitkCommon)
+  #set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkExtractSlice)
 
   WRAP_GGO(clitkFlipImage_GGO_C clitkFlipImage.ggo)
-  ADD_EXECUTABLE(clitkFlipImage clitkFlipImage.cxx clitkFlipImageGenericFilter.cxx ${clitkFlipImage_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkFlipImage clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkFlipImage)
+  add_executable(clitkFlipImage clitkFlipImage.cxx clitkFlipImageGenericFilter.cxx ${clitkFlipImage_GGO_C})
+  target_link_libraries(clitkFlipImage clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkFlipImage)
 
   WRAP_GGO(clitkMirrorPadImage_GGO_C clitkMirrorPadImage.ggo)
-  ADD_EXECUTABLE(clitkMirrorPadImage clitkMirrorPadImage.cxx clitkMirrorPadImageGenericFilter.cxx ${clitkMirrorPadImage_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkMirrorPadImage clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMirrorPadImage)
+  add_executable(clitkMirrorPadImage clitkMirrorPadImage.cxx clitkMirrorPadImageGenericFilter.cxx ${clitkMirrorPadImage_GGO_C})
+  target_link_libraries(clitkMirrorPadImage clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMirrorPadImage)
 
   WRAP_GGO(clitkImageMoment_GGO_C clitkImageMoment.ggo)
-  ADD_EXECUTABLE(clitkImageMoment clitkImageMoment.cxx clitkImageMomentGenericFilter.cxx ${clitkImageMoment_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkImageMoment clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageMoment)
+  add_executable(clitkImageMoment clitkImageMoment.cxx clitkImageMomentGenericFilter.cxx ${clitkImageMoment_GGO_C})
+  target_link_libraries(clitkImageMoment clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageMoment)
 
   WRAP_GGO(clitkImageStatistics_GGO_C clitkImageStatistics.ggo)
-  ADD_EXECUTABLE(clitkImageStatistics clitkImageStatistics.cxx clitkImageStatisticsGenericFilter.cxx ${clitkImageStatistics_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkImageStatistics clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageStatistics)
+  add_executable(clitkImageStatistics clitkImageStatistics.cxx clitkImageStatisticsGenericFilter.cxx ${clitkImageStatistics_GGO_C})
+  target_link_libraries(clitkImageStatistics clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageStatistics)
 
   WRAP_GGO(clitkDVH_GGO_C clitkDVH.ggo)
-  ADD_EXECUTABLE(clitkDVH clitkDVH.cxx clitkDVHGenericFilter.cxx ${clitkDVH_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkDVH clitkVectorArithmLib clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDVH)
+  add_executable(clitkDVH clitkDVH.cxx clitkDVHGenericFilter.cxx ${clitkDVH_GGO_C})
+  target_link_libraries(clitkDVH clitkVectorArithmLib clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDVH)
 
   WRAP_GGO(clitkVFConvert_GGO_C clitkVFConvert.ggo)
-  ADD_EXECUTABLE(clitkVFConvert clitkVFConvert.cxx clitkVFConvertGenericFilter.cxx ${clitkVFConvert_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkVFConvert clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkVFConvert)
+  add_executable(clitkVFConvert clitkVFConvert.cxx clitkVFConvertGenericFilter.cxx ${clitkVFConvert_GGO_C})
+  target_link_libraries(clitkVFConvert clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkVFConvert)
 
   WRAP_GGO(clitkImageToVectorImage_GGO_C clitkImageToVectorImage.ggo)
-  ADD_EXECUTABLE(clitkImageToVectorImage  clitkImageToVectorImage.cxx clitkImageToVectorImageGenericFilter.cxx ${clitkImageToVectorImage_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkImageToVectorImage  clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageToVectorImage)
+  add_executable(clitkImageToVectorImage  clitkImageToVectorImage.cxx clitkImageToVectorImageGenericFilter.cxx ${clitkImageToVectorImage_GGO_C})
+  target_link_libraries(clitkImageToVectorImage  clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageToVectorImage)
 
   WRAP_GGO(clitkVectorImageToImage_GGO_C clitkVectorImageToImage.ggo)
-  ADD_EXECUTABLE(clitkVectorImageToImage  clitkVectorImageToImage.cxx clitkVectorImageToImageGenericFilter.cxx ${clitkVectorImageToImage_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkVectorImageToImage  clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkVectorImageToImage)
+  add_executable(clitkVectorImageToImage  clitkVectorImageToImage.cxx clitkVectorImageToImageGenericFilter.cxx ${clitkVectorImageToImage_GGO_C})
+  target_link_libraries(clitkVectorImageToImage  clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkVectorImageToImage)
 
-  ADD_EXECUTABLE(clitkMIP clitkMIP.cxx clitkMIPGenericFilter.cxx)
-  TARGET_LINK_LIBRARIES(clitkMIP clitkMIPLib clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMIP)
+  add_executable(clitkMIP clitkMIP.cxx clitkMIPGenericFilter.cxx)
+  target_link_libraries(clitkMIP clitkMIPLib clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMIP)
 
   WRAP_GGO(clitkTransformLandmarks_GGO_C clitkTransformLandmarks.ggo)
-  ADD_EXECUTABLE(clitkTransformLandmarks clitkTransformLandmarks.cxx ${clitkTransformLandmarks_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkTransformLandmarks clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkTransformLandmarks)
+  add_executable(clitkTransformLandmarks clitkTransformLandmarks.cxx ${clitkTransformLandmarks_GGO_C})
+  target_link_libraries(clitkTransformLandmarks clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkTransformLandmarks)
 
   WRAP_GGO(clitkMaskLandmarks_GGO_C clitkMaskLandmarks.ggo)
-  ADD_EXECUTABLE(clitkMaskLandmarks clitkMaskLandmarks.cxx ${clitkMaskLandmarks_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkMaskLandmarks clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMaskLandmarks)
+  add_executable(clitkMaskLandmarks clitkMaskLandmarks.cxx ${clitkMaskLandmarks_GGO_C})
+  target_link_libraries(clitkMaskLandmarks clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMaskLandmarks)
 
   WRAP_GGO(clitkJacobianImage_GGO_C clitkJacobianImage.ggo)
-  ADD_EXECUTABLE(clitkJacobianImage clitkJacobianImage.cxx clitkJacobianImageGenericFilter.cxx ${clitkJacobianImage_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkJacobianImage clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkJacobianImage)
+  add_executable(clitkJacobianImage clitkJacobianImage.cxx clitkJacobianImageGenericFilter.cxx ${clitkJacobianImage_GGO_C})
+  target_link_libraries(clitkJacobianImage clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkJacobianImage)
 
   WRAP_GGO(clitkPadImage_GGO_C clitkPadImage.ggo)
-  ADD_EXECUTABLE(clitkPadImage clitkPadImage.cxx clitkPadImageGenericFilter.cxx ${clitkPadImage_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkPadImage clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkPadImage)
+  add_executable(clitkPadImage clitkPadImage.cxx clitkPadImageGenericFilter.cxx ${clitkPadImage_GGO_C})
+  target_link_libraries(clitkPadImage clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkPadImage)
 
   WRAP_GGO(clitkCatImage_GGO_C clitkCatImage.ggo)
-  ADD_EXECUTABLE(clitkCatImage clitkCatImage.cxx ${clitkCatImage_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkCatImage clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkCatImage)
+  add_executable(clitkCatImage clitkCatImage.cxx ${clitkCatImage_GGO_C})
+  target_link_libraries(clitkCatImage clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkCatImage)
 
   WRAP_GGO(clitkAnisotropicDiffusion_GGO_C clitkAnisotropicDiffusion.ggo)
-  ADD_EXECUTABLE(clitkAnisotropicDiffusion clitkAnisotropicDiffusion.cxx
+  add_executable(clitkAnisotropicDiffusion clitkAnisotropicDiffusion.cxx
     clitkAnisotropicDiffusionGenericFilter.cxx
     ${clitkAnisotropicDiffusion_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkAnisotropicDiffusion clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkAnisotropicDiffusion)
+  target_link_libraries(clitkAnisotropicDiffusion clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkAnisotropicDiffusion)
 
   WRAP_GGO(clitkChangeImageInfo_GGO_C clitkChangeImageInfo.ggo)
-  ADD_EXECUTABLE(clitkChangeImageInfo clitkChangeImageInfo.cxx
+  add_executable(clitkChangeImageInfo clitkChangeImageInfo.cxx
     clitkChangeImageInfoGenericFilter.cxx
     ${clitkChangeImageInfo_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkChangeImageInfo clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkChangeImageInfo)
+  target_link_libraries(clitkChangeImageInfo clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkChangeImageInfo)
 
   WRAP_GGO(clitkMergeAsciiDoseActor_GGO_C clitkMergeAsciiDoseActor.ggo)
-  ADD_EXECUTABLE(clitkMergeAsciiDoseActor clitkMergeAsciiDoseActor.cxx ${clitkMergeAsciiDoseActor_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkMergeAsciiDoseActor ITKCommon clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMergeAsciiDoseActor)
+  add_executable(clitkMergeAsciiDoseActor clitkMergeAsciiDoseActor.cxx ${clitkMergeAsciiDoseActor_GGO_C})
+  target_link_libraries(clitkMergeAsciiDoseActor ITKCommon clitkCommon)
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMergeAsciiDoseActor)
 
   WRAP_GGO(clitkImageUncertainty_GGO_C clitkImageUncertainty.ggo)
-  ADD_EXECUTABLE(clitkImageUncertainty clitkImageUncertainty.cxx clitkImageUncertainty_ggo.c)
-  TARGET_LINK_LIBRARIES(clitkImageUncertainty clitkCommon ${ITK_LIBRARIES})
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageUncertainty)
+  add_executable(clitkImageUncertainty clitkImageUncertainty.cxx clitkImageUncertainty_ggo.c)
+  target_link_libraries(clitkImageUncertainty clitkCommon ${ITK_LIBRARIES})
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageUncertainty)
 
   WRAP_GGO(clitkNormalizeImageFilter_GGO_C clitkNormalizeImageFilter.ggo)
-  ADD_EXECUTABLE(clitkNormalizeImageFilter clitkNormalizeImageFilter.cxx ${clitkNormalizeImageFilter_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkNormalizeImageFilter clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkNormalizeImageFilter)
+  add_executable(clitkNormalizeImageFilter clitkNormalizeImageFilter.cxx ${clitkNormalizeImageFilter_GGO_C})
+  target_link_libraries(clitkNormalizeImageFilter clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkNormalizeImageFilter)
 
   WRAP_GGO(clitkImageGradientMagnitude_GGO_C clitkImageGradientMagnitude.ggo)
-  ADD_EXECUTABLE(clitkImageGradientMagnitude clitkImageGradientMagnitude.cxx ${clitkImageGradientMagnitude_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkImageGradientMagnitude clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageGradientMagnitude)
+  add_executable(clitkImageGradientMagnitude clitkImageGradientMagnitude.cxx ${clitkImageGradientMagnitude_GGO_C})
+  target_link_libraries(clitkImageGradientMagnitude clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageGradientMagnitude)
 
   WRAP_GGO(clitkImageLaplacian_GGO_C clitkImageLaplacian.ggo)
-  ADD_EXECUTABLE(clitkImageLaplacian clitkImageLaplacian.cxx ${clitkImageLaplacian_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkImageLaplacian clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageLaplacian)
+  add_executable(clitkImageLaplacian clitkImageLaplacian.cxx ${clitkImageLaplacian_GGO_C})
+  target_link_libraries(clitkImageLaplacian clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageLaplacian)
 
   WRAP_GGO(clitkImageIntensityWindowing_GGO_C clitkImageIntensityWindowing.ggo)
-  ADD_EXECUTABLE(clitkImageIntensityWindowing clitkImageIntensityWindowing.cxx ${clitkImageIntensityWindowing_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkImageIntensityWindowing clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageIntensityWindowing)
+  add_executable(clitkImageIntensityWindowing clitkImageIntensityWindowing.cxx ${clitkImageIntensityWindowing_GGO_C})
+  target_link_libraries(clitkImageIntensityWindowing clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageIntensityWindowing)
 
   WRAP_GGO(clitkBlurImage_GGO_C clitkBlurImage.ggo)
-  ADD_EXECUTABLE(clitkBlurImage clitkBlurImage.cxx ${clitkBlurImage_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkBlurImage clitkCommon )
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkBlurImage)
+  add_executable(clitkBlurImage clitkBlurImage.cxx ${clitkBlurImage_GGO_C})
+  target_link_libraries(clitkBlurImage clitkCommon )
+  set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkBlurImage)
 
   #=========================================================
   option(CLITK_USE_ROOT "Build experimental tools using root" OFF)
   if (CLITK_USE_ROOT)
-    FIND_PACKAGE(ROOT REQUIRED)
+    find_package(ROOT REQUIRED)
     if(ROOT_FOUND)
-      MESSAGE(STATUS "ROOT found : ${ROOT_LIBRARY_DIR} ${ROOT_INCLUDE_DIR} ${ROOT_LIBRARIES}")
-    ELSE(ROOT_FOUND)
-      MESSAGE(FATAL_ERROR
+      message(STATUS "ROOT found : ${ROOT_LIBRARY_DIR} ${ROOT_INCLUDE_DIR} ${ROOT_LIBRARIES}")
+    else(ROOT_FOUND)
+      message(FATAL_ERROR
         "Cannot build without ROOT.  Please set ROOTSYS environement variable.")
     endif(ROOT_FOUND)
-    INCLUDE_DIRECTORIES(${ROOT_INCLUDE_DIR})
-    LINK_DIRECTORIES(${ROOT_LIBRARY_DIR})
+    include_directories(${ROOT_INCLUDE_DIR})
+    link_directories(${ROOT_LIBRARY_DIR})
     WRAP_GGO(clitkMergeRootFiles_GGO_C clitkMergeRootFiles.ggo)
-    ADD_EXECUTABLE(clitkMergeRootFiles clitkMergeRootFiles.cxx GateMergeManager.cc ${clitkMergeRootFiles_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkMergeRootFiles ${ROOT_LIBRARIES})
-    SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMergeRootFiles)
+    add_executable(clitkMergeRootFiles clitkMergeRootFiles.cxx GateMergeManager.cc ${clitkMergeRootFiles_GGO_C})
+    target_link_libraries(clitkMergeRootFiles ${ROOT_LIBRARIES})
+    set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMergeRootFiles)
   endif()
   #=========================================================
 
 
   #=========================================================
-  IF(CLITK_EXPERIMENTAL)
+  if(CLITK_EXPERIMENTAL)
     WRAP_GGO(clitkBinaryImageToMesh_GGO_C clitkBinaryImageToMesh.ggo)
-    ADD_EXECUTABLE(clitkBinaryImageToMesh clitkBinaryImageToMesh.cxx ${clitkBinaryImageToMesh_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkBinaryImageToMesh clitkCommon)
-    SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkBinaryImageToMesh)
+    add_executable(clitkBinaryImageToMesh clitkBinaryImageToMesh.cxx ${clitkBinaryImageToMesh_GGO_C})
+    target_link_libraries(clitkBinaryImageToMesh clitkCommon)
+    set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkBinaryImageToMesh)
 
     WRAP_GGO(clitkMeshToBinaryImage_GGO_C clitkMeshToBinaryImage.ggo)
-    ADD_EXECUTABLE(clitkMeshToBinaryImage clitkMeshToBinaryImage.cxx ${clitkMeshToBinaryImage_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkMeshToBinaryImage clitkCommon)
-    SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMeshToBinaryImage)
+    add_executable(clitkMeshToBinaryImage clitkMeshToBinaryImage.cxx ${clitkMeshToBinaryImage_GGO_C})
+    target_link_libraries(clitkMeshToBinaryImage clitkCommon)
+    set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMeshToBinaryImage)
 
     WRAP_GGO(clitkMeshViewer_GGO_C clitkMeshViewer.ggo)
-    ADD_EXECUTABLE(clitkMeshViewer clitkMeshViewer.cxx ${clitkMeshViewer_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkMeshViewer clitkCommon)
-    SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMeshViewer)
-  ENDIF(CLITK_EXPERIMENTAL)
+    add_executable(clitkMeshViewer clitkMeshViewer.cxx ${clitkMeshViewer_GGO_C})
+    target_link_libraries(clitkMeshViewer clitkCommon)
+    set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMeshViewer)
+  endif(CLITK_EXPERIMENTAL)
   #=========================================================
 
 
   #=========================================================
-  IF(ITK_VERSION_MAJOR VERSION_LESS 4)
-    MESSAGE("clitkDice is not compatible with ITK<4. It will not be built.")
-    MESSAGE("clitkDicomRTPlan2Gate is not compatible with GDCM<2 (ITK<4). It will not be built.")
-  ELSE(ITK_VERSION_MAJOR VERSION_LESS 4)
+  if(ITK_VERSION_MAJOR VERSION_LESS 4)
+    message("clitkDice is not compatible with ITK<4. It will not be built.")
+    message("clitkDicomRTPlan2Gate is not compatible with GDCM<2 (ITK<4). It will not be built.")
+  else(ITK_VERSION_MAJOR VERSION_LESS 4)
     WRAP_GGO(clitkDice_GGO_C clitkDice.ggo)
-    ADD_EXECUTABLE(clitkDice clitkDice.cxx ${clitkDice_GGO_C})
-    TARGET_LINK_LIBRARIES(clitkDice clitkSegmentationGgoLib clitkCommon ${ITK_LIBRARIES} )
-    SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDice)
+    add_executable(clitkDice clitkDice.cxx ${clitkDice_GGO_C})
+    target_link_libraries(clitkDice clitkSegmentationGgoLib clitkCommon ${ITK_LIBRARIES} )
+    set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDice)
 
     WRAP_GGO(clitkDicomRTPlan2Gate_GGO_C clitkDicomRTPlan2Gate.ggo)
-    ADD_EXECUTABLE(clitkDicomRTPlan2Gate clitkDicomRTPlan2Gate.cxx clitkDicomRTPlan2Gate_ggo.c)
-    TARGET_LINK_LIBRARIES(clitkDicomRTPlan2Gate clitkCommon)
-    SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDicomRTPlan2Gate)
-  ENDIF(ITK_VERSION_MAJOR VERSION_LESS 4)
+    add_executable(clitkDicomRTPlan2Gate clitkDicomRTPlan2Gate.cxx clitkDicomRTPlan2Gate_ggo.c)
+    target_link_libraries(clitkDicomRTPlan2Gate clitkCommon)
+    set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDicomRTPlan2Gate)
+  endif(ITK_VERSION_MAJOR VERSION_LESS 4)
   #=========================================================
 
 
-  INSTALL (TARGETS ${TOOLS_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+  install(TARGETS ${TOOLS_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
 
-ENDIF(CLITK_BUILD_TOOLS)
+endif(CLITK_BUILD_TOOLS)
index fe2c787ab850cbc292af77ef19519014b60c76e8..98f8f8fdcaa905309eb5c46aa30e07daa619a340 100644 (file)
@@ -1,6 +1,6 @@
-INCLUDE(../../cmake/common.cmake)
+include(../../cmake/common.cmake)
 
-ADD_LIBRARY(clitkCxImage STATIC
+add_library(clitkCxImage STATIC
     ximaenc.cpp
     ximatran.cpp
     ximath.cpp
@@ -14,5 +14,5 @@ ADD_LIBRARY(clitkCxImage STATIC
     ximasel.cpp
     xmemfile.cpp
     )
-INCLUDE_DIRECTORIES(.)
+include_directories(.)
 
index 7829924967130d20593c54a1795abdb5f0b068ca..49d15b735959fb874ff5465bb64cb6ff07f6d801 100644 (file)
@@ -1,24 +1,24 @@
 # Gengetopt: http://www.gnu.org/software/gengetopt/
 
-ADD_DEFINITIONS(-DPACKAGE=\"gengetopt\")
-ADD_DEFINITIONS(-DVERSION=\"2.22.4\")
-ADD_DEFINITIONS(-DHAVE_SSTREAM)
-ADD_DEFINITIONS(-DHAVE_NAMESPACES)
+add_definitions(-DPACKAGE=\"gengetopt\")
+add_definitions(-DVERSION=\"2.22.4\")
+add_definitions(-DHAVE_SSTREAM)
+add_definitions(-DHAVE_NAMESPACES)
 
 # Remove compiler warnings
-STRING(REPLACE "/W3" "/w" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-STRING(REPLACE "/W3" "/w" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
-STRING(REPLACE "-Wall" "-w" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-STRING(REPLACE "-Wall" "-w" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+string(REPLACE "/W3" "/w" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+string(REPLACE "/W3" "/w" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+string(REPLACE "-Wall" "-w" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+string(REPLACE "-Wall" "-w" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
 
 # MSVC specific issues
-IF(MSVC)
-  ADD_DEFINITIONS(-DHAVE_STRING_H)
-  ADD_DEFINITIONS(-DYY_NO_UNISTD_H)
-  ADD_DEFINITIONS(-Disatty=!)
-ENDIF(MSVC)
+if(MSVC)
+  add_definitions(-DHAVE_STRING_H)
+  add_definitions(-DYY_NO_UNISTD_H)
+  add_definitions(-Disatty=!)
+endif(MSVC)
 
-ADD_EXECUTABLE(gengetopt 
+add_executable(gengetopt
   ./cmdline.c
   ./ggos.cpp
   ./scanner.cc
@@ -64,6 +64,6 @@ ADD_EXECUTABLE(gengetopt
   ./yyerror.cc
   ./parser.cc)
 
-INCLUDE_DIRECTORIES(.)
-INCLUDE_DIRECTORIES(skels)
-#INCLUDE_DIRECTORIES(includes)
+include_directories(.)
+include_directories(skels)
+#include_directories(includes)
index e5e20f97d30f5a5799d8c2e2fef961192e01db77..df4081e5883ac1f69f813e40d278065651842b5d 100644 (file)
@@ -10,7 +10,7 @@ endif(COMMAND cmake_policy)
 
 #=========================================================
 #List of vv tools to compile
-SET(vv_TOOLS
+set(vv_TOOLS
   vvToolMedianFilter
   vvToolRigidReg
   vvToolCropImage
@@ -25,7 +25,7 @@ SET(vv_TOOLS
   # vvToolFoo
   # vvToolFooWithWidgetBase
   # vvToolPlastimatch
-  # vvToolConnectedComponentLabeling  
+  # vvToolConnectedComponentLabeling
   ## these ones are old ones
   # vvToolExtractPatient
   # vvToolExtractLung
@@ -34,42 +34,42 @@ SET(vv_TOOLS
 # dependencies of the tools
 # Future issues : when tool depend on other tools ... how to manage that ?
 #  >> add the relevant $_LIBS variable to the tool that has dependencies?
-SET(vvToolBinarize_LIBS clitkBinarizeImageLib)
-SET(vvToolResample_LIBS clitkResampleImageLib)
-SET(vvToolConvert_LIBS clitkImageConvertLib)
-SET(vvToolExtractPatient_LIBS clitkSegmentationGgoLib)
-SET(vvToolExtractLung_LIBS clitkSegmentationGgoLib)
-SET(vvToolCropImage_LIBS clitkCropImageLib)
-SET(vvToolMIP_LIBS clitkMIPLib)
-SET(vvToolMedianFilter_LIBS clitkMedianImageFilterLib)
-SET(vvToolImageArithm_LIBS clitkImageArithmImageLib)
-SET(vvToolROIManager_LIBS clitkDicomRTStruct)
+set(vvToolBinarize_LIBS clitkBinarizeImageLib)
+set(vvToolResample_LIBS clitkResampleImageLib)
+set(vvToolConvert_LIBS clitkImageConvertLib)
+set(vvToolExtractPatient_LIBS clitkSegmentationGgoLib)
+set(vvToolExtractLung_LIBS clitkSegmentationGgoLib)
+set(vvToolCropImage_LIBS clitkCropImageLib)
+set(vvToolMIP_LIBS clitkMIPLib)
+set(vvToolMedianFilter_LIBS clitkMedianImageFilterLib)
+set(vvToolImageArithm_LIBS clitkImageArithmImageLib)
+set(vvToolROIManager_LIBS clitkDicomRTStruct)
 
 #=========================================================
 # List of vv source files
 
 # in COMMON_WITH_UI -> must have .h and .cxx and .ui
-SET(vv_COMMON_WITH_UI
+set(vv_COMMON_WITH_UI
   vvInfoPanel
-  vvMainWindow 
-  vvLinkPanel 
-  vvOverlayPanel 
-  vvLandmarksPanel 
-  vvProgressDialog 
+  vvMainWindow
+  vvLinkPanel
+  vvOverlayPanel
+  vvLandmarksPanel
+  vvProgressDialog
   vvSegmentationDialog
   vvSurfaceViewerDialog
   vvDeformationDialog
   vvStructSelector
   vvIntensityValueSlider
   vvLabelImageLoaderWidget
-  vvToolWidgetBase  
+  vvToolWidgetBase
   vvToolSimpleInputSelectorWidget
   vvToolInputSelectorWidget
   vvRegisterForm
 )
 
 # All others sources
-SET(vv_SRCS
+set(vv_SRCS
   vvQProgressDialogITKCommand.cxx
   vvQDicomSeriesSelector.cxx
   QTreePushButton.cxx
@@ -106,26 +106,26 @@ SET(vv_SRCS
 
 #=========================================================
 # Qt related commands
-FIND_PACKAGE(Qt4 REQUIRED)
-LINK_DIRECTORIES(${QT_LIBRARY_DIR})
+find_package(Qt4 REQUIRED)
+link_directories(${QT_LIBRARY_DIR})
 
 
-QT4_WRAP_CPP(vv_SRCS 
-  vvMainWindowBase.h 
-  QTreePushButton.h 
-  vvDocumentation.h  
-  vvHelpDialog.h  
-  vvQDicomSeriesSelector.h 
+QT4_WRAP_CPP(vv_SRCS
+  vvMainWindowBase.h
+  QTreePushButton.h
+  vvDocumentation.h
+  vvHelpDialog.h
+  vvQDicomSeriesSelector.h
   vvSlicerManager.h
   vvStructureSetActor.h
   vvROIActor.h
   vvToolCreatorBase.h
   )
 
-QT4_WRAP_UI(vv_UI_CXX 
-  qt_ui/vvHelpDialog.ui 
-  qt_ui/vvDocumentation.ui 
-  qt_ui/vvDicomSeriesSelector.ui 
+QT4_WRAP_UI(vv_UI_CXX
+  qt_ui/vvHelpDialog.ui
+  qt_ui/vvDocumentation.ui
+  qt_ui/vvDicomSeriesSelector.ui
   qt_ui/vvDummyWindow.ui #For testing
   )
 
@@ -136,42 +136,42 @@ QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc)
 if(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
   file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
   foreach(tool ${vv_TOOLS})
-    FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "#include \"${tool}.h\"\n")
-    FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "extern const vvToolCreator<${tool}> *dummy${tool};\n")
-    FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "const vvToolCreator<${tool}> *dummy${tool}2 = dummy${tool};\n\n")
+    file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "#include \"${tool}.h\"\n")
+    file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "extern const vvToolCreator<${tool}> *dummy${tool};\n")
+    file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "const vvToolCreator<${tool}> *dummy${tool}2 = dummy${tool};\n\n")
   endforeach(tool)
 endif(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
 
 # Add the autotools and the common files ui
 foreach(tool ${vv_TOOLS} ${vv_COMMON_WITH_UI})
-    SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
+    set(vv_SRCS ${vv_SRCS} ${tool}.cxx)
     QT4_WRAP_CPP(vv_SRCS ${tool}.h)
     QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
 endforeach(tool)
 
 # Add the common source files
 foreach(tool ${vv_COMMON})
-    SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
+    set(vv_SRCS ${vv_SRCS} ${tool}.cxx)
     QT4_WRAP_CPP(vv_SRCS ${tool}.h)
 endforeach(tool)
 
 # if Windows and Qt was built as a static lib then don't set QT_DLL flag
-SET(QT_STATIC 0)
-IF (WIN32)
-  IF(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl)
-    FILE(READ ${QT_LIBRARY_DIR}/QtCore.prl QT_CORE_PRL)
-    IF(${QT_CORE_PRL} MATCHES "static")
-      SET(QT_STATIC 1)
-    ENDIF(${QT_CORE_PRL} MATCHES "static")
-  ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl)
-ENDIF(WIN32)
-IF(NOT QT_STATIC)
-  ADD_DEFINITIONS(-DQT_DLL)
-ENDIF(NOT QT_STATIC)
+set(QT_STATIC 0)
+if(WIN32)
+  if(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl)
+    file(READ ${QT_LIBRARY_DIR}/QtCore.prl QT_CORE_PRL)
+    if(${QT_CORE_PRL} MATCHES "static")
+      set(QT_STATIC 1)
+    endif(${QT_CORE_PRL} MATCHES "static")
+  endif(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl)
+endif(WIN32)
+if(NOT QT_STATIC)
+  add_definitions(-DQT_DLL)
+endif(NOT QT_STATIC)
 
-ADD_DEFINITIONS(-DQT_THREAD_SUPPORT)
+add_definitions(-DQT_THREAD_SUPPORT)
 
-INCLUDE_DIRECTORIES(
+include_directories(
   ${QT_INCLUDES}
   ${QT_INCLUDE_DIR}
   ${QT_QTGUI_INCLUDE_DIR}
@@ -183,15 +183,15 @@ INCLUDE_DIRECTORIES(
 
 #=========================================================
 #support for parallel deformable registration with OpenMP
-IF(NOT APPLE)
-IF(CMAKE_COMPILER_IS_GNUCC)
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
-ENDIF(CMAKE_COMPILER_IS_GNUCC)
-ENDIF(NOT APPLE)
+if(NOT APPLE)
+if(CMAKE_COMPILER_IS_GNUCC)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
+endif(CMAKE_COMPILER_IS_GNUCC)
+endif(NOT APPLE)
 #=========================================================
 
 #=========================================================
-INCLUDE_DIRECTORIES(
+include_directories(
   ../common
   ../tools
   ../segmentation
@@ -200,22 +200,22 @@ INCLUDE_DIRECTORIES(
 #=========================================================
 #Add each tool's dependencies
 foreach(tool ${vv_TOOLS})
-  SET(toolLibs ${toolLibs} ${${tool}_LIBS})
+  set(toolLibs ${toolLibs} ${${tool}_LIBS})
 endforeach(tool)
 
 #=========================================================
 #Add Foundation Libraries (this should be after our libraries, since we depend
 #on them)
-SET(foundationLibraries clitkCommon ${ITK_LIBRARIES} QVTK vtkHybrid)
+set(foundationLibraries clitkCommon ${ITK_LIBRARIES} QVTK vtkHybrid)
 
 #=========================================================
 # Use CxImage to create animated gifs
-IF(CLITK_EXPERIMENTAL)
-  SET(vvCxImage clitkCxImage)
-  SET(vv_SRCS ${vv_SRCS} vvAnimatedGIFWriter.cxx)
-  INCLUDE_DIRECTORIES(${CLITK_SOURCE_DIR}/utilities/CxImage)
-  ADD_SUBDIRECTORY(${CLITK_SOURCE_DIR}/utilities/CxImage ${PROJECT_BINARY_DIR}/utilities/CxImage)
-ENDIF(CLITK_EXPERIMENTAL)
+if(CLITK_EXPERIMENTAL)
+  set(vvCxImage clitkCxImage)
+  set(vv_SRCS ${vv_SRCS} vvAnimatedGIFWriter.cxx)
+  include_directories(${CLITK_SOURCE_DIR}/utilities/CxImage)
+  add_subdirectory(${CLITK_SOURCE_DIR}/utilities/CxImage ${PROJECT_BINARY_DIR}/utilities/CxImage)
+endif(CLITK_EXPERIMENTAL)
 #=========================================================
 
 #-----------------------------------------------------------------------------
@@ -223,12 +223,12 @@ ENDIF(CLITK_EXPERIMENTAL)
 # See http://wiki.finkproject.org/index.php/Fink:Packaging:Preparing_for_10.5#OpenGL_Bug
 #
 if(APPLE)
-  FIND_LIBRARY(CoreFoundation_LIBRARY CoreFoundation REQUIRED)
-  FIND_LIBRARY(ApplicationServices_LIBRARY ApplicationServices REQUIRED)
-  FIND_LIBRARY(SystemConfiguration_LIBRARY SystemConfiguration REQUIRED)
-  FIND_LIBRARY(Security_LIBRARY Security REQUIRED)
-  set(APPLE_FRAMEWORKS ${CoreFoundation_LIBRARY} 
-    ${ApplicationServices_LIBRARY} 
+  find_library(CoreFoundation_LIBRARY CoreFoundation REQUIRED)
+  find_library(ApplicationServices_LIBRARY ApplicationServices REQUIRED)
+  find_library(SystemConfiguration_LIBRARY SystemConfiguration REQUIRED)
+  find_library(Security_LIBRARY Security REQUIRED)
+  set(APPLE_FRAMEWORKS ${CoreFoundation_LIBRARY}
+    ${ApplicationServices_LIBRARY}
     ${SystemConfiguration_LIBRARY}
     ${Security_LIBRARY}
     )
@@ -236,66 +236,66 @@ if(APPLE)
 endif()
 #=========================================================
 #Create binary and libs for tests
-SET(vvExternalLibs clitkSegmentationGgoLib ${toolLibs} ${foundationLibraries} ${vvCxImage} ${QT_LIBRARIES} ${QT_QTNETWORK_LIBRARY} ${APPLE_FRAMEWORKS})
+set(vvExternalLibs clitkSegmentationGgoLib ${toolLibs} ${foundationLibraries} ${vvCxImage} ${QT_LIBRARIES} ${QT_QTNETWORK_LIBRARY} ${APPLE_FRAMEWORKS})
 # QtNetwork is required by vvRegisterForm
 
-ADD_LIBRARY(vvLib ${vv_SRCS} ${vv_UI_CXX})
-TARGET_LINK_LIBRARIES(vvLib ${vvExternalLibs})
+add_library(vvLib ${vv_SRCS} ${vv_UI_CXX})
+target_link_libraries(vvLib ${vvExternalLibs})
 
-IF(WIN32)
-  ADD_EXECUTABLE(vv WIN32 vv.cxx vvIcon.rc)
-ELSE(WIN32)
-  ADD_EXECUTABLE(vv vv.cxx)
-ENDIF(WIN32)
+if(WIN32)
+  add_executable(vv WIN32 vv.cxx vvIcon.rc)
+else(WIN32)
+  add_executable(vv vv.cxx)
+endif(WIN32)
 
-TARGET_LINK_LIBRARIES(vv vvLib)
+target_link_libraries(vv vvLib)
 
 #=========================================================
 # Install options (also used by CPack)
-INSTALL (TARGETS vv DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
+install(TARGETS vv DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
 
 #=========================================================
 
 #=========================================================
 # CPack options
-SET(CPACK_PACKAGE_NAME "vv")
-SET(CPACK_SOURCE_PACKAGE_FILE_NAME "vv-src")
-SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "vv, the 4D slicer : let's jump into a new dimension !")
-SET(CPACK_PACKAGE_VENDOR "Creatis-CLB")
-SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
-SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
-SET(CPACK_PACKAGE_VERSION_MAJOR "1")
-SET(CPACK_PACKAGE_VERSION_MINOR "3")
-SET(CPACK_PACKAGE_VERSION_PATCH "0")
-IF(NIGHTLY)
-  SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vv-nightly")
-ELSE(NIGHTLY)
-  SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vv")
-ENDIF(NIGHTLY)
-SET(CPACK_STRIP_FILES TRUE)
+set(CPACK_PACKAGE_NAME "vv")
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "vv-src")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "vv, the 4D slicer : let's jump into a new dimension !")
+set(CPACK_PACKAGE_VENDOR "Creatis-CLB")
+set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+set(CPACK_PACKAGE_VERSION_MAJOR "1")
+set(CPACK_PACKAGE_VERSION_MINOR "3")
+set(CPACK_PACKAGE_VERSION_PATCH "0")
+if(NIGHTLY)
+  set(CPACK_PACKAGE_INSTALL_DIRECTORY "vv-nightly")
+else(NIGHTLY)
+  set(CPACK_PACKAGE_INSTALL_DIRECTORY "vv")
+endif(NIGHTLY)
+set(CPACK_STRIP_FILES TRUE)
 
-IF(WIN32)
+if(WIN32)
   # There is a bug in NSI that does not handle full unix paths properly. Make
   # sure there is at least one set of four (4) backlasshes.
-  SET(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\icons\\\\ducky.ico")
-  SET(CPACK_NSIS_INSTALLED_ICON_NAME "vv.exe")
-IF(NIGHTLY)
-  SET(CPACK_NSIS_DISPLAY_NAME "vv - The 4D slicer (nightly)")
-ELSE(NIGHTLY)
-  SET(CPACK_NSIS_DISPLAY_NAME "vv - The 4D slicer")
-ENDIF(NIGHTLY)
-  SET(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/rio/vv")
-  SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/rio")
-  SET(CPACK_NSIS_CONTACT "vv@creatis.insa-lyon.fr")
-  SET(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\vv.lnk\\\" \\\"$INSTDIR\\\\bin\\\\vv.exe\\\" ")
-  SET(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\vv.lnk\\\" ")
-  #SET(CPACK_NSIS_MODIFY_PATH ON) SR: buggy, wait for cmake updates for a fix
-  #SET(CPACK_BINARY_ZIP ON)
-ELSE(WIN32)
-  SET(CPACK_GENERATOR "STGZ")
-  SET(CPACK_SOURCE_GENERATOR "TGZ") 
-ENDIF(WIN32)
-INCLUDE(CPack)
+  set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\icons\\\\ducky.ico")
+  set(CPACK_NSIS_INSTALLED_ICON_NAME "vv.exe")
+if(NIGHTLY)
+  set(CPACK_NSIS_DISPLAY_NAME "vv - The 4D slicer (nightly)")
+else(NIGHTLY)
+  set(CPACK_NSIS_DISPLAY_NAME "vv - The 4D slicer")
+endif(NIGHTLY)
+  set(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/rio/vv")
+  set(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/rio")
+  set(CPACK_NSIS_CONTACT "vv@creatis.insa-lyon.fr")
+  set(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\vv.lnk\\\" \\\"$INSTDIR\\\\bin\\\\vv.exe\\\" ")
+  set(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\vv.lnk\\\" ")
+  #set(CPACK_NSIS_MODIFY_PATH ON) SR: buggy, wait for cmake updates for a fix
+  #set(CPACK_BINARY_ZIP ON)
+else(WIN32)
+  set(CPACK_GENERATOR "STGZ")
+  set(CPACK_SOURCE_GENERATOR "TGZ")
+endif(WIN32)
+include(CPack)
 #=========================================================
 #=========================================================
 configure_file(vvConfiguration.h.in vvConfiguration.h)