Skip to content
Freeman Zhang edited this page Apr 29, 2015 · 9 revisions

Build from source.

Install the Dependencies

Install the following dependencies before build the source code.

Required:

Optional:

Install Dependencies in Mac OS X

The packages required above can be install through Homebrew:

$ brew install cmake openimageio boost freetype fontconfig glm glfw3

Install Dependencies in Linux

Note

Not all Linux distributions (e.g. Ubuntu 14.04, Fedora 21) provide GLFW 3.1+ or GLM 0.9.6.0+ in their default package repositories.

In this case, you have to install the correct versions from source manually:

https://github.com/g-truc/glm/releases

https://github.com/glfw/glfw/releases

Install Dependencies in ArchLinux

Use Pacman in ArchLinux:

$ sudo pacman -S cmake openimageio boost freetype fontconfig glm glfw

Install Dependencies in Ubuntu

Use apt-get in Ubuntu:

Install git and C++ compiler:

$ sudo apt-get install git g++

Install packages required by BlendInt:

$ sudo apt-get install cmake libopenimageio-dev libboost-dev libboost-filesystem-dev libboost-system-dev libboost-thread-dev libfreetype6-dev libfontconfig1-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev

Install packages required by GLFW3.1 if you need to install it from source code:

$ sudo apt-get install libxrandr-dev libxinerama-dev libxi-dev libxcursor-dev

Install Dependencies in Fedora

Use yum in Fedora:

Install git and C++ compiler:

$ sudo yum install git gcc-c++

Install packages required by BlendInt:

$ sudo yum install cmake OpenImageIO-devel boost-devel freetype-devel fontconfig-devel mesa-libGL-devel mesa-libGLU-devel

Install packages required by GLFW3.1 if you need to install it from source code:

$ sudo yum install libXrandr-devel libXinerama-devel libXi-devel libXcursor-devel

Get the Source

Use git to checkout the latest master:

$ git clone https://github.com/zhanggyb/BlendInt.git

If you want to build some demos too, checkout the 'demo' submodule:

$ git submodule update --init demo

If you want to compile unit test, checkout the 'test' submodule:

$ git submodule update --init test

To checkout all source code including submodules in one command:

$ git clone --recursive https://github.com/zhanggyb/BlendInt.git

Cmake Configuration

Available cmake options:

-DCMAKE_BUILD_TYPE=[Debug|Release]

-DCMAKE_INSTALL_PREFIX=[base path to install BlendInt (default: /usr/local)]

-DBUILD_STATIC_LIBRARY		// Build static library instead of shared (default: OFF)
-DENABLE_OPENCV				// Enable OpenCV support (default: OFF)
-DWITH_GPERFTOOLS			// Build with Google perftools option (default: OFF)
-DWITH_GLFW3_DEMO			// Build GLFW3 demos (default: OFF)
-DWITH_UNIT_TEST			// Build unit test (default: OFF)
-DBUILD_DOCUMENTATION		// Use Doxygen to create the HTML based API documentation (default: OFF)

Build

Build the Library

$ cd <blendint dir>
$ mkdir build
$ cd build
$ cmake ..
$ make

Build and Try the Demos

To build and run the demos, use additional cmake options:

$ cmake <source dir> -DWITH_GLFW3_DEMO=TRUE

To run a demo:

$ ./bin/tutorial01

Build and Run Unit Tests

To build the unit test, add -DWITH_UNIT_TEST=TRUE:

$ cmake <source dir> -DWITH_UNIT_TEST=TRUE

To run the unit tests:

$ ./bin/test<class name>

Installation

Install header files, binaries, html documentations with:

$ sudo make install

after build the source code.

By default it will install:

  • header files to /usr/local/include/blendint
  • binary library to /usr/local/lib/libblendint.* (.so or .a)
  • pkgconfig to /usr/local/lib/pkgconfig/blendint.pc
  • data files to /usr/local/share/blendint

You can check the install_maifest.txt in the build directory for a detailed list

Use cmake option -DCMAKE_INSTALL_PREFIX="your folder" to change the destination.

To build static library, add cmake option: -DBUILD_STATIC_LIBRARY=TRUE.

Table of Contents

  1. Home
  2. Roadmap
  3. Known Issues
  4. Build from Source
  5. Using BlendInt
    • H/W Requirements
    • Fontconfig and Fonts
    • Compile with BlendInt
      • "Hello World" example
      • Eclipse
      • Xcode
    • Tips
      • Use BlendInt in real time app
      • Use BlendInt in non-real time app
  6. Gallery
  7. Programming Guide
    • Basic Class Diagrams
    • Layout
    • Draw
      • Draw with OpenGL APIs
      • Draw with Predefined Shaders
    • Use event framework
    • Process HID events from window system
    • Memory Management
    • MVC for ListView/TreeView
    • Off-screen Render with FBO
    • Write your custom Widget
    • Write your custom Container
    • Themes
  8. API Reference
  9. Development
  10. FAQ
Clone this wiki locally