summaryrefslogtreecommitdiff
path: root/modules/VC10ProjectCreator.pm
blob: 86eca79239f1193c9d736ccdfaa4bd60b6d252a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package VC10ProjectCreator;

# ************************************************************
# Description   : A VC10 Project Creator
# Author        : Johnny Willemsen
# Create Date   : 11/10/2008
# ************************************************************

# ************************************************************
# Pragmas
# ************************************************************

use strict;

use VC9ProjectCreator;

use vars qw(@ISA);
@ISA = qw(VC9ProjectCreator);

# ************************************************************
# Data Section
# ************************************************************

## NOTE: We call the constant as a function to support Perl 5.6.
my %info = (Creator::cplusplus() => {'ext'      => '.vcxproj',
                                     'dllexe'   => 'vc10exe',
                                     'libexe'   => 'vc10libexe',
                                     'dll'      => 'vc10dll',
                                     'lib'      => 'vc10lib',
                                     'template' => [ 'vc10', 'vc10filters' ],
                                    },
           );

my %config = ('vcversion' => '10.00',
              'prversion' => '10.0.30319.1',
              'toolsversion' => '4.0',
              'targetframeworkversion' => '4.0',
              'xmlheader' => 1,
              );

# ************************************************************
# Subroutine Section
# ************************************************************

sub get_info_hash {
  my($self, $key) = @_;

  ## If we have the setting in our information map, the use it.
  return $info{$key} if (defined $info{$key});

  ## Otherwise, see if our parent type can take care of it.
  return $self->SUPER::get_info_hash($key);
}

sub get_configurable {
  my($self, $name) = @_;
  return $config{$name};
}

## Because VC10 puts file filters in a different file
## that starts with the project file name, and ends
## with .filters extension. So we need to return two
## templates.
sub get_template {
  my $self = shift;
  my $templates = $self->SUPER::get_template();

  return (UNIVERSAL::isa($templates, 'ARRAY') ? @$templates : $templates);
}

sub file_visible {
  my($self, $template) = @_;
  my $templates = $self->SUPER::get_template();

  if (UNIVERSAL::isa($templates, 'ARRAY')) {
    return ($template eq $$templates[0]);
  }

  return 1;
}

## If the template is one of the additional templates,
## we need to append the proper extension to the file name.
sub project_file_name {
  my($self, $name, $template) = @_;

  my $project_file_name = $self->SUPER::project_file_name($name, $template);
  if (!$self->file_visible($template)) {
    $project_file_name .= '.filters';
  }

  return $project_file_name;
}

sub pre_write_output_file {
  my($self, $webapp) = @_;
  return $self->combine_custom_types();
}

1;