qtmobility.pro
changeset 0 876b1a06bc25
child 5 603d3f8b6302
equal deleted inserted replaced
-1:000000000000 0:876b1a06bc25
       
     1 # config.pri specifies the configure options and is pulled in via staticconfig.pri
       
     2 include(staticconfig.pri)
       
     3 !include($$QT_MOBILITY_BUILD_TREE/config.pri) {
       
     4     error("Please run configure script");
       
     5     #also fails if .qmake.cache was not generated which may
       
     6     #happen if we are trying to shadow build w/o running configure
       
     7 }
       
     8 
       
     9 #don't build QtMobility if chosen config mismatches Qt's config
       
    10 win32:!contains(CONFIG_WIN32,build_all) {
       
    11    contains(QT_CONFIG,debug):!contains(QT_CONFIG,release):contains(CONFIG_WIN32,release) {
       
    12        # Qt only build in debug mode
       
    13        error(QtMobility cannot be build in release mode if Qt is build in debug mode only)
       
    14    }
       
    15    !contains(QT_CONFIG,debug):contains(QT_CONFIG,release):contains(CONFIG_WIN32,debug) {
       
    16        # Qt only build in release mode
       
    17        error(QtMobility cannot be build in debug mode if Qt is build in release mode only)
       
    18    }
       
    19 }
       
    20 
       
    21 lessThan(QT_MAJOR_VERSION, 4) {
       
    22     error(Qt Mobility requires Qt 4.6 or higher. Qt $${QT_VERSION} was found.);
       
    23 }
       
    24 
       
    25 contains(QT_MAJOR_VERSION, 4):lessThan(QT_MINOR_VERSION, 6) {
       
    26     error(Qt Mobility requires Qt 4.6 or higher. Qt $${QT_VERSION} was found.);
       
    27 }
       
    28 
       
    29 
       
    30 # MCL builds for Symbian do not run configure and require some manual setup steps.
       
    31 # This test permits SD builds to skip installation of mobility.prf from within qmake.
       
    32 # It is installed in a separate step. MCL builds for SD must set the
       
    33 # MOBILITY_SD_MCL_BUILD flag to yes.
       
    34 !contains(MOBILITY_SD_MCL_BUILD, yes) {
       
    35     #generate prf file for Qt integration
       
    36     PRF_OUTPUT=$${QT_MOBILITY_BUILD_TREE}/features/mobility.prf
       
    37 
       
    38     system(echo MOBILITY_PREFIX=$${QT_MOBILITY_PREFIX} > $$PRF_OUTPUT)
       
    39     system(echo MOBILITY_INCLUDE=$${QT_MOBILITY_INCLUDE} >> $$PRF_OUTPUT)
       
    40     system(echo MOBILITY_LIB=$${QT_MOBILITY_LIB} >> $$PRF_OUTPUT)
       
    41 
       
    42     unix:!symbian:system(cat $${QT_MOBILITY_SOURCE_TREE}/features/mobility.prf.template >> $$PRF_OUTPUT)
       
    43     win32:system(type $${QT_MOBILITY_SOURCE_TREE}\features\mobility.prf.template >> $$PRF_OUTPUT)
       
    44     symbian:system(type $${QT_MOBILITY_SOURCE_TREE}\features\mobility.prf.template >> $$PRF_OUTPUT)
       
    45 
       
    46     PRF_CONFIG=$${QT_MOBILITY_BUILD_TREE}/features/mobilityconfig.prf
       
    47     system(echo MOBILITY_CONFIG=$${mobility_modules} > $$PRF_CONFIG)
       
    48     system(echo MOBILITY_VERSION = 1.0.2 >> $$PRF_CONFIG)
       
    49     system(echo MOBILITY_MAJOR_VERSION = 1 >> $$PRF_CONFIG)
       
    50     system(echo MOBILITY_MINOR_VERSION = 0 >> $$PRF_CONFIG)
       
    51     system(echo MOBILITY_PATCH_VERSION = 2 >> $$PRF_CONFIG)
       
    52 
       
    53     #symbian does not generate make install rule. we have to copy prf manually 
       
    54     symbian {
       
    55         FORMATDIR=$$[QT_INSTALL_DATA]\mkspecs\features
       
    56         FORMATDIR=$$replace(FORMATDIR,/,\\ )
       
    57         system(copy "$${QT_MOBILITY_BUILD_TREE}\features\mobility.prf $$FORMATDIR")
       
    58         system(copy "$${QT_MOBILITY_BUILD_TREE}\features\mobilityconfig.prf $$FORMATDIR")
       
    59     }
       
    60 
       
    61     # install config file
       
    62     config.path = $$[QT_INSTALL_DATA]/mkspecs/features
       
    63     config.files = $$QT_MOBILITY_BUILD_TREE/features/mobilityconfig.prf
       
    64 
       
    65     # install feature file
       
    66     feature.path = $$[QT_INSTALL_DATA]/mkspecs/features
       
    67     feature.files = $$QT_MOBILITY_BUILD_TREE/features/mobility.prf
       
    68     INSTALLS += feature config
       
    69 }
       
    70 
       
    71 TEMPLATE = subdirs
       
    72 CONFIG+=ordered
       
    73 
       
    74 SUBDIRS += src
       
    75 
       
    76 contains(build_tools, yes) {
       
    77     SUBDIRS += tools
       
    78 }
       
    79 
       
    80 SUBDIRS += plugins
       
    81 
       
    82 #built documentation snippets, if enabled
       
    83 contains(build_docs, yes) {
       
    84     SUBDIRS += doc
       
    85     include(doc/doc.pri)
       
    86 
       
    87     OTHER_FILES += doc/src/*.qdoc doc/src/examples/*.qdoc
       
    88 }
       
    89 
       
    90 contains(build_unit_tests, yes):SUBDIRS+=tests
       
    91 contains(build_examples, yes):SUBDIRS+=examples
       
    92 
       
    93 #updating and deployment of translations requires Qt 4.6.3/qtPrepareTool
       
    94 !symbian:defined(qtPrepareTool):SUBDIRS += translations
       
    95 
       
    96 # install Qt style headers
       
    97 
       
    98 !symbian {
       
    99     contains(mobility_modules,bearer) {
       
   100         qtmheadersbearer.path = $${QT_MOBILITY_INCLUDE}/QtBearer
       
   101         qtmheadersbearer.files = $${QT_MOBILITY_BUILD_TREE}/include/QtBearer/*
       
   102         INSTALLS += qtmheadersbearer
       
   103     }
       
   104 
       
   105     contains(mobility_modules,contacts) {
       
   106         qtmheaderscontacts.path = $${QT_MOBILITY_INCLUDE}/QtContacts
       
   107         qtmheaderscontacts.files = $${QT_MOBILITY_BUILD_TREE}/include/QtContacts/*
       
   108         INSTALLS += qtmheaderscontacts
       
   109     }
       
   110 
       
   111     contains(mobility_modules,location) {
       
   112         qtmheaderslocation.path = $${QT_MOBILITY_INCLUDE}/QtLocation
       
   113         qtmheaderslocation.files = $${QT_MOBILITY_BUILD_TREE}/include/QtLocation/*
       
   114         INSTALLS += qtmheaderslocation
       
   115     }
       
   116 
       
   117     contains(mobility_modules,messaging) {
       
   118         qtmheadersmessaging.path = $${QT_MOBILITY_INCLUDE}/QtMessaging
       
   119         qtmheadersmessaging.files = $${QT_MOBILITY_BUILD_TREE}/include/QtMessaging/*
       
   120         INSTALLS += qtmheadersmessaging
       
   121     }
       
   122 
       
   123     contains(mobility_modules,multimedia) {
       
   124         qtmheadersmultimedia.path = $${QT_MOBILITY_INCLUDE}/QtMultimediaKit
       
   125         qtmheadersmultimedia.files = $${QT_MOBILITY_BUILD_TREE}/include/QtMultimediaKit/*
       
   126         INSTALLS += qtmheadersmultimedia
       
   127     }
       
   128 
       
   129     contains(mobility_modules,publishsubscribe) {
       
   130         qtmheaderspubsub.path = $${QT_MOBILITY_INCLUDE}/QtPublishSubscribe
       
   131         qtmheaderspubsub.files = $${QT_MOBILITY_BUILD_TREE}/include/QtPublishSubscribe/*
       
   132         INSTALLS += qtmheaderspubsub
       
   133     }
       
   134 
       
   135     contains(mobility_modules,serviceframework) {
       
   136         qtmheaderssfw.path = $${QT_MOBILITY_INCLUDE}/QtServiceFramework
       
   137         qtmheaderssfw.files = $${QT_MOBILITY_BUILD_TREE}/include/QtServiceFramework/*
       
   138         INSTALLS += qtmheaderssfw
       
   139     }
       
   140 
       
   141     contains(mobility_modules,versit) {
       
   142         qtmheadersversit.path = $${QT_MOBILITY_INCLUDE}/QtVersit
       
   143         qtmheadersversit.files = $${QT_MOBILITY_BUILD_TREE}/include/QtVersit/*
       
   144         INSTALLS += qtmheadersversit
       
   145     }
       
   146 
       
   147     contains(mobility_modules,systeminfo) {
       
   148         qtmheaderssysteminfo.path = $${QT_MOBILITY_INCLUDE}/QtSystemInfo
       
   149         qtmheaderssysteminfo.files = $${QT_MOBILITY_BUILD_TREE}/include/QtSystemInfo/*
       
   150         INSTALLS += qtmheaderssysteminfo
       
   151     }
       
   152 
       
   153     contains(mobility_modules,sensors) {
       
   154         qtmheaderssensors.path = $${QT_MOBILITY_INCLUDE}/QtSensors
       
   155         qtmheaderssensors.files = $${QT_MOBILITY_BUILD_TREE}/include/QtSensors/*
       
   156         INSTALLS += qtmheaderssensors
       
   157     }
       
   158 } else {
       
   159     #absolute path does not work and 
       
   160     #include <QtMyLibrary/class.h> style does not work either
       
   161     qtmAppHeaders = include/QtContacts/* \
       
   162                           include/QtVersit/*
       
   163 
       
   164     qtmMwHeaders = include/QtBearer/* \
       
   165                        include/QtLocation/* \
       
   166                        include/QtMessaging/* \
       
   167                        include/QtMultimediaKit/* \
       
   168                        include/QtPublishSubscribe/* \
       
   169                        include/QtServiceFramework/* \
       
   170                        include/QtSystemInfo/* \
       
   171                        include/QtSensors/*
       
   172 
       
   173     contains(mobility_modules,contacts|versit) {
       
   174         for(api, qtmAppHeaders) {
       
   175             INCLUDEFILES=$$files($$api);
       
   176             #files() attaches a ';' at the end which we need to remove
       
   177             cleanedFiles=$$replace(INCLUDEFILES, ;,)
       
   178             cleanedFiles=$$replace(cleanedFiles, \\\,/)
       
   179             for(header, cleanedFiles) {
       
   180                 exists($$header):
       
   181                     BLD_INF_RULES.prj_exports += "$$header $$APP_LAYER_PUBLIC_EXPORT_PATH($$basename(header))"
       
   182             }
       
   183         }
       
   184     }
       
   185 
       
   186     contains(mobility_modules,serviceframework|location|bearer|publishsubscribe|systeminfo|multimedia|messaging) {
       
   187         for(api, qtmMwHeaders) {
       
   188             INCLUDEFILES=$$files($$api);
       
   189             #files() attaches a ';' at the end which we need to remove
       
   190             cleanedFiles=$$replace(INCLUDEFILES, ;,)
       
   191             cleanedFiles=$$replace(cleanedFiles, \\\, /)
       
   192             for(header, cleanedFiles) {
       
   193                 exists($$header):
       
   194                     BLD_INF_RULES.prj_exports += "$$header $$MW_LAYER_PUBLIC_EXPORT_PATH($$basename(header))"
       
   195             }
       
   196         }
       
   197     }
       
   198 }
       
   199