While working on MariaDB 10.6.4 compilation I noticed this warning:
It is understanable that the variable is defined twice, but it is not good that we have two different default values of MARIADB_UNIX_ADDR.
The client sets it to /tmp/mysql.sock in https://github.com/mariadb-corporation/mariadb-connector-c/blob/1f320a663cf08191e3be03be11bd61c7560b0cb7/CMakeLists.txt#L181
The server sets MARIADB_UNIX_ADDR to MYSQL_UNIX_ADDR which in turn is set to INSTALL_UNIX_ADDRDIR which ends up being /var/lib/mysql in the build.
I suggest the default path would be the same in both projects.