Skip to content

Tutorial: Building STP using CMake on Linux

Manuel Sabogal edited this page May 26, 2014 · 1 revision

Building STP

Getting the dependencies

Actually STP depends on SFML2, pugixml and zlib to work. You can install them the software repository that you distribution has or compiling it by source.

In Ubuntu 14.04 you can download them using the command: sudo apt-get install libsfml-dev libpugixml-dev zlib1g-dev.

Getting the STP source code

Now download the latest STP source code here and extract it, cd into the extracted directory and run:

mkdir build
cd build
cmake ..
make

To install the library in your system (Recommended) use the command sudo make install.

Generate IDE projects

When you are running the cmake .. command you can tell CMake to build some projects for IDEs such as Code::Blocks, Eclipse CDT 4.0, KDevelop 3 or Sublime Text 2, those are the IDEs that actually CMake support.
To tell CMake what project build just add the -G GENERATOR_NAME option, where GENERATOR_NAME is the name of the CMake available project generators.

Examples:

cmake .. -G "Unix Makefiles"                   # Generates standard UNIX makefiles.
cmake .. -G "CodeBlocks - Unix Makefiles"      # Generates Code::Blocks project files.
cmake .. -G "Eclipse CDT4 - Unix Makefiles"    # Generates Eclipse CDT 4.0 project files.
cmake .. -G "KDevelop3"                        # Generates KDevelop 3 project files.
cmake .. -G "Sublime Text 2 - Unix Makefiles"  # Generates Sublime Text 2 project files.