let's assume that we have a rpm .spec file with following parameter:
Version: 0.1.0
I want to pass this parameter to C++ code from the same package, i.e. I would like to initialize with this value a C++ variable:
const std::string program_version([here goes 0.1.0 read from the .spec file]);
I am using cmake and I suppose that first step would be (in .spec file):
%cmake . -DVERSION=%{version}
Any hints? Thank you in advance ;>