# Building from Source The source code is built using CMake, the process of building uscxml is essentially the same on every platform: 1. Read the [Platform Notes](#platform-notes) below to prepare your system. 2. Checkout uscxml into a convenient directory: git clone git://github.com/tklab-tud/uscxml.git 3. Create a new directory for an *out-of-source* build. I usually create sub-directories in <USCXML_SRC>/build/. 4. Run cmake (or ccmake / CMake-GUI) to create the files required by your actual build-system. 5. Use your actual build-system or development environment to build uscxml. 6. Read the SCXML draft and have a look at the tests to get started. If you want to build for another IDE or build-system, just create a new *out-of-source* build directory and start over with cmake. To get an idea of supported IDEs and build-environments on your platform, type cmake --help or run the CMake-GUI and look for the *Generators* section at the end of the output. Default on Unices is Makefiles. # Build Dependencies Overview of the uscxml dependencies. See the [Platform Notes](#platform-notes) for details. Note: We download pre-compiled versions of most dependencies at cmake configure-time. If you want to provide you own libraries, remove them from <USCXML_SRC>/contrib/prebuilt/ and provide your own.
PlatformDependencyVersionComment
Everyone CMake
required
>= 2.8.6 The build-system used for uscxml.
libevent
pre-compiled
>= 2.1.x Event queues with callbacks and the HTTP server.
curl
required
>= 7.29.0 URL downloads.
v8
pre-compiled
svn checkout ECMAScript datamodel implementation.
SWI Prolog
pre-compiled for unices
>= 6.3.x Prolog datamodel implementation.
glog
pre-compiled
>= 0.3.3 Logging library.
Arabica
pre-compiled
>= git checkout XML DOM / XPath / XML Events.
SQLite
optional
>= 3.7.15.2 Persistence and sqlite invoker.
OpenSceneGraph
optional
>= 3.1.X 3D invokers (scenegraph, osgconvert).
Doxygen
recommended
Used by make docs to generate documentation from source comments.
Mac OSX XCode
required
4.2.1 works Apples SDK with all the toolchains.
MacPorts
recommended
>= 2.0.3 Build system for a wide selection of open-source packages.
libxml2
pre-installed
>= 2.6.16 Actual XML parser used by Arabica.
Linux libxml2
required
>= 2.6.16 Actual XML parser used by Arabica.
Windows Visual Studio 10
required
v10 pro works As a student, you can get your version through MSAA.
# Platform Notes This section will detail the preparation of the respective platforms to ultimately compile uscxml. ## Mac OSX You will have to install cmake via Macports: sudo port install cmake The rest is pre-installed or downloaded at configure-time as pre-compiled libraries. Just download the source and invoke CMake to create Makefiles or a Xcode project. ### Console / Make $ cd $ mkdir -p build/cli && cd build/cli $ cmake ../.. [...] -- Build files have been written to: .../build/cli $ make You can test whether everything works by starting the mmi-browser with a test.scxml file: $ ./bin/mmi-browser ../../test/samples/uscxml/test-ecmascript.scxml ### Xcode $ cd $ mkdir -p build/xcode && cd build/xcode $ cmake -G Xcode ../.. [...] -- Build files have been written to: .../build/xcode $ open uscxml.xcodeproj You can of course reuse the same source directory for many build directories. ## Linux Depending on your distribution, you will most likely have apt-get or yum available as package managers. If you do not, I'll have to assume that you are knowledgable enough to resolve build dependencies on your own. ### Preparing *apt-get based* distributions This would be all distributions based on Debian, like Ubuntu, Linux Mint and the like. # build system and compiler $ sudo apt-get install git cmake cmake-curses-gui make g++ # uscxml required dependencies $ sudo apt-get install libxml2-dev libcurl4-openssl-dev There may still be packages missing due to the set of dependencies among packages in the various distributons. Try to run cmake and resolve dependencies until you are satisfied. ### Preparing *yum based* distributions This would be all distributions based on Redhat, e.g. Fedora. # build system and compiler $ sudo yum install git cmake cmake-gui gcc-c++ # uscxml required dependencies $ sudo yum install xml2-devel libcurl-devel #### Fedora 20 Here is a complete walk-through to get uscxml running on Fedora 20, starting with the net installer. # get us git and the developer tools $ sudo yum install git gcc-c++ cmake # uscxml required dependencies $ sudo yum install libxml2-devel libcurl-devel This is sufficient to get uscxml to build. If you want some more functionality, install some more libraries: # SWI prolog datamodel $ sudo yum install pl-devel # OpenAL invoker $ sudo yum install openal-soft-devel libsndfile-devel # scenegraph and osgconvert invoker $ sudo yum install OpenSceneGraph-devel mesa-libGL-devel # ffmpeg invoker (add repository from http://rpmfusion.org) $ sudo yum install ffmpeg-devel ffmpeg-compat-devel # calendar invoker $ sudo yum install libical-devel # expect invoker $ sudo yum install expect-devel ### Console / Make Instructions are a literal copy of building uscxml for MacOSX on the console from above: $ cd $ mkdir -p build/cli && cd build/cli $ cmake ../.. [...] -- Build files have been written to: .../build/cli $ make You can test whether everything works by starting the mmi-browser with a test.scxml file: $ ./bin/mmi-browser ../../test/samples/uscxml/test-ecmascript.scxml ### Eclipse CDT Note: Eclipse does not like the project to be a subdirectory in the source. You have to choose your build directory with the generated project accordingly. $ mkdir -p build/uscxml/eclipse && cd build/uscxml/eclipse $ cmake -G "Eclipse CDT4 - Unix Makefiles" [...] -- Build files have been written to: .../build/uscxml/eclipse Now open Eclipse CDT and import the out-of-source directory as an existing project into workspace, leaving the "Copy projects into workspace" checkbox unchecked. There are some more [detailed instruction](http://www.cmake.org/Wiki/Eclipse_CDT4_Generator) available in the cmake wiki as well. ### Compiling Dependencies If the packages in your distribution are too old, you will have to compile current binaries. This applies especially for SWI and CMake as they *need* to be rather current. Have a look at the build dependencies above for minimum versions. ## Windows Building from source on windows is somewhat more involved and instructions are necessarily in prose form. These instructions were created using Windows 7 and MS Visual Studio 2010. ### Prepare compilation 1. Use git to **checkout** the source from git://github.com/tklab-tud/uscxml.git into any convenient directory. 2. Start the **CMake-GUI** and enter the checkout directory in the "Where is the source code" text field. Choose any convenient directory to build the binaries in. 3. Hit "**Configure**" and choose your toolchain and compiler - I only tested with Visual Studio 10. Hit "Configure" again until there are no more red items in the list. If these instructions are still correct and you did as described above, you should be able to "Generate" the Visual Project Solution. Now you can generate the MS Visual Studio project file /uscxml.sln. Just open it up to continue in your IDE. Note: We only tested with the MSVC compiler. You can try to compile with MinGW but you would have to build all the dependent libraries as well.