summaryrefslogtreecommitdiffstats
path: root/Packaging/QtSDK/qt.tools.cmake.xx.qs.in
blob: cb42a7127a814ca824cb6d3f7100b2ea88fa0995 (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
/****************************************************************************
**
** Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
** file Copyright.txt or https://cmake.org/licensing for details.
**
****************************************************************************/

// constructor
function Component()
{
    installer.valueChanged.connect( this, Component.prototype.reactOnTargetDirChange );
    // set the default values to CMAKE@CM_VER_XY@_DIR
    Component.prototype.reactOnTargetDirChange("TargetDir", installer.value("TargetDir"));
}

Component.prototype.reactOnTargetDirChange = function(key, value)
{
    if (key == "TargetDir") {
        var path = value + "/@CM_INST_PREF@";
        installer.setValue("CMAKE@CM_VER_XY@_DIR", path.replace(/\\/g, "/"));
    }
}

Component.prototype.createOperations = function()
{
    component.createOperations();

    if (installer.value("os") == "win") {
        try {
            if (installer.value("SDKToolBinary") == "")
                return;

            var cmId = component.name;
            installer.setValue("CMAKE@CM_VER_XY@_ID", cmId);

            component.addOperation("Execute",
                                   ["{0,2}", "@SDKToolBinary@", "addCMake",
                                    "--id", cmId,
                                    "--name", "@CMake_IFW_ROOT_COMPONENT_DISPLAY_NAME@",
                                    "--path", "@CM_VER_XY_DIR@/bin/cmake.exe",
                                    "UNDOEXECUTE",
                                    "@SDKToolBinary@", "rmCMake", "--id", cmId]);

        } catch( e ) {
            print( e );
        }
    }
}