[CMake] Properly detect the Solaris version