diff --git a/CMake/External_GDAL.cmake b/CMake/External_GDAL.cmake
index 9530a7439fa5e38ec5730c7894a30c9023d295fa..5aa964a04f8a84f66382883e91a9caae17663ac9 100644
--- a/CMake/External_GDAL.cmake
+++ b/CMake/External_GDAL.cmake
@@ -10,10 +10,7 @@ mark_as_advanced(USE_SYSTEM_GDAL)
 if(USE_SYSTEM_GDAL)
   message(STATUS "  Using GDAL system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(GDAL_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(GDAL_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
-  set(GDAL_SB_CONFIG)
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   if(USE_SYSTEM_TIFF)
     if(NOT SYSTEM_TIFF_PREFIX STREQUAL "")
diff --git a/CMake/External_ITK.cmake b/CMake/External_ITK.cmake
index 44db3b8bc68ec554c241142e2e8dbcdc4b7a5408..073950ac962636618ba406edaaaf817bd44f40ec 100644
--- a/CMake/External_ITK.cmake
+++ b/CMake/External_ITK.cmake
@@ -11,14 +11,11 @@ mark_as_advanced(USE_SYSTEM_ITK)
 if(USE_SYSTEM_ITK)
   message(STATUS "  Using ITK system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(ITK_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(ITK_SB_SRC_DIR ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
-  set(ITK_SB_CONFIG)
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   # if(MSVC)
-    # set(ITK_SB_SRC_DIR "C:/Temp/ITK")
-    # set(ITK_SB_BUILD_DIR ${ITK_SB_SRC_DIR}/build)
+    # set(ITK_SB_SRC "C:/Temp/ITK")
+    # set(ITK_SB_BUILD_DIR ${ITK_SB_SRC}/build)
   # endif()
   
   set(ITK_ENABLED_MODULES
@@ -165,7 +162,7 @@ else()
     PREFIX ${proj}
     URL "http://sourceforge.net/projects/itk/files/itk/4.6/InsightToolkit-4.6.1.tar.gz/download"
     URL_MD5 2c84eae50ab2452cdad32aaadced3c37
-    SOURCE_DIR ${ITK_SB_SRC_DIR}
+    SOURCE_DIR ${ITK_SB_SRC}
     BINARY_DIR ${ITK_SB_BUILD_DIR}
     INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
     CMAKE_CACHE_ARGS
@@ -186,14 +183,14 @@ else()
       ${ITK_SB_CONFIG}
     PATCH_COMMAND ${CMAKE_COMMAND} -E copy 
       ${CMAKE_SOURCE_DIR}/patches/ITK/hashtable.hxx.in
-      ${ITK_SB_SRC_DIR}/Modules/ThirdParty/KWSys/src/KWSys
+      ${ITK_SB_SRC}/Modules/ThirdParty/KWSys/src/KWSys
     DEPENDS ${${proj}_DEPENDENCIES}
     )
   
   # write patch in binary dir
   #file(WRITE ${CMAKE_BINARY_DIR}/itk_patch_1.cmake 
   #  "configure_file(${CMAKE_SOURCE_DIR}/patches_ITK/hashtable.hxx.in 
-  #   ${ITK_SB_SRC_DIR}/Modules/ThirdParty/KWSys/src/KWSys/hashtable.hxx.in COPYONLY)")
+  #   ${ITK_SB_SRC}/Modules/ThirdParty/KWSys/src/KWSys/hashtable.hxx.in COPYONLY)")
   
   message(STATUS "  Using ITK SuperBuild version")
 endif()
diff --git a/CMake/External_OpenCV.cmake b/CMake/External_OpenCV.cmake
index 5fad02a21b44b35d11ed5919176922e00514cf19..085e606652b076278edc4fd6a6b0c669c475e95d 100644
--- a/CMake/External_OpenCV.cmake
+++ b/CMake/External_OpenCV.cmake
@@ -10,9 +10,7 @@ mark_as_advanced(USE_SYSTEM_OPENCV)
 if(USE_SYSTEM_OPENCV)
   message(STATUS "  Using OpenCV system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(OPENCV_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(OPENCV_SB_SRC_DIR ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   #TODO: add these properly
   # list(APPEND ${proj}_DEPENDENCIES TIFF)
diff --git a/CMake/External_OpenJpeg.cmake b/CMake/External_OpenJpeg.cmake
index 10e463f3ac379966e62e5ed1c38dc10d1885651b..b9558c7ca5f3ba9101a868c2f4183b5d6bbf28b0 100644
--- a/CMake/External_OpenJpeg.cmake
+++ b/CMake/External_OpenJpeg.cmake
@@ -10,15 +10,12 @@ mark_as_advanced(USE_SYSTEM_OPENJPEG)
 if(USE_SYSTEM_OPENJPEG)
   message(STATUS "  Using OpenJpeg system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(OPENJPEG_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(OPENJPEG_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
-  set(${proj}_ADDITIONAL_CACHE)
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   # handle dependencies : TIFF, ZLIB, ...
   # although they seem un-used by the openjp2 codec
   if(USE_SYSTEM_TIFF)
-    list(APPEND ${proj}_ADDITIONAL_CACHE ${SYSTEM_TIFF_CMAKE_CACHE})
+    list(APPEND OPENJPEG_SB_CONFIG ${SYSTEM_TIFF_CMAKE_CACHE})
   else()
     list(APPEND ${proj}_DEPENDENCIES TIFF)
   endif()
@@ -52,7 +49,7 @@ else()
         -DBUILD_TESTING:BOOL=OFF
         -DBUILD_THIRDPARTY:BOOL=OFF
         -DCMAKE_PREFIX_PATH:STRING=${CMAKE_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
-        ${OPENJPEG_ADDITIONAL_CACHE}
+        ${OPENJPEG_SB_CONFIG}
         DEPENDS ${${proj}_DEPENDENCIES}
         CMAKE_COMMAND ${SB_CMAKE_COMMAND}
     )
diff --git a/CMake/External_OpenThreads.cmake b/CMake/External_OpenThreads.cmake
index f532a7811d909ca66024a6f67bf0812514196b67..625dcbc71c882c6ba79ae09312b019af9d1a8c9a 100644
--- a/CMake/External_OpenThreads.cmake
+++ b/CMake/External_OpenThreads.cmake
@@ -14,9 +14,7 @@ endif()
 if(USE_SYSTEM_OPENTHREADS)
   message(STATUS "  Using OpenThread system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(OPENTHREADS_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(OPENTHREADS_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   #TODO: try to use cmake variable for DOWNLOAD_COMMAND for different platforms
   if(MSVC)
diff --git a/CMake/External_SQLite.cmake b/CMake/External_SQLite.cmake
index 9d35e17bfb8007492533107210074c16a2976d77..9e3efbb5cce3d6c7ae7fa3f27004573c311f7b86 100644
--- a/CMake/External_SQLite.cmake
+++ b/CMake/External_SQLite.cmake
@@ -10,9 +10,7 @@ mark_as_advanced(USE_SYSTEM_SQLITE)
 if(USE_SYSTEM_SQLITE)
   message(STATUS "  Using SQLite system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(SQLITE_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(SQLITE_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   if(UNIX)
     ExternalProject_Add(${proj}
@@ -56,4 +54,4 @@ else()
   
   
   message(STATUS "  Using SQLite SuperBuild version")
-endif()
\ No newline at end of file
+endif()
diff --git a/CMake/External_TinyXML.cmake b/CMake/External_TinyXML.cmake
index afbee2ff49100bad60cab697b79a27611bf56157..5727fdb06ddd888c8497177ad0318c395424085d 100644
--- a/CMake/External_TinyXML.cmake
+++ b/CMake/External_TinyXML.cmake
@@ -10,9 +10,7 @@ mark_as_advanced(USE_SYSTEM_TINYXML)
 if(USE_SYSTEM_TINYXML)
   message(STATUS "  Using TinyXML system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(TINYXML_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(TINYXML_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   ExternalProject_Add(${proj}
     PREFIX ${proj}
@@ -31,4 +29,4 @@ else()
     )
   
   message(STATUS "  Using TinyXML SuperBuild version")
-endif()
\ No newline at end of file
+endif()
diff --git a/CMake/External_curl.cmake b/CMake/External_curl.cmake
index 72e75e2b5613d4f14e124132a4e10e1187f58d3f..22d969b7bc31ab7e6a5ce6e8f4a52dd23d9f5b17 100644
--- a/CMake/External_curl.cmake
+++ b/CMake/External_curl.cmake
@@ -10,9 +10,7 @@ mark_as_advanced(USE_SYSTEM_CURL)
 if(USE_SYSTEM_CURL)
   message(STATUS "  Using cURL system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(CURL_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
-  set(CURL_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
+  SETUP_SUPERBUILD(PROJECT ${proj})
     
   if(USE_SYSTEM_ZLIB)
     set(CURL_SB_ZLIB_CONFIG)
diff --git a/CMake/External_expat.cmake b/CMake/External_expat.cmake
index aed174269548cb87f25b86261efac37758eb6a32..33139db1c731a815332686c037947ae7fc3e2152 100644
--- a/CMake/External_expat.cmake
+++ b/CMake/External_expat.cmake
@@ -10,9 +10,7 @@ mark_as_advanced(USE_SYSTEM_EXPAT)
 if(USE_SYSTEM_EXPAT)
   message(STATUS "  Using expat system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(EXPAT_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(EXPAT_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   ExternalProject_Add(${proj}
     PREFIX ${proj}
@@ -32,4 +30,4 @@ else()
     
   message(STATUS "  Using Expat SuperBuild version")
 
-endif()
\ No newline at end of file
+endif()
diff --git a/CMake/External_fftw.cmake b/CMake/External_fftw.cmake
index ef325df5c3f00926764f7dad737f23195364c465..53a85397bb7f141db399cdd2c08d412f62a855d5 100644
--- a/CMake/External_fftw.cmake
+++ b/CMake/External_fftw.cmake
@@ -10,7 +10,7 @@ mark_as_advanced(USE_SYSTEM_FFTW)
 if(USE_SYSTEM_FFTW)
   message(STATUS "  Using FFTW system version")
 else()
-  set(${proj}_DEPENDENCIES)
+  SETUP_SUPERBUILD(PROJECT ${proj})
   set(projFloat ${proj}F)
   set(projDouble ${proj}D)
   
@@ -74,4 +74,4 @@ else()
   
 
 
-endif()
\ No newline at end of file
+endif()
diff --git a/CMake/External_geos.cmake b/CMake/External_geos.cmake
index e3a746b769b852df7809226de16dd4f4a353cfa7..0fdc349d1a9de240949ecd1b3866d0790d8503c2 100644
--- a/CMake/External_geos.cmake
+++ b/CMake/External_geos.cmake
@@ -10,9 +10,7 @@ mark_as_advanced(USE_SYSTEM_GEOS)
 if(USE_SYSTEM_GEOS)
   message(STATUS "  Using GEOS system version")
 else()
-  
-  set(GEOS_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(GEOS_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
 
   ExternalProject_Add(${proj}
     PREFIX ${proj}
diff --git a/CMake/External_geotiff.cmake b/CMake/External_geotiff.cmake
index 0764c99db9f650dcf9e86008e563e29fdd0462d0..99e2f2686d07b65033bf76e532b6641d4673a6fb 100644
--- a/CMake/External_geotiff.cmake
+++ b/CMake/External_geotiff.cmake
@@ -10,10 +10,7 @@ mark_as_advanced(USE_SYSTEM_GEOTIFF)
 if(USE_SYSTEM_GEOTIFF)
   message(STATUS "  Using libgeotiff system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(GEOTIFF_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(GEOTIFF_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
-  set(GEOTIFF_SB_CONFIG)
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   # handle dependencies : TIFF Proj4 Zlib Jpeg
   if(USE_SYSTEM_TIFF)
diff --git a/CMake/External_jpeg.cmake b/CMake/External_jpeg.cmake
index 0fdf70eaad0e1b7fb8afb94c1edeee626128d80a..348fd9e5d14ce780abe2cbebdde32f7f4ea46dc4 100644
--- a/CMake/External_jpeg.cmake
+++ b/CMake/External_jpeg.cmake
@@ -10,9 +10,7 @@ mark_as_advanced(USE_SYSTEM_JPEG)
 if(USE_SYSTEM_JPEG)
   message(STATUS "  Using libjpeg system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(JPEG_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(JPEG_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   if(WIN32)
       
diff --git a/CMake/External_libKML.cmake b/CMake/External_libKML.cmake
index a44aba50b5b2b9a907bb352c5dcaaa39c461ce1e..aa4d67d280542303b0f898a45a84bc28471d0a03 100644
--- a/CMake/External_libKML.cmake
+++ b/CMake/External_libKML.cmake
@@ -10,9 +10,7 @@ mark_as_advanced(USE_SYSTEM_LIBKML)
 if(USE_SYSTEM_LIBKML)
   message(STATUS "  Using libKML system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(LIBKML_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(LIBKML_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   if(USE_SYSTEM_EXPAT)
     set(LIBKML_SB_EXPAT_CONFIG)
diff --git a/CMake/External_libpng.cmake b/CMake/External_libpng.cmake
index 5591baa47bdd91fbd6b28f719644513c40a38640..c1a1169872943936fea10c7976fe9771ed35da35 100644
--- a/CMake/External_libpng.cmake
+++ b/CMake/External_libpng.cmake
@@ -10,9 +10,7 @@ mark_as_advanced(USE_SYSTEM_PNG)
 if(USE_SYSTEM_PNG)
   message(STATUS "  Using libtiff system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(PNG_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(PNG_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   if(USE_SYSTEM_ZLIB)
     set(PNG_SB_ZLIB_CONFIG)
diff --git a/CMake/External_muParser.cmake b/CMake/External_muParser.cmake
index 4fc1b6345c125ba28a2951afd695a201602e9d9f..12fb0526fbf76a84c7dfb94724e2693ad9514152 100644
--- a/CMake/External_muParser.cmake
+++ b/CMake/External_muParser.cmake
@@ -10,9 +10,7 @@ mark_as_advanced(USE_SYSTEM_MUPARSER)
 if(USE_SYSTEM_MUPARSER)
   message(STATUS "  Using muParser system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(MUPARSER_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(MUPARSER_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   ExternalProject_Add(${proj}
     PREFIX ${proj}
diff --git a/CMake/External_muParserX.cmake b/CMake/External_muParserX.cmake
index d297cd1f682e8d5df74411a1d80c9ef9f4917d8e..de3a0638ebd49b38bd0136e39eda1b54fc254795 100644
--- a/CMake/External_muParserX.cmake
+++ b/CMake/External_muParserX.cmake
@@ -10,9 +10,7 @@ mark_as_advanced(USE_SYSTEM_MUPARSERX)
 if(USE_SYSTEM_MUPARSERX)
   message(STATUS "  Using muParserX system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(MUPARSERX_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(MUPARSERX_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   # svn checkout http://muparserx.googlecode.com/svn/trunk/ muparserx-read-only
   
diff --git a/CMake/External_ossim.cmake b/CMake/External_ossim.cmake
index ca1dfad3ff3589c0ee16a32e947d0b85b920fd5f..bec94c6c11a163b457dd528d26851cedf1d49403 100644
--- a/CMake/External_ossim.cmake
+++ b/CMake/External_ossim.cmake
@@ -17,10 +17,7 @@ ADD_SYSTEM_LOCATION(PROJECT ${proj} VARIABLES ${proj}_LIBRARY ${proj}_INCLUDE_DI
 if(USE_SYSTEM_OSSIM)
   message(STATUS "  Using OSSIM system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(OSSIM_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(OSSIM_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
-  set(OSSIM_SB_CONFIG)
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   # set project dependencies (GEOS, GDAL, TIFF, JPEG, OPENTHREADS, )
   if(USE_SYSTEM_TIFF)
diff --git a/CMake/External_pcre.cmake b/CMake/External_pcre.cmake
index cf045a3de71e5f3e5079c4806bcdecbd921b2a9a..29ec1081fc058f8a3782de07127762518da8c1a2 100644
--- a/CMake/External_pcre.cmake
+++ b/CMake/External_pcre.cmake
@@ -10,9 +10,7 @@ mark_as_advanced(USE_SYSTEM_PCRE)
 if(USE_SYSTEM_PCRE)
   message(STATUS "  Using pcre system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(PCRE_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(PCRE_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   if(MSVC)
     # TODO ?
diff --git a/CMake/External_proj4.cmake b/CMake/External_proj4.cmake
index 794e9a69b43f2e8160d5252bb52ff2e2b1a1084c..a365d2a6be9619cf51b99cdeffd2039f15d7f8b8 100644
--- a/CMake/External_proj4.cmake
+++ b/CMake/External_proj4.cmake
@@ -10,9 +10,7 @@ mark_as_advanced(USE_SYSTEM_PROJ)
 if(USE_SYSTEM_PROJ)
   message(STATUS "  Using Proj4 system version")
 else()
-  
-  set(PROJ_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(PROJ_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   if(MSVC)
 
diff --git a/CMake/External_qt4.cmake b/CMake/External_qt4.cmake
index e8e48e2e6930a854bc9f83cfff72a62b105d687f..1c495cea6a36e523e48ed59b2cac6a589a602d7f 100644
--- a/CMake/External_qt4.cmake
+++ b/CMake/External_qt4.cmake
@@ -10,9 +10,7 @@ mark_as_advanced(USE_SYSTEM_QT4)
 if(USE_SYSTEM_QT4)
   message(STATUS "  Using Qt4 system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(QT4_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(QT4_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   if(NOT DEFINED git_protocol)
     set(git_protocol "git")
@@ -63,4 +61,4 @@ else()
 
   message(STATUS "  Using Qt4 SuperBuild version")
 
-endif()
\ No newline at end of file
+endif()
diff --git a/CMake/External_swig.cmake b/CMake/External_swig.cmake
index 6ea199f615bffd66c42d403986ffac78a141ee2d..7eb30ae22d68026cf6383dfcf366e7cba838b133 100644
--- a/CMake/External_swig.cmake
+++ b/CMake/External_swig.cmake
@@ -10,10 +10,7 @@ mark_as_advanced(USE_SYSTEM_SWIG)
 if(USE_SYSTEM_SWIG)
   message(STATUS "  Using swig system version")
 else()
-  set(${proj}_DEPENDENCIES)
-  set(SWIG_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(SWIG_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
-  set(SWIG_SB_CONFIG_CACHE)
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   set(PythonInterp_FIND_VERSION 2.7)
   find_package(PythonInterp)
@@ -49,14 +46,14 @@ else()
     if(USE_SYSTEM_PCRE)
       # TODO : handle specific location
     else()
-      list(APPEND SWIG_SB_CONFIG_CACHE --with-pcre-prefix=${CMAKE_INSTALL_PREFIX})
+      list(APPEND SWIG_SB_CONFIG --with-pcre-prefix=${CMAKE_INSTALL_PREFIX})
       list(APPEND ${proj}_DEPENDENCIES PCRE)
     endif()
     
     if(USE_SYSTEM_BOOST)
       # TODO : handle specific location
     else()
-      list(APPEND SWIG_SB_CONFIG_CACHE --with-boost=${CMAKE_INSTALL_PREFIX})
+      list(APPEND SWIG_SB_CONFIG --with-boost=${CMAKE_INSTALL_PREFIX})
       list(APPEND ${proj}_DEPENDENCIES BOOST)
     endif()
     
@@ -71,7 +68,7 @@ else()
         --prefix=${CMAKE_INSTALL_PREFIX}
         ${SWIG_SB_PYTHON_CONFIG}
         ${SWIG_SB_JAVA_CONFIG}
-        ${SWIG_SB_CONFIG_CACHE}
+        ${SWIG_SB_CONFIG}
       BUILD_COMMAND $(MAKE)
       INSTALL_COMMAND $(MAKE) install
       DEPENDS ${${proj}_DEPENDENCIES}
diff --git a/CMake/External_zlib.cmake b/CMake/External_zlib.cmake
index 136757ff75eb0cd91e048db0405fd8f08da1c4a0..9250917c22fc36cad192a54e8804d5fc90def3e9 100644
--- a/CMake/External_zlib.cmake
+++ b/CMake/External_zlib.cmake
@@ -11,9 +11,7 @@ ADD_SYSTEM_PREFIX(PROJECT ${proj} CMAKE_ALIAS ZLIB_ROOT)
 if(USE_SYSTEM_ZLIB)
   message(STATUS "  Using Zlib system version")
 else()
-  
-  set(ZLIB_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
-  set(ZLIB_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
+  SETUP_SUPERBUILD(PROJECT ${proj})
   
   # Try official release 1.2.8
   ExternalProject_Add(${proj}