When trying to compile WebAssembly (wabt-rs) for a dependent package, it failed on Ubuntu 18.04 LTS due to this error message. The error appears to come from the fact that CMAKE_PROJECT_VERSION isn’t defined in the source headers of the compilation. The problem is caused by the cmake version on the system: That version (or any version below v3.12.0) generates a header file that looks like this: Whereas the project that’s compiling, expects it look like this: One solution would be to upgrade cmake to a later version, but depending on your distribution that may not be very convenient (due to dependencies etc)..
The error occurred on line /root/.cargo/registry/src/github.com-1ecc6299db9ec823/wabt-sys-0.8.0/wabt/src/option-parser.cc according to my error message, so I modified that file and added the definition to the very top.
I'm Mattias Geniar, an independent developer, Linux sysadmin & general problem solver.