The only way to cleanly separate the maxutils library from the MaxScale CMake project is to make it a standalone CMake project. With the help of ExternalProject, it should be relatively easy to use.