> to add new dependencies to a global target from outside the file

Which is the case here, no? webodf.js-target is specified in webodf/CMakeLists.txt so I would have understood I need to do that here (also did not work otherwise). Not yet friends with add_custom_*, so happy to be educated :)