Add CMake Build System File Generator Support #94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CMake is a widely used Build System Files Generator. This PR adds the support for CMake into Boost.uBLAS. As a result following things can be built with CMake
Configuration Controls
In order to build with CMake, you need to have either Boost installed or boost headers build from source using
b2 headers
. You can pass an option to CMake-DBOOST_HEADERS_DIR=<path_to_boost_headers>
and ublas will use those headers. If you skip this option, CMake will try to find a system installed Boost and use its include directories. If both of the above fails, CMake will fail and no build system files will be generated.Control the targets to build
By default, CMake will build system files for all of the above three (examples, test, benchmarks). If you want to quickly test something or want to build some specific targets. You can use the following flags:
Build Tensor and Benchmarks
b2 headers
only collects the header files. This is not sufficient to build Tensor examples or Benchmarks as they need to be linked against Boost.Test Framework and Boost.ProgramOptions. Regardless of whether you use a custom Boost header directory or let cmake find it. You will need installed boost to link against those libraries.