Reputation: 23
Cmake version:3.20.0 platform: macOS 11.1
When I tried to compiler a library with Cmake, I got the following error:
CMake Error at CMakeLists.txt:45 (STRING):
STRING sub-command REPLACE requires at least four arguments.
The corresponding code is shown below:
STRING(REPLACE "'" "\"" HYMLS_REVISION ${rev})
In there, I want to replace ' with " . I don't find any error. It should be valid. Could anyone help with this?
Upvotes: 2
Views: 6086
Reputation: 21
Use quotes around ${rev} variable
STRING(REPLACE "'" "\"" HYMLS_REVISION "${rev}")
Upvotes: 2