I couldn't find anything general in CMake that allows you to specify build order, but you may be able to do this with specific build system generators that allow you to compile individual .o or .obj files. For example, using the Ninja generator:
add_executable(mytarget the-suspect-src.cpp)
The generated Ninja build system lets me build the corresponding .o file by specifying it explicitly:
ninja CMakeFiles/mytarget.dir/the-suspect-src.cpp.o
So you could achieve your desired behavior with:
ninja CMakeFiles/mytarget.dir/the-suspect-src.cpp.o && ninja
Note that I don't memorize these paths to the .o files, but instead tab-complete in the terminal.
I happen to know that the Makefile generators also have a similar ability to build individual .o files, but I'm not aware of any other generators which have this ability.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…