Make a macro and helpers library instead of Big CMake.