Skip to content
cbastuck edited this page Oct 16, 2011 · 20 revisions

About

clay is a multiplatform middleware that allows you to prototype applications or build/use some helpers that can be useful in different domains. Besides, clay can be used as a framework for architectural designs in general.

clay is based on modules. A module is some piece of code that applies logic to its incoming data and produces a defined output. It is a black box, where you know the types of data that can be put into and you know what kind of information will be produced at the output. A module can be a single c++ class, but it also might contain a complex design layed-out in multiple classes. In the latter case, the module serves an entry point, a facade to the underlying subsystems. In general, modules hide complexity and provide an easy-to-use interface to a maybe very complex process.

So far nothing new. Some of these principles are the conepts behind object-oriented programming. Consequently, clay applies some ideas to the programs' runtime instead of its compile-time, in order to explore, prototype, and invent.

A single module is not of much use. The magic happens when creating semantics by connecting modules of different domains. Build your own boxes, share them, build a box of boxes again and again. Connect everything until it all makes sense. Connect everything!

Getting started

clay is based on freely available and, where possible, open technologies. Its compilation is currently assured on windows, using Visual Studio 2010 (Express), and linux systems, using gcc 4.x. In the following, you will find a step-by-step guide to get going on both. But first make sure that the following dependencies are met on your system.

  1. CMake 2.8 or later
  2. Boost 1.40.x or later
  3. Xerces-c 3.1.x or later
  4. Qt 4.6.x or later if you want to compile GUI related clay projects. (Optional)

Please note that these are built with the same compiler you want to use to build clay. In general all external dependencies that are used by_clay_ or its modules, are declared in individual configuration files below clay/externals. Here you can modify the location and name of each dependency according your system using the cmake language.

Windows

On windows make sure that the dependencies Boost, Xerces-c and Qt are compiled using the static c-runtime (multi-threaded/multi-threaded debug). For details check the information below.

Building clay

  1. Download and install Visual Studio 2010 Express Edition (available as free download)
  2. Download and install msysgit (Git for Windows)
  3. Open Git bash and create a folder at the location where you want to checkout clay (e.g. C:\clay) and go there (e.g. cd C:\clay)
  4. Checkout clay into a folder via Git Bash: git clone git://github.com/cbastuck/clay
  5. Open the "Visual Studio Command Prompt (2010)" (Start -> Programs -> Microsoft Visual Studio 2010 -> ...)
  6. Go to the clay checkout folder (e.g. cd C:\clay) and create a subfolder where you want to build clay (e.g. C:\clay\build)
  7. If you want to use a certain Qt version, type: set QTDIR="C:\Path to my\Qt\dir" (the directory one below its 'bin' folder)
  8. Enter the build directory (e.g. cd C:\clay\build) and type: cmake .. -G"Visual Studio 10"
  9. You will find a Visual Studio solution file in the current folder (e.g. C:\clay\build). Open it and compile clay using Visual Studio functionality.

Building Boost

The following explanation assumes you are building the libraries in clay's external folder for boost (i.e. clay/externals/boost). If you are building at a different location make sure to modify the according file config file (i.e. clay/externals/boost/config.cmake)

  1. Download Boost and unpack it (e.g. C:\clay\externals\boost)
  2. Go to the unpack location (e.g. cd C:\clay\externals\boost\boost_1_47_0) and type in VC command prompt: .\bootstrap.bat

For building 32 bit debug and release libraries:

  • .\b2 link=static threading=multi runtime-link=static debug --libdir=../../bin/x86/Debug --prefix=.. install
  • .\b2 link=static threading=multi runtime-link=static release --libdir=../../bin/x86/Release --prefix=.. install

For 64 bit debug and release libraries:

  • .\b2 link=static threading=multi runtime-link=static debug architecture=x86 address-model=64 --libdir=../../bin/x86-64/Debug --prefix=.. install
  • .\b2 link=static threading=multi runtime-link=static release architecture=x86 address-model=64 --libdir=../../bin/x86-64/Release --prefix=.. install

Building Xerces-C

  1. Download Xerces-C and unpack it (e.g. C:\clay\externals\xercesc)
  2. Apply the patch clay/externals/xercesc/XercesLib.vcxproj.patch to the unpack location.

This modifies the VC project file (projects/Win32/VC10/xerces-all/XercesLib) so the static c-runtime is used during compilation. Additionally the paths are changes so they match the according config.cmake file.

Building Qt

  1. Download [Qt] (http://qt.nokia.com/downloads) and unpack it (e.g. C:\clay\externals\qt)
  2. Type in VC command prompt .\configure
  3. Open the solution file that is generated during the second step and change the project settings regarding code-generation in order to use the static c-runtime during compilation for the projects core and gui.
  4. Build the projects core and gui using Visual Studio functionality.

Linux

Building on linux is easier than building on windows. Use your distribution's package manager to install all required libraries. Modify the configuration variables for external libraries in clay/externals according your needs.

On average the following steps should provide a working clay build:

  1. Checkout clay into the current folder (e.g. ~/clay) by typing to console: git clone git://github.com/cbastuck/clay
  2. Create a build directory, e.g. mkdir build and enter this afterwards (e.g. cd ~/clay/build)
  3. Generate makefiles by typing: cmake ..
  4. Build all target by typing: make all