Building requires access to an installation of Geode. There are two ways to achieve this:
GEODE_HOMEthat points to your Geode installation path.
GEODE_ROOTduring the CMake configuration step.
-DGEODE_ROOT=/path/to/geodeto the initial
$ cd <clone> $ mkdir build $ cd build // configuration step $ cmake .. <platform-specific generator parameters (see below)> // build step $ cmake --build . -- <platform-specific parallelism parameters (see below)>
To explicitly specify the location in which the Native Client will be installed, add
-DCMAKE_INSTALL_PREFIX=/path/to/installation/destination to this initial
cmake execution command.
CMake uses a “generator” to produce configuration files for use by a variety of build tools, e.g., UNIX makefiles, Visual Studio projects. By default a system-specific generator is used by CMake during configuration. (Please see the CMake documentation for further information.) However, in many cases there is a better choice.
The recommended generator for most unix platforms is ‘Makefiles’ (default):
$ cmake ..
The recommended generator for Xcode is
$ cmake .. -G "Xcode"
When running cmake commands on Windows, be sure to use Visual Studio Native Tools Command Prompt so environment variables are set properly.
The recommended generator on Windows is
Visual Studio 14 2015 Win64:
$ cmake .. -G "Visual Studio 14 2015 Win64" -Thost=x64
For faster builds, use optional parallelism parameters in the last build step:
$ cmake --build . -- -j <# of jobs>
$ cmake --build . -- /m
If building with GCC or Clang you can enable C++ code coverage by adding
-DUSE_CPP_COVERAGE=ON to the CMake Generator command.
$ cmake ... -DUSE_CPP_COVERAGE=ON ...
You can then generate a C++ code coverage report by downloading lcov. After acquiring lcov, finish the Steps to build section above. Then, run the tests as described in the CONTRIBUTING.md. Finally, run the following commands from the
$ lcov --capture --directory . --output-file coverage.info $ genhtml coverage.info --output-directory coverage_report
You can then open the
index.html file in the
coverage_report directory using any browser.
By default a system-specific location is used by CMake as the destination of the
install target, e.g.,
/usr/local on UNIX system. To explicitly specify the location in which the Native Client will be installed, add
-DCMAKE_INSTALL_PREFIX=/path/to/installation/destination to the initial
cmake execution command.
Note: For consistent results, avoid using the “~” (tilde) abbreviation when specifying paths on the CMake command line. Interpretation of the symbol varies depending on the option being specified, and on the system or command shell in use.
Due to limitations in CMake, the documentation must be built as a separate step before installation:
$ cd <clone> $ cd build $ cmake --build . --target docs $ cmake --build . --target install
Xcode command line developer tools
$ xcode-select --install