[ fromfile: reusinglibs.xml id: installingsoftware ]
After a library has been written and tested, it will be installed at the end of the build process in the directory specified by the
DESTDIR variable.
For example, the project file for our utils library contains the following relevant lines:
TEMPLATE = lib # Build this as a library, not as an application DESTDIR=$$(CPPLIBS) # Place the compiled shared object code here
For library templates, qmake can generate a Makefile with the install target so that the command
make install
will, after a successful build, copy the library to some particular location.
For example, on a *nix platform, the following lines could be added to the project file for utils:
target.path=/usr/lib INSTALLS += target
Then, if you have write access there, the command
make install
would copy the libutils.so files and their associated symlinks to the directory /usr/lib.
If you need to relocate a library, the procedure varies from platform to platform.
In Windows, you can copy its .dll file into an appropriate directory that is listed in your PATH variable.
In *nix, you can copy the shared object file and associated symbolic links into a directory that is listed in /etc/ld.so.conf or one that is findable by searching in LD_LIBRARY_PATH.
During development, it is usually sufficient to make and install libraries in your home directory, and adjust LD_LIBRARY_PATH appropriately.
At deployment time, on a *nix platform, it may be desirable to install the library in /usr/local, a systemwide location accessible to all other users.
This would require superuser permissions.
| Generated: $Date: 2008-06-09 14:08:23 -0400 (Mon, 09 Jun 2008) $ | © 2008 Alan Ezust and Paul Ezust. |