CMake error on mac os mojave related to X11

Are you using XCode’s Clang and the same C++ standard for both your project and ROOT? Are all needed ROOT libraries linked to your library (i.e. at least Core, RIO, Tree)? Another thing, are you using the same version of XCode than the ROOT binaries?