How to compile the percona server to be placed completely in one directory?

I have build Percona MySQL server 5.7 with this configuration:

cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DWITH_EMBEDDED_SERVER=OFF -DCMAKE_INSTALL_PREFIX=/opt/percona-server-5.7_5.7.22-22 -DMYSQL_DATADIR=/opt/percona-server-5.7_5.7.22-22/data

The server is now having log at /var/mariadb/xxxxx…
I would like to build it in a way that everything to be stored in one root directory for easier multi-version environment.
I will have to do the same build with version 5.6 and when it comes with v8

I tried with the documented cmake parameters in MySQL 5.7 site but they do not make any change. How this can be achieved? Event the
-DMYSQL_DATADIR seems to be ignored when set to /opt/percona-server-5.7_5.7.22-22/var/data (for example) it still creates /opt/percona-server-5.7_5.7.22-22/data This is so annoying problem, please help!