platformthemes.pro
branchGCC_SURGE
changeset 10 3bdc12ef1448
parent 8 02a1dd166f2b
child 9 a03989fb355a
equal deleted inserted replaced
5:10b7194ec8b4 10:3bdc12ef1448
     1 #
     1 #
     2 # Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 # ============================================================================
     3 # All rights reserved.
     3 #  Name        : platformthemes.pro
     4 # This component and the accompanying materials are made available
     4 #  Part of     : platformthemes
     5 # under the terms of "Eclipse Public License v1.0"
     5 #  Description : Project definition file for project platformthemes
     6 # which accompanies this distribution, and is available
     6 #  Version     : %version: %
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 #
     7 #
     9 # Initial Contributors:
     8 #  Copyright (c) 2008-2010 Nokia.  All rights reserved.
    10 # Nokia Corporation - initial contribution.
     9 #  This material, including documentation and any related computer
    11 #
    10 #  programs, is protected by copyright controlled by Nokia.  All
    12 # Contributors:
    11 #  rights are reserved.  Copying, including reproducing, storing,
    13 #
    12 #  adapting or translating, any or all of this material requires the
    14 # Description:  Project definition file for project platformthemes
    13 #  prior written consent of Nokia.  This material also contains
       
    14 #  confidential information which may not be disclosed to others
       
    15 #  without the prior written consent of Nokia.
       
    16 # ============================================================================
    15 #
    17 #
    16 
    18 
    17 NAME = platformthemes
    19 NAME = platformthemes
    18 TEMPLATE = subdirs
    20 TEMPLATE = subdirs
       
    21 EXCLUDE += --exclude \"*.orig\"
       
    22 EXCLUDE += --exclude \"*/distribution.policy.s60\"
       
    23 
       
    24 # ============================================================================
       
    25 # determine HB_THEMES_DIR
       
    26 # ============================================================================
    19 !symbian {
    27 !symbian {
    20     HB_THEMES_DIR = $$(HB_THEMES_DIR)
    28     HB_THEMES_DIR = $$(HB_THEMES_DIR)
    21     isEmpty(HB_THEMES_DIR) {
    29     isEmpty(HB_THEMES_DIR) {
    22         win32:ENV_HELP = eg. set HB_THEMES_DIR=C:\hb\themes
    30         win32:ENV_HELP = eg. set HB_THEMES_DIR=C:\hb\themes
    23         else:ENV_HELP = eg. export HB_THEMES_DIR=/usr/local/hb/themes
    31         else:ENV_HELP = eg. export HB_THEMES_DIR=/usr/local/hb/themes
    24         error(HB_THEMES_DIR environment variable is not set. ($$ENV_HELP))
    32         error(HB_THEMES_DIR environment variable is not set. ($$ENV_HELP))
    25     }
    33     }
    26 } else {
    34 } else {
    27     ARGS += --symbian
    35     HB_THEMES_DIR = $${EPOCROOT}epoc32/data/z/resource/hb
    28     nvg:ARGS += --nvg
       
    29     no_nvg:ARGS += --no-nvg
       
    30 }
    36 }
    31 ARGS += -v --input $$IN_PWD/src --output $$OUT_PWD/src --name $$NAME
    37 HB_THEMES_DIR = $$HB_THEMES_DIR/themes
    32 ARGS += --exclude \"*distribution.policy.s60\"
    38 
    33 !system(python $$IN_PWD/bin/sync.py $$ARGS) {
    39 win32:!win32-g++ {
    34     error(*** bin/sync.py reported an error. Stop.)
    40     unixstyle = false
       
    41 } else:symbian:isEmpty(QMAKE_SH) {
       
    42     unixstyle = false
       
    43 } else:win32-g++:isEmpty(QMAKE_SH) {
       
    44     unixstyle = false
       
    45 } else {
       
    46     unixstyle = true
    35 }
    47 }
    36 
    48 
    37 *symbian* {
    49 # ============================================================================
    38     THEMEINDEXER = bin\themeindexer_symbian.exe
    50 # extract archives
    39 } else {
    51 # ============================================================================
       
    52 ARGS = --input src --output $$OUT_PWD/tmp/src $$EXCLUDE
       
    53 !system(python bin/extract.py $$ARGS) {
       
    54     error(*** bin/extract.py reported an error. Stop.)
       
    55 }
    40 
    56 
    41     win32:!win32-g++ {
    57 # ============================================================================
    42         unixstyle = false
    58 # convert svg->nvg
    43     } else:win32-g++:isEmpty(QMAKE_SH) {
    59 # ============================================================================
    44         unixstyle = false
    60 symbian {
    45     } else {
    61     nvg|!no_nvg {
    46         unixstyle = true
    62         ARGS = --input $$OUT_PWD/tmp/src/icons
       
    63         !system(python bin/svg2nvg.py $$ARGS) {
       
    64             error(*** bin/svg2nvg.py reported an error. Stop.)
       
    65         }
    47     }
    66     }
       
    67 }
    48 
    68 
       
    69 # ============================================================================
       
    70 # theme indexing target
       
    71 # ============================================================================
       
    72 THEMEINDEXER = hbthemeindexer
       
    73 !symbian {
    49     $$unixstyle {
    74     $$unixstyle {
    50         DEVNULL = /dev/null
    75         DEVNULL = /dev/null
    51     } else {
    76     } else {
    52         DEVNULL = nul
    77         DEVNULL = nul
    53     }
    78     }
    54     THEMEINDEXER = themeindexer
       
    55     !system($$THEMEINDEXER > $$DEVNULL 2>&1) {
    79     !system($$THEMEINDEXER > $$DEVNULL 2>&1) {
    56         error('themeindexer' must be in PATH.)
    80         error(\'$$THEMEINDEXER\' must be in PATH.)
       
    81     }
       
    82 }
       
    83 ARGS = -s $$OUT_PWD/tmp/src -t $$OUT_PWD/tmp
       
    84 !system($$THEMEINDEXER $$ARGS) {
       
    85     error(*** $$THEMEINDEXER reported an error. Stop.)
       
    86 }
       
    87 
       
    88 index.path = $$(HB_THEMES_DIR)/themes
       
    89 index.files = $$OUT_PWD/tmp/*.themeindex
       
    90 INSTALLS += index
       
    91 QMAKE_CLEAN += $$OUT_PWD/tmp/*.themeindex
       
    92 
       
    93 # ============================================================================
       
    94 # generate installs.pri
       
    95 # ============================================================================
       
    96 ARGS = --input $$OUT_PWD/tmp/src --output $$OUT_PWD/tmp $$EXCLUDE
       
    97 !system(python bin/installs.py $$ARGS) {
       
    98     error(*** bin/installs.py reported an error. Stop.)
       
    99 }
       
   100 isEmpty(QMAKE_UNZIP):QMAKE_UNZIP = unzip -u -o
       
   101 include($$OUT_PWD/tmp/installs.pri)
       
   102 QMAKE_DISTCLEAN += $$OUT_PWD/tmp/installs.pri
       
   103 
       
   104 # ============================================================================
       
   105 # generate rom files
       
   106 # ============================================================================
       
   107 symbian {
       
   108     ARGS = --input $$OUT_PWD/tmp/src --output $$OUT_PWD/tmp $$EXCLUDE
       
   109     !system(python bin/rom.py $$ARGS) {
       
   110         error(*** bin/rom.py reported an error. Stop.)
       
   111     }
       
   112     QMAKE_CLEAN += $$OUT_PWD/tmp/*.iby
       
   113 }
       
   114 
       
   115 # ============================================================================
       
   116 # installs/exports
       
   117 # ============================================================================
       
   118 symbian {
       
   119 
       
   120     # theme exports
       
   121     exists(src/theme.theme) {
       
   122         BLD_INF_RULES.prj_exports += "src/theme.theme $${EPOCROOT}epoc32/data/z/resource/hb/themes/"
       
   123         BLD_INF_RULES.prj_exports += "src/theme.theme $${EPOCROOT}epoc32/winscw/c/resource/hb/themes/"
       
   124     }
       
   125     exists(rom/theme.theme.iby) {
       
   126         BLD_INF_RULES.prj_exports += "rom/theme.theme.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(theme.theme.iby)"
       
   127     }
       
   128 
       
   129     # params: <files> <target>
       
   130     defineTest(exportThemeFiles) {
       
   131         files = $$1
       
   132         target = $$2
       
   133         for(file, files) {
       
   134             # strip possible drive letter
       
   135             file = $$split(file, :)
       
   136             file = $$last(file)
       
   137             BLD_INF_RULES.prj_exports += "$$file $$target"
       
   138         }
       
   139         export(BLD_INF_RULES.prj_exports)
       
   140         return(true)
       
   141     }
       
   142     exportThemeFiles($$files($$OUT_PWD/tmp/*.iby), $$CORE_MW_LAYER_IBY_EXPORT_PATH())
       
   143     exportThemeFiles($$files($$OUT_PWD/tmp/*.themeindex), $${EPOCROOT}epoc32/data/z/resource/hb/themes/)
       
   144     exportThemeFiles($$files($$OUT_PWD/tmp/*.themeindex), $${EPOCROOT}epoc32/winscw/c/resource/hb/themes/)
       
   145 
       
   146     # configuration files - exporting removed from platformthemes
       
   147 #    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/confml/confml/hbtheme.confml            MW_LAYER_CONFML(hbtheme.confml)
       
   148 #    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/confml/implml/hbtheme_20022e82.crml     MW_LAYER_CRML(hbtheme_20022e82.crml)
       
   149 #    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/confml/implml/hbtheme.implml            MW_LAYER_CRML(hbtheme.implml)
       
   150 
       
   151 } else {
       
   152     exists(src/theme.theme) {
       
   153         theme.theme.path = $$(HB_THEMES_DIR)/themes
       
   154         theme.theme.files += src/theme.theme
       
   155         INSTALLS += theme.theme
    57     }
   156     }
    58 }
   157 }
    59 
   158 
    60 *symbian* {
   159 # ============================================================================
    61     # NOTE: temporarily disabled due to:
   160 # NOTE: qmake/s60 does not support INSTALLS
    62     #       "Qt: INTERNALL ERROR: failed to install GetMessage hook"
   161 # ============================================================================
    63     # BLD_INF_RULES.prj_mmpfiles += "gnumakefile makeindex.mk"
   162 symbian {
    64 
   163     install.depends += export
    65     install.depends = default
       
    66     uninstall.depends = cleanexport
   164     uninstall.depends = cleanexport
    67     QMAKE_EXTRA_TARGETS += install uninstall
   165     QMAKE_EXTRA_TARGETS += install uninstall
    68 }
   166 }
    69 index.path = .
       
    70 index.commands = $$THEMEINDEXER -f $$OUT_PWD/src/$${NAME}.txt
       
    71 QMAKE_EXTRA_TARGETS += index
       
    72 
   167 
    73 message(Run \'make install\')
   168 message(Run \'make install\')
    74 
       
    75 include($$OUT_PWD/src/$${NAME}.pri)
       
    76 
       
    77 # NOTE: must be after .pri include above!
       
    78 INSTALLS += index