CMake SVNVersion fixes

Kim Gräsman kim.grasman at gmail.com
Mon Feb 10 13:06:43 PST 2014


On Mon, Feb 10, 2014 at 6:38 PM, Chandler Carruth <chandlerc at google.com> wrote:
>
> On Mon, Feb 10, 2014 at 9:33 AM, Jordan Rose <jordan_rose at apple.com> wrote:
>>
>> If you want to see what I tried, it was r190557, but that ended up getting
>> reverted in r191784. I don't think I had the right approach, though.
>>
>> The general problem is that CMake steps only run at configure time, which
>> means if no CMakeLists are changed the repository version wouldn't generally
>> get updated. In my patch I changed things to check the repository version
>> every time, but that was expensive. (Still, it's no different from what the
>> Makefile build does, right?)
>
>
> So, my suggestion would be to add a cmake command which runs as part of the
> build process that generates the version information, and add appropriate
> files to its dependencies. For example, for a git repository, adding
> '.git/HEAD' as a dependency would work. There is likely an analogous file
> that could be used to trigger (in the build system) rebuilding the version
> information when the VCS is updated.

Thanks for your input!

I agree with both of your ideas in principle, but they solve different problems:

1) Handle non-SVN version control systems
2) Handle the configure vs. build-time tension

Both noble goals, but I don't know enough about CMake or feel enough
pain to address either of them.

My patches may be painting lipstick but they at least solve the
immediate problem that the information is put in the wrong place.

FWIW,
- Kim



More information about the cfe-commits mailing list