diff options
Diffstat (limited to 'doc/src/deployment/deployment.qdoc')
-rw-r--r-- | doc/src/deployment/deployment.qdoc | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/doc/src/deployment/deployment.qdoc b/doc/src/deployment/deployment.qdoc index f4fa0133..3419bdf9 100644 --- a/doc/src/deployment/deployment.qdoc +++ b/doc/src/deployment/deployment.qdoc @@ -214,7 +214,7 @@ To use this approach, you must start by installing a static version of the Qt library: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 0 + \snippet snippets/code/doc_src_deployment.qdoc 0 We specify the prefix so that we do not overwrite the existing Qt installation. The example above only builds the Qt libraries, @@ -233,12 +233,12 @@ makefile and rebuild the application. First, we must go into the directory that contains the application: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 1 + \snippet snippets/code/doc_src_deployment.qdoc 1 Now run qmake to create a new makefile for the application, and do a clean build to create the statically linked executable: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 2 + \snippet snippets/code/doc_src_deployment.qdoc 2 You probably want to link against the release libraries, and you can specify this when invoking \c qmake. Note that we must set the @@ -247,7 +247,7 @@ To check that the application really links statically with Qt, run the \c ldd tool (available on most Unices): - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 3 + \snippet snippets/code/doc_src_deployment.qdoc 3 Verify that the Qt libraries are not mentioned in the output. @@ -295,17 +295,17 @@ the \l {tools/plugandpaint}{Plug & Paint} application. First, we must go into the directory that contains the application: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 4 + \snippet snippets/code/doc_src_deployment.qdoc 4 Now run qmake to create a new makefile for the application, and do a clean build to create the dynamically linked executable: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 5 + \snippet snippets/code/doc_src_deployment.qdoc 5 This builds the core application, the following will build the plugins: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 6 + \snippet snippets/code/doc_src_deployment.qdoc 6 If everything compiled and linked without any errors, we will get a \c plugandpaint executable and the \c libpnp_basictools.so and @@ -358,7 +358,7 @@ third approach since it is the most flexible. For example, a \c plugandpaint.sh script will look like this: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 7 + \snippet snippets/code/doc_src_deployment.qdoc 7 By running this script instead of the executable, you are sure that the Qt libraries will be found by the dynamic linker. Note @@ -371,7 +371,7 @@ \c plugins directory, or you can set the \c DESTDIR in the plugins' project files: - \snippet doc/src/snippets/code/doc_src_deployment.pro 8 + \snippet snippets/code/doc_src_deployment.pro 8 An archive distributing all the Qt libraries, and all the plugins, required to run the \l {tools/plugandpaint}{Plug & Paint} @@ -424,7 +424,7 @@ application using QApplication::addLibraryPath() or QApplication::setLibraryPaths(). - \snippet doc/src/snippets/code/doc_src_deployment.cpp 9 + \snippet snippets/code/doc_src_deployment.cpp 9 \section1 Application Dependencies @@ -433,7 +433,7 @@ To find out which libraries your application depends on, run the \c ldd tool (available on most Unices): - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 10 + \snippet snippets/code/doc_src_deployment.qdoc 10 This will list all the shared library dependencies for your application. Depending on configuration, these libraries must be @@ -534,13 +534,13 @@ built statically. To do this, go to a command prompt and type the following: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 11 + \snippet snippets/code/doc_src_deployment.qdoc 11 Remember to specify any other options you need, such as data base drivers, as arguments to \c configure. Once \c configure has finished, type the following: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 12 + \snippet snippets/code/doc_src_deployment.qdoc 12 This will build Qt statically. Note that we have used \c nmake in all the examples, but \c mingw32-make should be used for MinGW. @@ -556,13 +556,13 @@ {tools/plugandpaint}{Plug & Paint} application. First we must go into the directory that contains the application: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 13 + \snippet snippets/code/doc_src_deployment.qdoc 13 We must then run \c qmake to create a new makefile for the application, and do a clean build to create the statically linked executable: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 14 + \snippet snippets/code/doc_src_deployment.qdoc 14 You probably want to link against the release libraries, and you can specify this when invoking \c qmake. Now, provided that @@ -611,17 +611,17 @@ the \l {tools/plugandpaint}{Plug & Paint} application. First, we must go into the directory that contains the application: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 15 + \snippet snippets/code/doc_src_deployment.qdoc 15 Now run \c qmake to create a new makefile for the application, and do a clean build to create the dynamically linked executable: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 16 + \snippet snippets/code/doc_src_deployment.qdoc 16 This builds the core application, the following will build the plugins: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 17 + \snippet snippets/code/doc_src_deployment.qdoc 17 If everything compiled and linked without any errors, we will get a \c plugandpaint.exe executable and the \c pnp_basictools.dll and @@ -680,7 +680,7 @@ So to make the plugins available to our application, we have to create the \c plugins subdirectory and copy over the relevant DLLs: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 18 + \snippet snippets/code/doc_src_deployment.qdoc 18 An archive distributing all the Qt DLLs and application specific plugins required to run the \l {tools/plugandpaint}{Plug @@ -762,7 +762,7 @@ using QApplication::addLibraryPath() or QApplication::setLibraryPaths(). - \snippet doc/src/snippets/code/doc_src_deployment.cpp 19 + \snippet snippets/code/doc_src_deployment.cpp 19 One benefit of using plugins is that they can easily be made available to a whole family of applications. @@ -793,11 +793,11 @@ binary. Since Qt 4.1.3, the follwoing \c CONFIG options are available for embedding manifests: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 20 + \snippet snippets/code/doc_src_deployment.qdoc 20 To use the options, add - \snippet doc/src/snippets/code/doc_src_deployment.pro 21 + \snippet snippets/code/doc_src_deployment.pro 21 to your .pro file. The \c embed_manifest_dll option is enabled by default. The \c embed_manifest_exe option is NOT enabled by default. @@ -866,7 +866,7 @@ \l{Dependency Walker} tool. All you need to do is to run it like this: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 24 + \snippet snippets/code/doc_src_deployment.qdoc 24 This will provide a list of the libraries that your application depends on and other information. @@ -949,7 +949,7 @@ If you add a custom path using QApplication::addLibraryPath it could look like this: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 54 + \snippet snippets/code/doc_src_deployment.qdoc 54 Then qApp->libraryPaths() would return something like this: @@ -1016,7 +1016,7 @@ Add the following statement to your application's project file (\c{.pro}): - \snippet doc/src/snippets/code/doc_src_deployment.pro 26 + \snippet snippets/code/doc_src_deployment.pro 26 This tells \c qmake not to put the executable inside a bundle. @@ -1031,7 +1031,7 @@ cannot use plugins and that you must build the dependent libraries such as image formats, SQL drivers, and so on with static linking. - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 27 + \snippet snippets/code/doc_src_deployment.qdoc 27 You can check the various options that are available by running \c configure -help. @@ -1042,12 +1042,12 @@ makefile and rebuild the application. First, we must go into the directory that contains the application: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 28 + \snippet snippets/code/doc_src_deployment.qdoc 28 Now run \c qmake to create a new makefile for the application, and do a clean build to create the statically linked executable: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 29 + \snippet snippets/code/doc_src_deployment.qdoc 29 You probably want to link against the release libraries, and you can specify this when invoking \c qmake. If you have Xcode Tools @@ -1064,12 +1064,12 @@ You can check what other libraries your application links to using the \c otool: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 30 + \snippet snippets/code/doc_src_deployment.qdoc 30 Here is what the output looks like for the statically linked \l {tools/plugandpaint}{Plug & Paint}: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 31 + \snippet snippets/code/doc_src_deployment.qdoc 31 If you see \e Qt libraries in the output, it probably means that you have both dynamic and static Qt libraries installed @@ -1084,11 +1084,11 @@ For example, replace the following: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 32 + \snippet snippets/code/doc_src_deployment.qdoc 32 with this: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 33 + \snippet snippets/code/doc_src_deployment.qdoc 33 The \l {tools/plugandpaint}{Plug & Paint} example consists of several components: The core application (\l @@ -1139,24 +1139,24 @@ {tools/plugandpaint}{Plug & Paint} application. First, we must go to the directory that contains the application: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 34 + \snippet snippets/code/doc_src_deployment.qdoc 34 Run \c qmake to create a new makefile for the application, and do a clean build to create the dynamically linked executable: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 35 + \snippet snippets/code/doc_src_deployment.qdoc 35 This builds the core application. Use the following to build the plugins: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 36 + \snippet snippets/code/doc_src_deployment.qdoc 36 Now run the \c otool for the Qt frameworks, for example Qt Gui: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 37 + \snippet snippets/code/doc_src_deployment.qdoc 37 You would get the following output: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 38 + \snippet snippets/code/doc_src_deployment.qdoc 38 For the Qt frameworks, the first line (i.e. \c {path/to/Qt/lib/QtGui.framework/Versions/4/QtGui (compatibility @@ -1184,14 +1184,14 @@ the bundle. We will assume that we are in the directory where we built the bundle. - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 39 + \snippet snippets/code/doc_src_deployment.qdoc 39 First we create a \c Frameworks directory inside the bundle. This follows the Mac OS X application convention. We then copy the frameworks into the new directory. As frameworks contain symbolic links, we use the \c -R option. - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 40 + \snippet snippets/code/doc_src_deployment.qdoc 40 Then we run \c install_name_tool to set the identification names for the frameworks. The first argument after \c -id is the new @@ -1201,7 +1201,7 @@ names specifies that these frameworks are located in the directory directly under the \c Frameworks directory. - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 41 + \snippet snippets/code/doc_src_deployment.qdoc 41 Now, the dynamic linker knows where to look for QtCore and QtGui. We must ensure that the application also knows where to find the @@ -1212,7 +1212,7 @@ Finally, the QtGui framework depends on QtCore, so we must remember to change the reference for QtGui: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 42 + \snippet snippets/code/doc_src_deployment.qdoc 42 After this, we run \c otool again and see that the application can find the libraries. @@ -1234,20 +1234,20 @@ file, the plugins' \c .dylib files are in the \c plugins subdirectory under the \c plugandpaint directory. We just have to move this director. - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 43 + \snippet snippets/code/doc_src_deployment.qdoc 43 For example, If we run \c otool on the \l {tools/plugandpaintplugins/basictools}{Basic Tools} plugin's \c .dylib file, we get the following information. - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 44 + \snippet snippets/code/doc_src_deployment.qdoc 44 Then we can see that the plugin links to the Qt frameworks it was built against. As we want the plugins to use the framework in the application bundle, we change them the same way as we did for the application. For example for the Basic Tools plugin: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 45 + \snippet snippets/code/doc_src_deployment.qdoc 45 We must also modify the code in \c @@ -1255,7 +1255,7 @@ that the application finds the plugins. Add the following code to the \c mainwindow.cpp file: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 46 + \snippet snippets/code/doc_src_deployment.qdoc 46 \table \row @@ -1272,18 +1272,18 @@ Copy Qt's image format plugins into the bundle: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 47 + \snippet snippets/code/doc_src_deployment.qdoc 47 Use \c install_name_tool to link the plugins to the frameworks in the bundle: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 48 + \snippet snippets/code/doc_src_deployment.qdoc 48 Update the source code in \c tools/plugandpaint/main.cpp to look for the new plugins. After constructing the QApplication, we add the following code: - \snippet doc/src/snippets/code/doc_src_deployment.cpp 49 + \snippet snippets/code/doc_src_deployment.cpp 49 First, we tell the application to only look for plugins in this directory. In our case, we want the application to look for only those @@ -1364,7 +1364,7 @@ You can check which libraries your application is linking against by using \c otool. Run this with the application path as an argument: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 50 + \snippet snippets/code/doc_src_deployment.qdoc 50 Unlike the deployment processes on \l {Deploying an Application on X11 Platforms}{X11} and \l {Deploying an Application on @@ -1393,7 +1393,7 @@ variable to get \e{weak linking} to work for your application. You can add the following: - \snippet doc/src/snippets/code/doc_src_deployment.pro 51 + \snippet snippets/code/doc_src_deployment.pro 51 to your .pro file, and qmake will take care of this for you. |