Closed koerthawkins closed 1 year ago
Hey Lukas,
Which version of CMake are you on?
Do you maybe have extra newlines in the VERSION
file? It works for me on Linux
The codesign branch isn't yet stable, gotta clean up the macOS dmg stuff and add Windows codesigning... but it'll be merged soon!
Greetings from Vienna, Sudara
I'm using version 3.24.0-rc4
. No, I made sure to avoid any newlines or extra characters in the VERSION
file.
To be honest the CMake documentation didn't provide my a reason yet why file(READ VERSION currentversion)
should not work but file(STRINGS VERSION currentversion)
does. The only possible explanation I could think of would be that with file(READ ...)
CMake 3.24 interprets the version number as a float?
Anyhow, is there a reason against using file(STRINGS ...)
? Don't want to annoy you, but reading the documentation it just seems to be the slightly cleaner variant in any case for me. :)
Interesting... the reason why I asked about newlines is that your error clearly shows a newline as a part of the output. I wonder if it's possible your editor is automatically adding a newline at the end of VERSION on save.
I have other projects using this format, and other people depend on Pamplejuce, so I'd have to look into the STRINGS addition. Maybe I can get something more robust that will ignore newlines, trim whitespace, etc...
Yes. I intentionally changed the VERSION
file with both CLion
and NeoVim
to exclude the newline character, and it's not in the file. But yes, it's weird indeed!
Anyway, thx for the response. Gladly it's only a small thing, I can live with it if it happens only for me. :)
This was changed to STRINGS some time back, thank you!
Bug description
The version information contained in VERSION can not be handled by CMake. If you use the most recent [CMakeLists.txt]() on the
codesign
branch I get the following error:I tried to add string quotes here and there but to no avail.
To reproduce
Steps to reproduce the behavior:
cmake . -B build-debug -G "Unix Makefiles"
Platform
I tested this on my laptop using Ubuntu 20.04, kernel
5.4.0-122-generic
. I don't know whether the problem is reproducible on other platforms.Possible fix
This easy fix worked for me:
However, someone would need to try and reproduce the fix on Windows and MacOS.