We lose CMAKE_INSTALL_PREFIX with this change. I would suggest to set DATADIR to ${CMAKE_INSTALL_PREFIX}/${DATAROOTDIR}/solarus.

Also, please rename DATADIR to SOLARUS_INSTALL_DATADIR and DATAROOTDIR to SOLARUS_INSTALL_DATAROOTDIR.