Merge pull request #224 from DOCGroup/jwillemsen-patch-1
[MPC.git] / modules / VC71WorkspaceCreator.pm
blobbace352917e113e759bc0aa4d2f106a8325993a0
1 package VC71WorkspaceCreator;
3 # ************************************************************
4 # Description : A VC7.1 Workspace Creator
5 # Author : Chad Elliott
6 # Create Date : 4/17/2003
7 # ************************************************************
9 # ************************************************************
10 # Pragmas
11 # ************************************************************
13 use strict;
15 use VC71ProjectCreator;
16 use VC7WorkspaceCreator;
18 use vars qw(@ISA);
19 @ISA = qw(VC7WorkspaceCreator);
21 # ************************************************************
22 # Subroutine Section
23 # ************************************************************
26 sub pre_workspace {
27 my($self, $fh) = @_;
28 my $crlf = $self->crlf();
30 ## This identifies it as a Visual Studio 2003 file
31 print $fh 'Microsoft Visual Studio Solution File, Format Version 8.00', $crlf;
33 ## Optionally print the workspace comment
34 $self->print_workspace_comment($fh,
35 '#', $crlf,
36 '# This file was generated by MPC. Any changes made directly to', $crlf,
37 '# this file will be lost the next time it is generated.', $crlf,
38 '#', $crlf,
39 '# MPC Command:', $crlf,
40 '# ', $self->create_command_line_string($0, @ARGV), $crlf);
44 sub print_inner_project {
45 my($self, $fh, $gen, $pguid, $deps, $project_name, $name_to_guid_map) = @_;
47 if ($self->allow_empty_dependencies() || defined $$deps[0]) {
48 ## Print out the project dependencies
49 my $crlf = $self->crlf();
50 print $fh "\tProjectSection(ProjectDependencies) = postProject$crlf";
51 foreach my $dep (@$deps) {
52 my $guid = $name_to_guid_map->{$dep};
53 print $fh "\t\t{$guid} = {$guid}$crlf" if (defined $guid);
55 print $fh "\tEndProjectSection$crlf";
60 sub allow_empty_dependencies {
61 #my $self = shift;
62 return 1;
66 sub print_configs {
67 my($self, $fh, $configs) = @_;
68 my $crlf = $self->crlf();
69 foreach my $key (sort keys %$configs) {
70 print $fh "\t\t$key = $key$crlf";
75 sub print_dependencies {
76 ## These are done in the print_inner_project method