Skip to content
Hunter Belanger edited this page Apr 8, 2020 · 1 revision

Unix-Like System

Requirements

Building exdir-cpp on a unix-like system is fairly straight forward. The requirements to build the libarrary are

  • A C++ compiler which supports the C++17 standard
  • CMake (Version 3.5 or higher) The recommended compilers are Clang >= 4.0 or GCC >= 7.0. This should not be an issue on most up-to-date GNU/Linux distributions. CMake may or may not be installed on your system already. Try running
$ cmake --version

in the terminal, and you should have output similar to

cmake version 3.16.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).

If not, you can install cmake using one of the following commands, depending on your system.

  • Ubuntu/Mint/Elementary
$ sudo apt install cmake
  • Arch/Manjaro
$ sudo pacman -S cmake
  • Fedora/CentOS
$ sudo dnf install cmake

Building

Once you are ready to get started, you should move to the directory where you would like to keep the source.

$ cd where\to\put\exdir\source

If you have git installed, you can use

$ git clone https://github.com/HunterBelanger/exdir-cpp.git

to download the source, which will be put into a folder called exdir-cpp. You can always download the source from the main github page though as a zip or tar, and extract it if you don't have git. Now we will create a new directory inside this newly created folder called build, and move into it:

$ mkdir exdir-cpp\build && cd exdir-cpp\build

This is where we will build the library. By default, a static and shared library will be made for exdir-cpp, and yaml-cpp as well (which comes with the source). To setup and run the build, run

$ cmake ..

and then

$ make -j

If you would like to only build the shared libraries, you can run

$ cmake -DBUILD_SHARED_LIBS=on ..

instead of the bare cmake command. If desired, you can install the libraries and header files with the $ make install command (this may require sudo if you don't change the install prefix). To change the install prefix, use the -DCMAKE_INSTALL_PREFIX=/dir/to/install/ with the cmake command, like:

$ cmake -DCMAKE_INSTALL_PREFIX=/dir/to/install/ ..

Windows

Exdir-cpp can be built using Microsoft Visual Studio, and has been tested with Visual Studio 2019. The Visual Studio CMake module should be installed. VS should automatically prepare the build based on the cmake files, and you can click build all to build the libraries. Currently, only the shared libraries will be built in VS. You will then have to manually move the .dll, .lib, and header files to your preferred location.

Clone this wiki locally