7.3. Deployment file organisation

7.3.1. Mac OS X

Mac OS X applications are usually shipped as bundles, which are usually placed in /Applications/. If you use the Xcode build of the dynamic version of the serialization library then it needs to be shipped in the /Contents/MacOS directory of your application, in other words, with your program executable, as shown here:

MyProgram.app/             (usually in /Applications/)
|
+---+ Contents/
    |
    +---- Info.plist
    |
    +---+ MacOS/
    |   |
    |   +---- MyProgram
    |   +---- libccs_serialization.dylib
    |   +---- libsqlite3.dylib
    |   +---- (etc.)
    |
    +---+ Resources/
        |
        +---- (etc.)

If you are shipping a command line tool, then put the libraries in the same directory as the tool executable.

If you want to place the libraries elsewhere, you will need to change the LD_DYLIB_INSTALL_NAME linker option, which is defined at the project level in the library's Xcode project.

7.3.2. Windows

Windows applications are usually shipped as executables inside a program directory inside the "Program Files" directory, and are usually placed there by an installer program or installer database file (.msi file). If you use the DLL version of the serialization library then the installed program will look something like this:

C:\
|
+---+ Program Files\
    |
    +---+ My Program\
        |
        +---- MyProgram.exe
        +---- ccs_serialization.dll
        +---- sqlite3.dll
        +---- (etc.)

In addition, the Visual C++ 2005 or 2008 C/C++ runtime libraries may not be on the target system, and your installer may need to install them. See the Visual C++ documentation for instructions on how to do this.

7.3.3. POSIX

If the program is built from source files, then the deployment picture will match the development picture shown above. Otherwise, deploying the dynamic library version of the serialization library could look something like this:

/home/<user-home-directory>/
|
+---+ bin/
|   |
|   +---- my_program       (the POSIX executable)
|
+---+ lib/                 (the PATH environment variable must include this directory)
    |
    +---- libsqlite.so
    +---- libccs_serialization.so
    +---- (etc.)

or like this:

/home/<user-home-directory>/
|
+---+ bin/
    |
    +---- my_program       (the POSIX executable)

/usr/local/
|
+---+ lib/
    |
    +---- libsqlite.so
    +---- libccs_serialization.so
    +---- (etc.)

You will need to build an installation package for the target system. Since there is no standard way to do this, you must consult the documentation for each packaging system.