[CMake] Make man page version replacement work on MacOS and Solaris