summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/symbian/application_icon.prf
blob: 110906065f27b95ac4dafd11931322e68ec19551 (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
load(data_caging_paths)

# If no_icon keyword exist, the S60 UI app is just made hidden. This because S60 app FW
# requires the registration resource file to exist always
contains( CONFIG, no_icon ) {
    symbian:RSS_RULES += "hidden = KAppIsHidden;"
    CONFIG -= no_icon
} else {
# There is no point in compiling the MIF icon if no_icon CONFIGS is set
    !isEmpty(ICON) {

        !count(ICON, 1) {
            ICON = $$first(ICON)
            warning("Only first icon specified in ICON variable is used: $$ICON")
        }

        # Try to produce indentical string to fixedTarget in SymbianMakefileGenerator, replaced chars taken
        # from SymbianCommonGenerator::removeSpecialCharacters.
        #
        # Note: it is not a major problem even baseTarget is not 100% identical to fixedTarget since qmake
        # only uses filename from RSS_RULES.icon_file when referring to icon file name.
        baseTarget = $$basename(TARGET)
        baseTarget = $$replace(baseTarget, /,_)
        baseTarget = $$replace(baseTarget, \\,_)
        baseTarget = $$replace(baseTarget, " ",_)
        symbian-abld|symbian-sbsv2 {
            baseTarget = $$replace(baseTarget, -,_)
            baseTarget = $$replace(baseTarget, \.,_)
            baseTarget = $$replace(baseTarget, :,_)
        }

        # Note: symbian-sbsv2 builds can't utilize extra compiler for mifconv, so ICON handling is done in code
        !symbian-sbsv2 {
            #Makefile: requires paths with backslash
            ICON_backslashed = $$ICON
            contains(QMAKE_HOST.os, "Windows"):ICON_backslashed = $$replace( ICON_backslashed, /, \\)

            symbian-abld {
                mifIconZDir = ${ZDIR}$$APP_RESOURCE_DIR
            } else {
                isEmpty(DESTDIR) {
                    mifIconZDir = .
                } else {
                    mifIconZDir = $$DESTDIR
                }
            }

            # Extra compiler rules for mifconv
            mifconv.target = $$mifIconZDir/$${baseTarget}.mif
            # Based on: http://www.forum.nokia.com/document/Cpp_Developers_Library
            # svg-t icons should always use /c32 depth
            mifconv.commands = mifconv $$mifconv.target /c32 $$ICON_backslashed
            mifconv.depends = $$ICON
            PRE_TARGETDEPS += $$mifconv.target
            QMAKE_EXTRA_TARGETS += mifconv
            QMAKE_DISTCLEAN += $$mifconv.target
        }
        # Rules to use generated MIF file from symbian resources
        RSS_RULES.number_of_icons = $$size(ICON_backslashed)
        RSS_RULES.icon_file = $$APP_RESOURCE_DIR/$${baseTarget}.mif
    }
}