workspace generation - sourcegroup - bug?

Added by Kevin Thacker over 5 years ago

If I do this:

SourceGroup PROJ : "PC" : $(FILES) ;
SourceGroup PROJ : "PC\\Code" : $(CODE_FILES) ;
Project PROJ : $(FILES) $(CODE_FILES) ;

And generate a visual studio 10 workspace, I end up with a project with a folder structure as:
PC
+- Code

but only the Code sub-directory has files listed in it. The parent directory doesn't have any files.

If I do this:

SourceGroup PROJ : "PC" : $(FILES) ;
Project PROJ : $(FILES) $(CODE_FILES) ;

Then I get the files in the PC directory.

Is this a bug?

I am using the main version not nextgen.


Replies (3)

RE: workspace generation - sourcegroup - bug? - Added by Joshua Jensen over 5 years ago

I pushed a fix for an unrelated issue in jam --workspace to the master branch. With that fix, the following outputs correct project files for me:

FILES = abc.txt def.txt ;
CODE_FILES = ghi.cpp jkl.cpp mno.cpp ;

SourceGroup PROJ : "PC" : $(FILES) ;
SourceGroup PROJ : "PC\\Code" : $(CODE_FILES) ;
Project PROJ : $(FILES) $(CODE_FILES) ;

Workspace MySolution : PROJ ;

How does your Jamfile differ?

-Josh

RE: workspace generation - sourcegroup - bug? - Added by Kevin Thacker over 5 years ago

that works for me too.
Try the attached one.

generate a workspace from this setup.

where is the 3pc\\code\\sub dir?

perhaps there is a bug in the jam file???

buildtest3.zip (1.26 KB)

RE: workspace generation - sourcegroup - bug? - Added by Joshua Jensen over 5 years ago

Your example is missing the addition of $(CODE_SUB_FILES) to the Project line:

Project MYAPP : $(FILES) $(CODE_FILES) $(CODE_SUB_FILES) ;

However, it is weird to use the Project rule here. C.Application should have all of the source files, and it internally does the same thing as the Project rule. Therefore, the C.Application line should read:

C.Application MYAPP : $(FILES) $(CODE_FILES) $(CODE_SUB_FILES) ;

and the Project line should be deleted.

-Josh

(1-3/3)