The customer architecture provides a simple way to add new port of OWB without impeding the current implementation. This architecture is based on CMake optional files: if they are present they will override OWB default value and / or extend them.
cmake/CustomerOptions.cmake:
The root of the customer architecture is the cmake/CustomerOptions.cmake which will determine the option used by your port. Such a file usually force some project-wise options in OWB. For example, such a file would look like:
set(USE_FILESYSTEM_ACCESS "POSIX" CACHE STRING "Choose the filesystem access method, options are: GLIB POSIX" FORCE) set(USE_FONTS "CAIRO" CACHE STRING "Choose the font engine, options are: CAIRO MYIMPLEMENTATION" FORCE) set(USE_I18N "ICU" CACHE STRING "Choose the internationalization library, options are: ICU GENERIC" FORCE) set(USE_THREADS "PTHREADS" CACHE STRING "Choose the thread backend, options are: GTHREADS PTHREADS NONE" FORCE) set(USE_TIMER "LINUX" CACHE STRING "Choose the timer backend, options are: GLIB LINUX" FORCE)
BAL/Customer/:
This file will hold the additions and overrides in the BAL directory (See BAL description for the current layout). As it is executed after all the OWB CMake files, it is easy to override only what you need and keep the rest of the architecture. Usually the directory will include a CMakeLists.txt to hold the instruction CMake should execute.
The best way to write your own CMakeLists.txt is to have a look at the other CMakeLists.txt inside the BAL directory.
Base/Customer/CMakeLists.txt:
If you need to change the default type used both by BAL and WebCore, you will need to add this file. The file look like the following:
if(USE_GRAPHICS_MY_COOL_LIB) set(CUSTOMER MY_COOL_LIB_NAME) set(BAL_TYPES_CUSTOMER_INCLUDE Customer/BALTypeMyCoolLib.h) set(WEBKIT_TYPES_CUSTOMER_INCLUDE Customer/WebKitTypesMyCoolLib.h) endif(USE_GRAPHICS_MY_COOL_LIB)
In the two files, you will set the types defined in BALType*.h and WebKitTypes.h. You can have a look at the official ports' implementation in this directory for help.
WebKit/OrigynWebBrowser/Customer/CMakeList.txt:
The idea here is the same as for the BAL directory. This CMake file will help you change the API directory as well as the WebCoreSupport. It is also executed after the default files.
WebKitTools/OWBLauncher/Customer/CMakeLists.txt:
You provide your own implementation of the OWB executable here. You can also add any files you may need to compile against the libwebkit-owb library in order to test it or show how to write a program using your backend.
Work process:
The usual process is to export the OWB tag you want to use after you have checked your own port base:
svn co http://mysvnserver.com/MyPort/trunk MyPort svn export --force http://www.sand-labs.org/svn/tags/Galeking MyPort
and you should have a working copy of your port to work with.
To go a bit further:
You can have a look at the different CMakeLists.txt in OWB as the Customer architecture magic lies within them.
