Launch thisREST.cmake macro each time we call make install

I realised that I need to call cmake ../ in order to update the contents of thisREST.sh with the commit where I am in my local copy.

So, if I have already compiled REST, I switch to another commit, and run make install the value of the commit will not be updated.

And when I use : rest-config --commit I do not get the right commit version. It is this easy to change that in CMakeLists.txt?

thisREST.cmake is actually launched at install time, when we do “make install”.

The problem is that the Git info is gathered by CollectGitInfo.cmake that is called only at configure time.

I have created the following issue to track this problem

This leads to another bug that. when the directory is not a git repository, the install will fail. I think the solution should be to add a custom target during the build stage

I have added this feature. Now build command will trigger a rerun of cmake program. See Sign in · GitLab

It’s still not good. All the files needs to be re-compiled.