CMake generate debian packages under build/$<CONFIG>/debian instead of build/$mode/debian. so let's translate $mode to $<CONFIG> if build.ninja is found under build/ directory, as configure.py puts build.ninja under $top_srcdir, while CMake puts it under build/ . Signed-off-by: Kefu Chai <kefu.chai@scylladb.com> Closes scylladb/scylladb#17592