~ubuntu-branches/ubuntu/trusty/codeblocks/trusty-proposed

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): David Paleino
  • Date: 2011-01-22 20:58:57 UTC
  • mfrom: (3.1.3 maverick)
  • Revision ID: james.westby@ubuntu.com-20110122205857-mlwokxogiic0dnu7
Tags: 10.05-1
* Initial Debian release (Closes: #304570)
* Setting myself as Maintainer, original Ubuntu maintainer set as
  Uploader
* Use debian/watch to get the original tarball, instead of an ad-hoc
  script
* Wrap multivalue fields in debian/control
* Update debian/copyright with lots of missing info, and use DEP-5
* Add missing linkage to libX11 (03-fix_libX11_linkage.patch)
* Use dh7 for debian/rules
* Build-Depend on dh-autoreconf, since we need to re-generate autotools
  machinery (libtool version mismatch)
* Migrate from libwxsmithlib0-dev to libwxsmithlib-dev, to ease
  future SONAME bumps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
////////////////////////////////////////////////////////////////////////////////
 
2
//
 
3
// SFML project wizard
 
4
//
 
5
////////////////////////////////////////////////////////////////////////////////
 
6
 
 
7
// globals (used under windows only)
 
8
SFMLPathDefault    <- _T("$(#sfml)");
 
9
SFMLPathDefaultInc <- _T("$(#sfml.include)");
 
10
SFMLPathDefaultLib <- _T("$(#sfml.lib)");
 
11
SFMLPath           <- _T("");
 
12
 
 
13
function BeginWizard()
 
14
{
 
15
    local intro_msg = _T("Welcome to the new SFML project wizard!\n\n" +
 
16
                         "This wizard will guide you to create a new project\n" +
 
17
                         "using the SFML multimedia library.\n\n" +
 
18
                         "When you 're ready to proceed, please click \"Next\"...");
 
19
 
 
20
    local sfmlpath_descr = _T("Please select the location of SFML on your computer.\n" +
 
21
                             "This is the top-level folder where SFML was installed (unpacked).\n" +
 
22
                             "To help you, this folder must contain the subfolders\n" +
 
23
                             "\"include\" and \"lib\".");
 
24
 
 
25
    Wizard.AddInfoPage(_T("SFMLIntro"), intro_msg);
 
26
    Wizard.AddProjectPathPage();
 
27
    if (PLATFORM == PLATFORM_MSW)
 
28
        Wizard.AddGenericSelectPathPage(_T("SFMLPath"), sfmlpath_descr, _T("Please select SFML's location:"), SFMLPathDefault);
 
29
    Wizard.AddCompilerPage(_T(""), _T("*"), true, true);
 
30
}
 
31
 
 
32
////////////////////////////////////////////////////////////////////////////////
 
33
// SFML's path page
 
34
////////////////////////////////////////////////////////////////////////////////
 
35
 
 
36
function OnLeave_SFMLPath(fwd)
 
37
{
 
38
    if (fwd)
 
39
    {
 
40
        local dir         = Wizard.GetTextControlValue(_T("txtFolder")); // txtFolder is the text control in GenericSelectPathPage
 
41
        local dir_nomacro = VerifyDirectory(dir);
 
42
 
 
43
        if (dir_nomacro.IsEmpty())
 
44
            return false;
 
45
 
 
46
        // verify include dependencies
 
47
        local dir_nomacro_inc = GetCompilerIncludeDir(dir, SFMLPathDefault, SFMLPathDefaultInc);
 
48
        if (dir_nomacro_inc.IsEmpty())
 
49
            return false;
 
50
        if (!VerifyFile(dir_nomacro_inc, _T("Audio.hpp"), _T("SFML's include")))
 
51
            return false;
 
52
        if (!VerifyFile(dir_nomacro_inc, _T("Config.hpp"), _T("SFML's include")))
 
53
            return false;
 
54
        if (!VerifyFile(dir_nomacro_inc, _T("Graphics.hpp"), _T("SFML's include")))
 
55
            return false;
 
56
        if (!VerifyFile(dir_nomacro_inc, _T("Network.hpp"), _T("SFML's include")))
 
57
            return false;
 
58
        if (!VerifyFile(dir_nomacro_inc, _T("System.hpp"), _T("SFML's include")))
 
59
            return false;
 
60
        if (!VerifyFile(dir_nomacro_inc, _T("Window.hpp"), _T("SFML's include")))
 
61
            return false;
 
62
 
 
63
        // verify library dependencies
 
64
        local dir_nomacro_lib = GetCompilerLibDir(dir, SFMLPathDefault, SFMLPathDefaultLib);
 
65
        if (dir_nomacro_lib.IsEmpty())
 
66
            return false;
 
67
 
 
68
        if (!VerifyLibFile(dir_nomacro_lib, _T("sfml-audio"), _T("SFML's")))
 
69
            return false;
 
70
        if (!VerifyLibFile(dir_nomacro_lib, _T("sfml-graphics"), _T("SFML's")))
 
71
            return false;
 
72
        if (!VerifyLibFile(dir_nomacro_lib, _T("sfml-network"), _T("SFML's")))
 
73
            return false;
 
74
        if (!VerifyLibFile(dir_nomacro_lib, _T("sfml-system"), _T("SFML's")))
 
75
            return false;
 
76
        if (!VerifyLibFile(dir_nomacro_lib, _T("sfml-window"), _T("SFML's")))
 
77
            return false;
 
78
 
 
79
        if (!VerifyLibFile(dir_nomacro_lib, _T("sfml-audio.dll"), _T("SFML's")))
 
80
            return false;
 
81
        if (!VerifyLibFile(dir_nomacro_lib, _T("sfml-graphics.dll"), _T("SFML's")))
 
82
            return false;
 
83
        if (!VerifyLibFile(dir_nomacro_lib, _T("sfml-network.dll"), _T("SFML's")))
 
84
            return false;
 
85
        if (!VerifyLibFile(dir_nomacro_lib, _T("sfml-system.dll"), _T("SFML's")))
 
86
            return false;
 
87
        if (!VerifyLibFile(dir_nomacro_lib, _T("sfml-window.dll"), _T("SFML's")))
 
88
            return false;
 
89
 
 
90
        SFMLPath = dir; // Remember the original selection.
 
91
 
 
92
        local is_macro = _T("");
 
93
 
 
94
        // try to resolve the include directory as macro
 
95
        is_macro = GetCompilerIncludeMacro(dir, SFMLPathDefault, SFMLPathDefaultInc);
 
96
        if (is_macro.IsEmpty())
 
97
        {
 
98
            // not possible -> use the real inc path we had computed instead
 
99
            SFMLPathDefaultInc = dir_nomacro_inc;
 
100
        }
 
101
 
 
102
        // try to resolve the library directory as macro
 
103
        is_macro = GetCompilerLibMacro(dir, SFMLPathDefault, SFMLPathDefaultLib);
 
104
        if (is_macro.IsEmpty())
 
105
        {
 
106
            // not possible -> use the real lib path we had computed instead
 
107
            SFMLPathDefaultLib = dir_nomacro_lib;
 
108
        }
 
109
    }
 
110
    return true;
 
111
}
 
112
 
 
113
// return the files this project contains
 
114
function GetFilesDir()
 
115
{
 
116
    return _T("sfml/files");
 
117
}
 
118
 
 
119
// setup the already created project
 
120
function SetupProject(project)
 
121
{
 
122
    if (PLATFORM == PLATFORM_MSW)
 
123
    {
 
124
        project.AddIncludeDir(SFMLPathDefaultInc);
 
125
        project.AddLibDir(SFMLPathDefaultLib);
 
126
 
 
127
        // add link libraries
 
128
        project.AddLinkLib(_T("mingw32"));
 
129
        project.AddLinkLib(_T("sfml-audio.dll"));
 
130
        project.AddLinkLib(_T("sfml-graphics.dll"));
 
131
        project.AddLinkLib(_T("sfml-network.dll"));
 
132
        project.AddLinkLib(_T("sfml-system.dll"));
 
133
        project.AddLinkLib(_T("sfml-window.dll"));
 
134
        project.AddLinkLib(_T("user32"));
 
135
        project.AddLinkLib(_T("gdi32"));
 
136
        project.AddLinkLib(_T("winmm"));
 
137
        project.AddLinkLib(_T("dxguid"));
 
138
    }
 
139
    else if (PLATFORM == PLATFORM_MAC)
 
140
    {
 
141
        //project.AddCompilerOption(_T("-D_GNU_SOURCE=1 -D_THREAD_SAFE"));
 
142
        project.AddLinkerOption(_T("-framework SFML"));
 
143
        project.AddLinkLib(_T("sfml-audio"));
 
144
        project.AddLinkLib(_T("sfml-graphics"));
 
145
        project.AddLinkLib(_T("sfml-network"));
 
146
        project.AddLinkLib(_T("sfml-system"));
 
147
        project.AddLinkLib(_T("sfml-window"));
 
148
    }
 
149
    else
 
150
    {
 
151
        // unix way
 
152
        project.AddLinkLib(_T("sfml-audio"));
 
153
        project.AddLinkLib(_T("sfml-graphics"));
 
154
        project.AddLinkLib(_T("sfml-network"));
 
155
        project.AddLinkLib(_T("sfml-system"));
 
156
        project.AddLinkLib(_T("sfml-window"));
 
157
                // TODO: Enable these once SFML gets a sfml.pc
 
158
                //project.AddCompilerOption(_T("`pkg-config sfml --cflags`"));
 
159
        //project.AddLinkerOption(_T("`pkg-config sfml --libs`"));
 
160
    }
 
161
 
 
162
    // enable compiler warnings (project-wide)
 
163
    WarningsOn(project, Wizard.GetCompilerID());
 
164
 
 
165
    // Debug
 
166
    local target = project.GetBuildTarget(Wizard.GetDebugName());
 
167
    if (!IsNull(target))
 
168
    {
 
169
        target.SetTargetType(ttConsoleOnly); // ttConsoleOnly: console for debugging
 
170
        target.SetOutputFilename(Wizard.GetDebugOutputDir() + Wizard.GetProjectName() + DOT_EXT_EXECUTABLE);
 
171
        // enable generation of debugging symbols for target
 
172
        DebugSymbolsOn(target, Wizard.GetCompilerID());
 
173
    }
 
174
 
 
175
    // Release
 
176
    target = project.GetBuildTarget(Wizard.GetReleaseName());
 
177
    if (!IsNull(target))
 
178
    {
 
179
        target.SetTargetType(ttExecutable); // ttExecutable: no console
 
180
        target.SetOutputFilename(Wizard.GetReleaseOutputDir() + Wizard.GetProjectName() + DOT_EXT_EXECUTABLE);
 
181
        // enable optimizations for target
 
182
        OptimizationsOn(target, Wizard.GetCompilerID());
 
183
    }
 
184
 
 
185
    return true;
 
186
}