Moves temp files to CURRENT_BINARY_DIR.
Uses CMAKE_BINARY_DIR instead of CMAKE_SOURCE_DIR for template.
Merge pull request #4956 from dumganhar/move-temp-obj

Uses CMAKE_BINARY_DIR instead of CMAKE_SOURCE_DIR, all temporary files will be in 'build'  folder.