Cmake: Create VERSION file in topdirectory when building

Travis S3 upload (to build the server) gets the VERSION from there.
There is no way to just ask cmake to get a variables content, so this is the easiest way for now.