Building example sketches: is there an easy way?

I am developing an Arduino-style library. while the main test sketch resides in the root/src folder, example sketches are in lib\\LibraryName\\examples\\someFolder\\.

Is there a way to have these built whenever the main sketch is compiled, without having to comment lots of lines in platformio.ini and reversing the process after the build?

I currently have an [env:] section and a [platformio] section for each example sketch to set the different src_dir paths and do comment out every other of these sections on and on.

Building a separate project for each example is a huge overhead in terms of libraries being copied etc., so I refrained from doing so.

Is there a better way?