0.12.0
Freundlich's C++ toolkit
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Requirements, Download and Installation

Contents

Requirements

fcppt needs the following at build time:

To build the documentation, you also need >= doxygen-1.7.5.

Tested Platforms

The following platforms are tested by us:

The list does not mean that fcppt won't work on other platforms.

Download

The latest fcppt release is 0.12.0. Get it here (SHA1).

fcppt is available through our public Git Repository:

git://github.com/freundlich/fcppt.git

Gentoo ebuilds are available in Freundlich's overlay at

git://github.com/freundlich/freundlich-gentoo.git

Building and Installation

Windows

Since we're using cmake on all platforms, building fcppt on Windows follows "the usual" cmake practice. If you've never used cmake before, you should read up on it. In a nutshell, cmake is a program which generates build files for different operating systems and IDEs. On Windows, cmake can generate a Visual Studio solution file, which you can then use to build the library.

We're intentionally not providing pre-built solutions or project files for Visual Studio because these files depend on your build configuration: which boost version you have, which architecture you are building on, which build type you are using, and so on. We would have to create lots of solution files, which is simply unpractical, and invoking cmake is pretty simple. For the same reason, we're not providing pre-built binaries. Sorry.

Download and extract the code and invoke either the cmake gui or the command-line version inside your designated build directory. Set the generator to the IDE you're using ("Visual Studio 10 Win64", for example). Also, explore the other build flags and set them to your desired configuration (for example, if you want to use fcppt as a static library, be sure to turn on ENABLE_STATIC). This is what your configuration might look like in the end:


cmake ^
        -D ENABLE_TEST=OFF ^
        -D ENABLE_EXAMPLES=OFF ^
        -D ENABLE_SHARED=OFF ^
        -D ENABLE_STATIC=ON ^
        -D CMAKE_INSTALL_PREFIX="" ^
        -D CMAKE_BUILD_TYPE="Release" ^
        -D Boost_USE_STATIC_LIBS=ON ^
        -G "Visual Studio 10 Win64" ^
        $fcppt_root_directory

Then, open the generated solution in Visual Studio and build the library.

Linux and OSX

First, download and extract the tarball or clone the git repository. Then, open a terminal and switch to the directory where fcppt is located. Now, while it is possible to invoke cmake from the project's root directory, this is not advised (and is, in fact, not possible with fcppt) since this will litter the source tree with build files. For that reason, create a build subdirectory and switch to it:

mkdir build;
cd build

Next, you have to call cmake and pass it fcppt's source directory as well as the installation prefix. Continuing the previous example,

cmake -D CMAKE_INSTALL_PREFIX="/home/me/local" ..

if you want to install fcppt to /home/me/local.

If you don't want to install fcppt, but use it directly from the source tree, you have to pass an empty installation prefix:

cmake -D CMAKE_INSTALL_PREFIX="" ..

There are other customizable paths that you can use to fine tune the installation of different components:

All of these will have default values depending on what you specified as CMAKE_INSTALL_PREFIX the first time you called cmake. If you want to change them later, you can do that as well.

You can, of course, also use ccmake to configure your installation.

cmake will generate a make file inside the build directory, so you can just say

make

and fcppt will be built. If you've specified a non-empty installation directory, then issuing

make install

will install fcppt to that directory.

Using fcppt

Using another build tool

The preferred way to use fcppt is cmake. If you're not using cmake in your project, you have to explicitly link against the fcppt libraries (remember, there is more than one library) and set your include directories appropriately.

Note that there are two directories containing fcppt header files. One is directly below the fcppt root directory (called include/), the other one is generated by cmake and resides directly below the build directory (and is also called include/). You have to specify both in order for fcppt to work. When fcppt installed, both will be installed into the same directory.

Using cmake

Modify your CMakeLists.txt

The following code is needed to use fcppt for one of your cmake targets, named mytarget here just for exposition.

find_package(
        fcppt
        REQUIRED
)
include_directories(
        ${fcppt_INCLUDE_DIRS}
)
add_definitions(
        ${fcppt_DEFINITIONS}
)
add_executable(
        mytarget
        main.cpp
)
target_link_libraries(
        mytarget
        ${fcppt_core_TARGET}
        ${fcppt_filesystem_TARGET}
)

Note, that we're explicitly specifying which of the fcppt libraries we're linking against, namely core and filesystem.

Just modifying your CMakeLists.txt might not work out of the box, however. Read on.

Using fcppt from the build directory

If you don't install fcppt, you should specify fcppt's build config directory using -D fcppt_DIR=fcppt_build_dir/config, where fcppt_build_dir is the path to fcppt's build directory.

Using fcppt from an installation

If fcppt is installed instead, it will install fcppt's config to INSTALL_CMAKECONFIG_DIR (which is usually /usr/lib/cmake), where cmake should be able to find it when find_package(fcppt) is used. If INSTALL_CMAKECONFIG_DIR is not automatically found, you can also set fcppt_DIR to point to it.

Static and shared builds

fcppt can be built as a static or shared library, which is controlled by ENABLE_STATIC and ENABLE_SHARED, respectively. If you intend to use fcppt as a static library you need to set fcppt_USE_STATIC_LIBS=ON before you call find_package(fcppt). Variables like fcppt_core_TARGET will automatically reflect the change and point to fcppt's static core library.

If you want to link fcppt to Boost statically, you can set Boost_USE_STATIC_LIBS=ON.