how to pass a rpm spec parameter to C++ program

非 Y 不嫁゛ 提交于 2019-12-25 00:07:47

问题


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 ;>

来源:https://stackoverflow.com/questions/22357708/how-to-pass-a-rpm-spec-parameter-to-c-program

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!