How to set the FOLDER property for all Targets in a given subdirectory

The target property FOLDER is pre-initialised from the variable CMAKE_FOLDER if that is set when the target is created (see its docs). So, in order to store all targets from a subdirectory in a particular folder, all you have to do is this:

set(CMAKE_FOLDER FolderFor/Subdir)
add_subdirectory(sub/dir)
unset(CMAKE_FOLDER)