Is it possible to force an executable target to pre-req another one

I have two projects for executables: DeepSkyStacker (DSS for short) and DeepSkyStackerCL (DSSCL for short).

The top level CMakelists.txt does this

add_subdirectory(DeepSkyStackerKernel)
add_subdirectory(ZClass)
add_subdirectory(DeepSkyStackerCL)
add_subdirectory(DeepSkyStacker)

so if I simply run the top level CMakelist.txt then the libraries in the DSSKernel and ZClass projects and then DSSCL are built first. This is good because DSS wants to copy the executable built by DSSCL into the SharedSupport directory of the macOS bundle. However it’s possible (at least using Visual Studio to drive CMake) to request that DSS be built. In that case the libraries it needs will be built prior to building DSS, but DSSCL won’t be built as I can’t see a way to make DSS dependent on DSSCL?

Is there a way to tell CMake that this dependency exists? If not does anyone have any suggestions on how best to handle this?

Thanks
David

Typically an executable depends on a library by linking against the library target:

target_link_libraries(exe PUBLIC lib)

Of you do not link, you have to specify the dependency manually with add_dependencies()