I am using cmake-pandocology to find pandoc and work with its files (GitHub - jeetsukumaran/cmake-pandocology: Compile documents using Pandoc under the CMake build system)
I need to make sure that the ${PANDOC_EXECUTABLE}
version is greater than 3.1.9. At present, pandocology does not parse the version number and set a variable that can be tested.
I can do something like this…
execute_process(COMMAND ${PANDOC_EXECUTABLE} --verbose OUTPUT_VARIABLE PANDOC_VERSION_OUTPUT)
However, the output is multi-line and includes a bunch of extra clutter. I have been unable to come up with a combination of string(FIND, string(SUBSTRING, or string(REGEX that will allow me to set a version number variable that I can test against. Here is a sample of the variable:
pandoc 3.3
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /Users/ramcdona/.local/share/pandoc
Copyright (C) 2006-2024 John MacFarlane. Web: https://pandoc.org
This is free software see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
Thanks for any help obtaining the version number in a form that can be tested. It appears that the pandoc project sometimes uses a three digit version such as 3.1.9. So the solution needs to be able to parse that and set it for comparison.