Why so dismissive? Tired? Frustrating work day? ;-) The constraint is in the CMake logic as far as it is known to me (files can only be added to a target which is logically wrong). The various IDEs in principle may or may not be able to show arbitrary files on disk; but what Visual Studio in particular shows in the Solution Explorer is not the file system but an orthogonal structure conceived by the user. In this case this structure is synthesized via CMake. That works pretty well (e.g. using the FOLDER property for targets or source_group for sources, but not in this case.
↧