summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2003-04-17 16:48:23 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2003-04-17 16:48:23 +0000
commit5ac09e2ec7f4048ced36c2a425a11c07058dce07 (patch)
tree33d0bffd9c3e3d0a8c1d1317ccc222733b5a0ad0
parent967995768e95e13154ad8c27bf563c26ddd25d85 (diff)
downloadMPC-5ac09e2ec7f4048ced36c2a425a11c07058dce07.tar.gz
ChangeLogTag: Thu Apr 17 11:45:51 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--modules/Driver.pm6
-rw-r--r--modules/VC71WorkspaceCreator.pm79
-rw-r--r--modules/VC7ProjectCreator.pm17
-rw-r--r--modules/VC7WorkspaceCreator.pm95
-rw-r--r--templates/vc7.mpd4
5 files changed, 164 insertions, 37 deletions
diff --git a/modules/Driver.pm b/modules/Driver.pm
index cf53cc79..40b37853 100644
--- a/modules/Driver.pm
+++ b/modules/Driver.pm
@@ -268,8 +268,10 @@ sub run {
if ($value =~ /\$(\w+)(.*)?/) {
my($var) = $1;
my($extra) = $2;
- $options->{'relative'}->{$key} =
- $options->{'relative'}->{$var} . $extra;
+ $options->{'relative'}->{$key} =
+ (defined $options->{'relative'}->{$var} ?
+ $options->{'relative'}->{$var} : '') .
+ (defined $extra ? $extra : '');
}
else {
$options->{'relative'}->{$key} = $value;
diff --git a/modules/VC71WorkspaceCreator.pm b/modules/VC71WorkspaceCreator.pm
new file mode 100644
index 00000000..3d15b1ba
--- /dev/null
+++ b/modules/VC71WorkspaceCreator.pm
@@ -0,0 +1,79 @@
+package VC71WorkspaceCreator;
+
+# ************************************************************
+# Description : A VC7.1 Workspace Creator
+# Author : Chad Elliott
+# Create Date : 4/17/2003
+# ************************************************************
+
+# ************************************************************
+# Pragmas
+# ************************************************************
+
+use strict;
+
+use VC71ProjectCreator;
+use VC7WorkspaceCreator;
+
+use vars qw(@ISA);
+@ISA = qw(VC7WorkspaceCreator);
+
+# ************************************************************
+# Subroutine Section
+# ************************************************************
+
+
+sub pre_workspace {
+ my($self) = shift;
+ my($fh) = shift;
+ my($crlf) = $self->crlf();
+
+ print $fh "Microsoft Visual Studio Solution File, Format Version 8.00$crlf";
+}
+
+
+sub print_inner_project {
+ my($self) = shift;
+ my($fh) = shift;
+ my($gen) = shift;
+ my($pguid) = shift;
+ my($deps) = shift;
+
+ if (defined $deps && $deps ne '') {
+ my($crlf) = $self->crlf();
+ print $fh "\tProjectSection(ProjectDependencies) = postProject$crlf";
+ my($darr) = $self->create_array($deps);
+ foreach my $dep (@$darr) {
+ my($val) = $gen->specific_lookup($dep);
+ if (defined $val && $pguid ne $val) {
+ print $fh "\t\t{$val} = {$val}$crlf";
+ }
+ }
+ print $fh "\tEndProjectSection$crlf";
+ }
+}
+
+
+sub print_configs {
+ my($self) = shift;
+ my($fh) = shift;
+ my($configs) = shift;
+ my($crlf) = $self->crlf();
+ foreach my $key (sort keys %$configs) {
+ print $fh "\t\t$key = $key$crlf";
+ }
+}
+
+
+sub print_dependencies {
+ #my($self) = shift;
+ #my($fh) = shift;
+ #my($gen) = shift;
+ #my($list) = shift;
+ #my($pjs) = shift;
+
+ ## These are done in the print_inner_project method
+}
+
+
+1;
diff --git a/modules/VC7ProjectCreator.pm b/modules/VC7ProjectCreator.pm
index 30191fd7..8564ac3c 100644
--- a/modules/VC7ProjectCreator.pm
+++ b/modules/VC7ProjectCreator.pm
@@ -22,6 +22,14 @@ use vars qw(@ISA);
# Subroutine Section
# ************************************************************
+sub file_sorter {
+ my($self) = shift;
+ my($left) = shift;
+ my($right) = shift;
+ return lc($left) cmp lc($right);
+}
+
+
sub specific_lookup {
my($self) = shift;
my($tag) = shift;
@@ -56,6 +64,12 @@ sub crlf {
}
+sub get_vcversion {
+ #my($self) = shift;
+ return '7.00';
+}
+
+
sub fill_value {
my($self) = shift;
my($name) = shift;
@@ -67,6 +81,9 @@ sub fill_value {
$self->get_current_input(),
$self->getcwd());
}
+ elsif ($name eq 'vcversion') {
+ $value = $self->get_vcversion();
+ }
return $value;
}
diff --git a/modules/VC7WorkspaceCreator.pm b/modules/VC7WorkspaceCreator.pm
index da47350d..c0051d45 100644
--- a/modules/VC7WorkspaceCreator.pm
+++ b/modules/VC7WorkspaceCreator.pm
@@ -44,6 +44,57 @@ sub pre_workspace {
}
+sub print_inner_project {
+ #my($self) = shift;
+ #my($fh) = shift;
+ #my($gen) = shift;
+ #my($pguid) = shift;
+ #my($deps) = shift;
+}
+
+
+sub print_configs {
+ my($self) = shift;
+ my($fh) = shift;
+ my($configs) = shift;
+ my($crlf) = $self->crlf();
+ my($count) = 0;
+
+ foreach my $key (sort keys %$configs) {
+ print $fh "\t\tConfigName.$count = $key$crlf";
+ $count++;
+ }
+}
+
+
+sub print_dependencies {
+ my($self) = shift;
+ my($fh) = shift;
+ my($gen) = shift;
+ my($list) = shift;
+ my($pjs) = shift;
+ my($crlf) = $self->crlf();
+
+ ## Project Dependencies
+ print $fh "\tGlobalSection(ProjectDependencies) = postSolution$crlf";
+ foreach my $project (@$list) {
+ my($name, $deps, $pguid) = @{$$pjs{$project}};
+ if (defined $deps && $deps ne '') {
+ my($darr) = $self->create_array($deps);
+ my($i) = 0;
+ foreach my $dep (@$darr) {
+ my($val) = $gen->specific_lookup($dep);
+ if (defined $val && $pguid ne $val) {
+ print $fh "\t\t{$pguid}.$i = {$val}$crlf";
+ $i++;
+ }
+ }
+ }
+ }
+ print $fh "\tEndGlobalSection$crlf";
+}
+
+
sub write_comps {
my($self) = shift;
my($fh) = shift;
@@ -58,13 +109,13 @@ sub write_comps {
## Project Information
foreach my $project (sort @list) {
- my($pi) = $$pjs{$project};
- my($name, $deps, $pguid) = @$pi;
+ my($name, $deps, $pguid) = @{$$pjs{$project}};
## Convert all /'s to \
my($cpy) = $self->slash_to_backslash($project);
- print $fh "Project(\"{$guid}\") = \"$name\", \"$cpy\", \"{$pguid}\"$crlf" .
- "EndProject$crlf";
+ print $fh "Project(\"{$guid}\") = \"$name\", \"$cpy\", \"{$pguid}\"$crlf";
+ $self->print_inner_project($fh, $gen, $pguid, $deps);
+ print $fh "EndProject$crlf";
}
## Project Configurations
@@ -73,44 +124,22 @@ sub write_comps {
my(%configs) = ();
foreach my $project (@list) {
- my($pi) = $$pjs{$project};
- my($name, $deps, $pguid, @cfgs) = @$pi;
+ my($name, $deps, $pguid, @cfgs) = @{$$pjs{$project}};
foreach my $cfg (@cfgs) {
$cfg =~ s/\|.*//;
$configs{$cfg} = 1;
}
}
- my($count) = 0;
- foreach my $key (sort keys %configs) {
- print $fh "\t\tConfigName.$count = $key$crlf";
- $count++;
- }
+ $self->print_configs($fh, \%configs);
+ print $fh "\tEndGlobalSection$crlf";
- ## Project Dependencies
- print $fh "\tEndGlobalSection$crlf" .
- "\tGlobalSection(ProjectDependencies) = postSolution$crlf";
- foreach my $project (@list) {
- my($pi) = $$pjs{$project};
- my($name, $deps, $pguid) = @$pi;
- if (defined $deps && $deps ne '') {
- my($darr) = $self->create_array($deps);
- my($i) = 0;
- foreach my $dep (@$darr) {
- my($val) = $gen->specific_lookup($dep);
- if (defined $val && $pguid ne $val) {
- print $fh "\t\t{$pguid}.$i = {$val}$crlf";
- $i++;
- }
- }
- }
- }
- print $fh "\tEndGlobalSection$crlf" .
- "\tGlobalSection(ProjectConfiguration) = postSolution$crlf";
+ ## Print dependencies if there are any
+ $self->print_dependencies($fh, $gen, \@list, $pjs);
## Project Configuration Names
+ print $fh "\tGlobalSection(ProjectConfiguration) = postSolution$crlf";
foreach my $project (sort @list) {
- my($pi) = $$pjs{$project};
- my($name, $deps, $pguid, @cfgs) = @$pi;
+ my($name, $deps, $pguid, @cfgs) = @{$$pjs{$project}};
foreach my $cfg (sort @cfgs) {
my($c) = $cfg;
$c =~ s/\|.*//;
diff --git a/templates/vc7.mpd b/templates/vc7.mpd
index cae5d385..a507d174 100644
--- a/templates/vc7.mpd
+++ b/templates/vc7.mpd
@@ -1,7 +1,7 @@
-<?xml version="<%xml_version("1.0")%>" encoding = "<%encoding("Windows-1252")%>"?>
+<?xml version="<%xml_version("1.0")%>" encoding="<%encoding("Windows-1252")%>"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="7.00"
+ Version="<%vcversion%>"
Name="<%project_name%>"
ProjectGUID="{<%guid%>}"
SccProjectName=""