| [556] | 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| [846] | 3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| [556] | 4 | ** All rights reserved.
|
|---|
| 5 | ** Contact: Nokia Corporation ([email protected])
|
|---|
| 6 | **
|
|---|
| 7 | ** This file is part of the documentation of the Qt Toolkit.
|
|---|
| 8 | **
|
|---|
| [846] | 9 | ** $QT_BEGIN_LICENSE:FDL$
|
|---|
| [556] | 10 | ** Commercial Usage
|
|---|
| 11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
|---|
| 12 | ** accordance with the Qt Commercial License Agreement provided with the
|
|---|
| [846] | 13 | ** Software or, alternatively, in accordance with the terms contained in a
|
|---|
| 14 | ** written agreement between you and Nokia.
|
|---|
| [556] | 15 | **
|
|---|
| [846] | 16 | ** GNU Free Documentation License
|
|---|
| 17 | ** Alternatively, this file may be used under the terms of the GNU Free
|
|---|
| 18 | ** Documentation License version 1.3 as published by the Free Software
|
|---|
| 19 | ** Foundation and appearing in the file included in the packaging of this
|
|---|
| 20 | ** file.
|
|---|
| [556] | 21 | **
|
|---|
| 22 | ** If you have questions regarding the use of this file, please contact
|
|---|
| 23 | ** Nokia at [email protected].
|
|---|
| 24 | ** $QT_END_LICENSE$
|
|---|
| 25 | **
|
|---|
| 26 | ****************************************************************************/
|
|---|
| 27 |
|
|---|
| 28 | /*!
|
|---|
| 29 | \page windowsce-customization.html
|
|---|
| 30 | \ingroup qtce
|
|---|
| 31 | \title Windows CE - Working with Custom SDKs
|
|---|
| 32 | \brief How to set up Qt for use with custom Windows CE SDKs.
|
|---|
| 33 |
|
|---|
| 34 | When working with a custom SDK for Windows CE, Qt provides an easy way
|
|---|
| 35 | to add support for it to your development environment. The following is
|
|---|
| [846] | 36 | a tutorial that covers how to create a specification for Qt for Windows
|
|---|
| [556] | 37 | CE platforms.
|
|---|
| 38 |
|
|---|
| 39 | \tableofcontents
|
|---|
| 40 |
|
|---|
| 41 | \section1 Creating a Custom Build Specification
|
|---|
| 42 |
|
|---|
| 43 | Create a subdirectory in the \c mkspecs folder of the Qt directory.
|
|---|
| 44 | New specifications for Qt for Windows CE following this naming convention:
|
|---|
| 45 |
|
|---|
| 46 | \snippet doc/src/snippets/code/doc_src_wince-customization.qdoc 0
|
|---|
| 47 |
|
|---|
| 48 | Using this convention makes it possible for \l{qmake} to identify that
|
|---|
| 49 | you are building Qt for Windows CE, and will customize the compilation
|
|---|
| 50 | process accordingly.
|
|---|
| 51 |
|
|---|
| 52 | Create the files \c qmake.conf and \c qplatformdefs.h inside the new
|
|---|
| 53 | specification directory. Take a look at the implementation of the other
|
|---|
| 54 | Windows CE specifications included in the \c mkspecs directory to see
|
|---|
| 55 | what is required to build Qt for Windows CE successfully.
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 | \section1 Fine-Tuning Options
|
|---|
| 59 |
|
|---|
| 60 | Compared to the desktop versions, Qt for Windows CE needs two additional
|
|---|
| 61 | options:
|
|---|
| 62 |
|
|---|
| 63 | \list
|
|---|
| 64 | \o \bold{CE_SDK} specifies the name of the SDK.
|
|---|
| 65 | \o \bold{CE_ARCH} specifies information about the target architecture.
|
|---|
| 66 | \endlist
|
|---|
| 67 |
|
|---|
| 68 | Following is an example configuration for the Windows Mobile 5 for
|
|---|
| 69 | Pocket PC SDK:
|
|---|
| 70 |
|
|---|
| 71 | \snippet doc/src/snippets/code/doc_src_wince-customization.qdoc 1
|
|---|
| 72 |
|
|---|
| 73 | \note \l{qmake} uses this information to build a valid Visual Studio
|
|---|
| 74 | project file. You need to ensure that they are identical to the
|
|---|
| 75 | configuration of the custom SDK, otherwise you might not be able to compile
|
|---|
| 76 | or debug your project with Visual Studio.
|
|---|
| 77 |
|
|---|
| 78 | Additionally, most Windows CE SDKs use extra compiler options. These
|
|---|
| 79 | can be specified by expanding the \c DEFINES value.
|
|---|
| 80 |
|
|---|
| 81 | For example, with Windows Mobile 5 for Pocket PC, the \c DEFINES variable
|
|---|
| 82 | is expanded in the following way:
|
|---|
| 83 |
|
|---|
| 84 | \snippet doc/src/snippets/code/doc_src_wince-customization.qdoc 2
|
|---|
| 85 |
|
|---|
| 86 | The mkspec may require additional configuration to be used inside of Visual
|
|---|
| 87 | Studio, depending on the Windows CE SDK. The above example defines
|
|---|
| 88 | \c _M_ARM. This definition is available internally in Visual Studio. Hence,
|
|---|
| 89 | the compiler will warn you about redefinition during the build step. These
|
|---|
| 90 | warnings can be disabled by adding a \c default_post.prf file containing
|
|---|
| 91 | the following lines, within the subdirectory.
|
|---|
| 92 |
|
|---|
| 93 | \snippet doc/src/snippets/code/doc_src_wince-customization.qdoc 8
|
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 | \section1 Cross-compilation Environment for a Custom SDK
|
|---|
| 97 |
|
|---|
| 98 | Qt for Windows CE supports a convenience script, \c{setcepaths.bat}, that
|
|---|
| 99 | prepares the environment in a command prompt for cross-compilation.
|
|---|
| 100 | However, on custom SDKs, the \c checksdk tool is provided to identify the
|
|---|
| 101 | environment, so Qt compiles successfully.
|
|---|
| 102 |
|
|---|
| 103 | \c checksdk is generated during the \c configure step and allows for the
|
|---|
| 104 | following options:
|
|---|
| 105 |
|
|---|
| 106 | \list
|
|---|
| 107 | \o \c list: Returns a list of available Windows CE SDKs. (This list
|
|---|
| 108 | may contain one or more SDKs not supported on Qt for Windows CE,
|
|---|
| 109 | e.g., Pocket PC 2003.)
|
|---|
| 110 | \o \c sdk: The parameter to specify an SDK. Returns a setup of
|
|---|
| 111 | environment variables that must be set to cross-compile Qt.
|
|---|
| 112 | \o \c script: Stores your setup in a \c{.bat} file. This simplifies
|
|---|
| 113 | the process of switching environments when you load a command
|
|---|
| 114 | prompt in future.
|
|---|
| 115 | \endlist
|
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 | \section1 Compiling Qt for a Custom SDK
|
|---|
| 119 |
|
|---|
| 120 | Windows CE is highly customizable, hence it is possible that some SDKs have
|
|---|
| 121 | feature-stripped setups. Depending on the SDK's configuration, Qt may not
|
|---|
| 122 | compile in its standard configuration, as Qt for Windows CE is designed to
|
|---|
| 123 | be compatible with the Standard SDK setup.
|
|---|
| 124 |
|
|---|
| |
|---|