Yes, that’s the only mechanism CMake provides for tasks other than building source files for adding things to the build graph. I’d recommend writing them as CMake scripts and then triggering them from custom targets myself, but there are other ways to do it too (shell scripts, custom Makefile somewhere, etc.).
1 Like