Having issue with Cmake "string sub-command REGEX, mode REPLACE needs at least 6 arguments total to command."

I have inherited a project for which I can have no help of those who I inherited it from, and am running into a wall that I cannot comprehend. I hope someone here can shed some light to help this absolute noob understand what’s going on and maybe fix it.

I have a project that uses CMake to build the project, and when I try to “make” it, I get the error:
“/cmake/version.cmake:9 (string): string sub-command REGEX, mode REPLACE needs at least 6 arguments total to command.”

What does this even mean?
The line 9 in question reads:
“string(REGEX REPLACE “^v([0-9]).([0-9]).*$” “\1;\2” GIT_FULL_VERSION ${GIT_DESCRIPTION})”

It also gave this error:
“Generating version information using git
fatal: No names found, cannot describe anything.”

Hope anyone can help :frowning: I’m pretty desolate.

For me it looks like the thing that should fill GIT_DESCRIPTION does not work correctly. The variable is empty, it gets substituted by nothing, thus the string command is one parameter short.
This seems to be confirmed by the other error you got.

So you have to debug the code that is supposed to generate GIT_DESCRIPTION.

Thank you VERY much for that! I tracked the bug down thanks to your info and it was caused by the repository not having a release tag on Github. I think version.cmake should include a check for this that wasn’t there, so I need to look into making one!