| 1 |
Prerequisites |
| 2 |
============= |
| 3 |
|
| 4 |
- libodb http://www.codesynthesis.com/products/odb/ |
| 5 |
- Qt http://qt.nokia.com |
| 6 |
|
| 7 |
|
| 8 |
Building on UNIX |
| 9 |
================ |
| 10 |
|
| 11 |
The following build instructions are for the Linux/UNIX/Mac OS X |
| 12 |
operating systems as well as for Cygwin and MinGW on Windows. |
| 13 |
|
| 14 |
The standard autotools-based build system is used on these platforms. |
| 15 |
After unpacking the source code archive, change to the libodb-qt |
| 16 |
package directory (referred to as libodb-qt/ from now on) and run |
| 17 |
the configure script: |
| 18 |
|
| 19 |
./configure |
| 20 |
|
| 21 |
To see the available configuration options run configure with --help: |
| 22 |
|
| 23 |
./configure --help |
| 24 |
|
| 25 |
The configure script expects the libodb headers and libraries to be |
| 26 |
installed in a directory where the C++ compiler and linker will search |
| 27 |
for them by default (normally /usr and /usr/local). For Qt, the configure |
| 28 |
script uses the pkg-config utility to discover the locations of the Qt |
| 29 |
headers and libraries. |
| 30 |
|
| 31 |
If the above methods to locate libodb and Qt are not usable for your |
| 32 |
setup, you can use the CPPFLAGS and LDFLAGS configure variables to |
| 33 |
specify their locations, for example: |
| 34 |
|
| 35 |
./configure CPPFLAGS=-I/opt/libodb/include LDFLAGS=-L/opt/libodb/lib |
| 36 |
|
| 37 |
If libodb is not installed and you would like to use its build directory |
| 38 |
instead, you can use the --with-libodb configure options to specify its |
| 39 |
location, for example: |
| 40 |
|
| 41 |
./configure --with-libodb=/tmp/libodb |
| 42 |
|
| 43 |
As another example, the following configure command only builds shared |
| 44 |
libraries, uses the specified C++ compiler, and compiles with optimization |
| 45 |
and without debug information: |
| 46 |
|
| 47 |
./configure --disable-static CXX=g++-4.5 CXXFLAGS=-O3 |
| 48 |
|
| 49 |
Once configuration is complete, run make to build libodb-qt: |
| 50 |
|
| 51 |
make |
| 52 |
|
| 53 |
Once the build is completed successfully, you can install the libodb-qt |
| 54 |
headers and libraries using the install target (you may need to do this |
| 55 |
step as root depending on the installation directory): |
| 56 |
|
| 57 |
make install |
| 58 |
|
| 59 |
|
| 60 |
Building on Windows |
| 61 |
=================== |
| 62 |
|
| 63 |
The following build instructions are for Windows using Microsoft Visual |
| 64 |
Studio. If you would like to build libodb-qt with GCC either using |
| 65 |
Cygwin or MinGW, refer to the "Building on UNIX" section above. |
| 66 |
|
| 67 |
The standard Visual Studio project and solution files are used on this |
| 68 |
platform. The provided project files expect the libodb and Qt header |
| 69 |
and import library directories to be in the VC++ Directories Include and |
| 70 |
Library search lists. For libodb, see the INSTALL file in the package |
| 71 |
directory for more information on how to setup the VC++ Directories. For |
| 72 |
Qt, refer to the Qt documentation. |
| 73 |
|
| 74 |
To build libodb-qt, unpack the source code archive and open the |
| 75 |
libodb-qt-vc<N>.sln file located in the libodb-qt package directory |
| 76 |
(referred to as libodb-qt\ from now on). Here <N> is the version of |
| 77 |
Visual Studio that you are using. Once the solution is open, select the |
| 78 |
desired build configuration (Debug or Release) and platform (Win32 or |
| 79 |
x64) and build the solution. |
| 80 |
|
| 81 |
The resulting 32-bit DLLs and import libraries are placed into the |
| 82 |
libodb-qt\bin\ and libodb-qt\lib\ directories, respectively. Similarly, |
| 83 |
the 64-bit DLLs and import libraries are placed into libodb-qt\bin64\ and |
| 84 |
libodb-qt\lib64\. The Release versions of the import libraries are named |
| 85 |
odb-qt.lib and the Debug versions are named odb-qt-d.lib. |
| 86 |
|
| 87 |
To configure Visual Studio to automatically locate the libodb-qt headers, |
| 88 |
DLLs, and import libraries, add the following paths to your VC++ |
| 89 |
Directories: |
| 90 |
|
| 91 |
Win32: |
| 92 |
|
| 93 |
Include: ...\libodb-qt |
| 94 |
Library: ...\libodb-qt\lib |
| 95 |
Executable: ...\libodb-qt\bin |
| 96 |
|
| 97 |
x64: |
| 98 |
|
| 99 |
Include: ...\libodb-qt |
| 100 |
Library: ...\libodb-qt\lib64 |
| 101 |
Executable: ...\libodb-qt\bin64 |