I would like to have a function returning the last revision / commit ID of the source from which the deployed application / library was built.
I have been using the __DATE__ and __TIME__ macros in C++ but this approach has obvious drawbacks.
What tools are available to achieve this in an automated manner?
I am using Eclipse-CDT for C++ (Linux, SVN) but it I am also interested in git solutions, and sources written in Java and C#.
If you were working with a Makefile and SVN, you could do something like this for C or C++:
I’m not that familiar with CDT, but I understand it’s able to use a Makefile-based build system.