Improve cmake and add core revision based on git history