diff --git a/Code/Wrappers/SWIG/CMakeLists.txt b/Code/Wrappers/SWIG/CMakeLists.txt
index eb2ae26e93edd1499756f63a47d4a77e44d3629a..07b663a6d8a15829c7a0b561184719a2e541644e 100644
--- a/Code/Wrappers/SWIG/CMakeLists.txt
+++ b/Code/Wrappers/SWIG/CMakeLists.txt
@@ -8,14 +8,12 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
 SET(CMAKE_SWIG_FLAGS "")
 
 FILE(GLOB swigfiles "*.i")
-
 FOREACH(swigfile ${swigfiles})
-
     SET_SOURCE_FILES_PROPERTIES(${swigfile} PROPERTIES CPLUSPLUS ON)
     SET_SOURCE_FILES_PROPERTIES(${swigfile} PROPERTIES SWIG_FLAGS "-includeall")
-
 ENDFOREACH(swigfile ${swigfiles})
 
-# TODO: add build dependency with the macro files
-SWIG_ADD_MODULE(otbApplication python otbApplication.i)
+set(SWIG_MODULE_otbApplication_EXTRA_DEPS itkBase.i itkMacro.i RefCountMacro.i)
+
+SWIG_ADD_MODULE(otbApplication python otbApplication.i )
 SWIG_LINK_LIBRARIES(otbApplication ${PYTHON_LIBRARIES} OTBWrapperCore)