Added config of Xcode templates according to CMAKE_OSX_ARCHITECTURES
Improved CMake script

 * Instead of configuring Xcode templates directly to /Library the files are first saved in CMAKE_CURRENT_BINARY_DIR
 * This avoid running CMake as root on some systems