~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/plugins/scriptedwizard/resources/directx/wizard.script

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
// globals
8
8
DirectXPath <- _T("");
 
9
DirectXSel <- 1;  // To hold selection
 
10
DirectXVerStr <- _T("9");
 
11
DirectXVer  <- 9;
9
12
 
10
13
function BeginWizard()
11
14
{
29
32
                            "\"include\" and \"lib\".");
30
33
 
31
34
    Wizard.AddInfoPage(_T("DirectXIntro"), intro_msg);
 
35
    Wizard.AddGenericSingleChoiceListPage(_T("DirectXVersionPage"), _T("Please select the DirectX version you want to use."), _T("DirectX 8;DirectX 9"), DirectXSel); // select wxwidgets version
32
36
    Wizard.AddProjectPathPage();
33
37
    Wizard.AddCompilerPage(_T(""), _T("gcc;msvctk"), true, true);
34
38
    Wizard.AddGenericSelectPathPage(_T("DirectXPath"), dxpath_descr, _T("Please select Direct/X's location:"), _T("$(#dx)"));
38
42
// Direct/X's path page
39
43
////////////////////////////////////////////////////////////////////////////////
40
44
 
 
45
function OnEnter_DirectXVersionPage(fwd)
 
46
{
 
47
    Wizard.SetListboxSelection(_T("GenericChoiceList"), DirectXSel);
 
48
    return true;
 
49
}
 
50
 
 
51
function OnLeave_DirectXVersionPage(fwd)
 
52
{
 
53
    if (fwd)
 
54
    {
 
55
        DirectXSel = Wizard.GetListboxSelection(_T("GenericChoiceList"));
 
56
        switch (DirectXSel)
 
57
        {
 
58
            case 0:
 
59
                DirectXVer = 8;
 
60
                DirectXVerStr = _T("8");
 
61
                break;
 
62
            case 1:
 
63
                DirectXVer = 9;
 
64
                DirectXVerStr = _T("9");
 
65
                break;
 
66
            default:
 
67
                DirectXVer = 9;
 
68
                DirectXVerStr = _T("9");
 
69
                break;
 
70
        }
 
71
    }
 
72
    return true;
 
73
}
 
74
 
 
75
////////////////////////////////////////////////////////////////////////////////
 
76
// Direct/X's path page
 
77
////////////////////////////////////////////////////////////////////////////////
 
78
 
41
79
function OnLeave_DirectXPath(fwd)
42
80
{
43
81
    if (fwd)
44
82
    {
45
 
        local dir         = Wizard.GetTextControlValue(_T("txtFolder")); // txtFolder is the text control in GenericSelectPathPage
46
 
        local dir_nomacro = ReplaceMacros(dir, true);
47
 
        if (!IO.FileExists(dir_nomacro + _T("/include/d3d.h")))
 
83
        local dir            = Wizard.GetTextControlValue(_T("txtFolder")); // txtFolder is the text control in GenericSelectPathPage
 
84
        local dir_nomacro    = ReplaceMacros(dir, true);
 
85
        local directX_header = _T("/include/d3d") + DirectXVerStr + _T(".h");
 
86
        if (!IO.FileExists(dir_nomacro + directX_header))
48
87
        {
49
88
            ShowError(_T("The path you entered seems valid, but this wizard " +
50
89
                         "can't locate Direct/X's files in it..."));
51
90
            return false;
52
91
        }
53
 
        if (!IO.FileExists(dir_nomacro + _T("/include/d3d8.h")))
54
 
        {
55
 
            ShowError(_T("The path you entered is valid, but this wizard " +
56
 
                         "requires at least the Direct/X 8 SDK..."));
57
 
            return false;
58
 
        }
59
92
 
60
93
        if (GetCompilerFactory().CompilerInheritsFrom(Wizard.GetCompilerID(), _T("msvc*")))
61
94
        {
76
109
// return the files this project contains
77
110
function GetFilesDir()
78
111
{
79
 
    return _T("directx/files");
 
112
    if ( DirectXVer==8 )
 
113
        return _T("directx/dx8");
 
114
 
 
115
    return _T("directx/dx9");
80
116
}
81
117
 
82
118
// setup the already created project
95
131
    else
96
132
    {
97
133
        project.AddIncludeDir(DirectXPath + _T("/include"));
 
134
        project.AddLibDir(DirectXPath + _T("/lib"));
98
135
        project.AddLibDir(DirectXPath + _T("/lib/x86"));
99
136
    }
100
137
 
117
154
    project.AddLinkLib(_T("uuid"));
118
155
    project.AddLinkLib(_T("odbc32"));
119
156
    project.AddLinkLib(_T("odbccp32"));
120
 
    project.AddLinkLib(_T("d3d8"));
 
157
    if ( DirectXVer==8 )
 
158
    {
 
159
        project.AddLinkLib(_T("d3d8"));
 
160
    }
 
161
    else
 
162
    {
 
163
        project.AddLinkLib(_T("d3d9"));
 
164
    }
121
165
 
122
166
    // set additional path's for MS VC++ Toolkit
123
167
    if (GetCompilerFactory().CompilerInheritsFrom(Wizard.GetCompilerID(), _T("msvc*")))
139
183
        target.SetWorkingDir(Wizard.GetDebugOutputDir());
140
184
        // enable generation of debugging symbols for target
141
185
        DebugSymbolsOn(target, Wizard.GetCompilerID());
 
186
        if (GetCompilerFactory().CompilerInheritsFrom(Wizard.GetCompilerID(), _T("gcc")))
 
187
        {
 
188
            target.AddCompilerOption(_T("-D_DEBUG"));
 
189
            target.AddCompilerOption(_T("-ggdb")); // Build for GDB
 
190
            if ( DirectXVer==8 )
 
191
                target.AddLinkLib(_T("d3dx8"));
 
192
            else
 
193
                target.AddLinkLib(_T("d3dx9"));
 
194
        }
142
195
    }
143
196
 
144
197
    // Release
150
203
        target.SetWorkingDir(Wizard.GetReleaseOutputDir());
151
204
        // enable optimizations for target
152
205
        OptimizationsOn(target, Wizard.GetCompilerID());
 
206
        if (GetCompilerFactory().CompilerInheritsFrom(Wizard.GetCompilerID(), _T("gcc")))
 
207
        {
 
208
            if ( DirectXVer==8 )
 
209
                target.AddLinkLib(_T("d3dx8"));
 
210
            else
 
211
                target.AddLinkLib(_T("d3dx9"));
 
212
        }
153
213
    }
154
214
 
155
215
    return true;