• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# CMake build instructions
2
3## Recommended usage : Incorporating cpu_features into a CMake project
4
5  For API / ABI compatibility reasons, it is recommended to build and use
6  cpu_features in a subdirectory of your project or as an embedded dependency.
7
8  This is similar to the recommended usage of the googletest framework
9  ( https://github.com/google/googletest/blob/master/googletest/README.md )
10
11  Build and use step-by-step
12
13
14  1- Download cpu_features and copy it in a sub-directory in your project.
15      or add cpu_features as a git-submodule in your project
16
17  2- You can then use the cmake command `add_subdirectory()` to include
18     cpu_features directly and use the `cpu_features` target in your project.
19
20  3- Add the `cpu_features` target to the `target_link_libraries()` section of
21     your executable or of your library.
22
23## Enabling tests
24
25  CMake default options for cpu_features is Release built type with tests
26  disabled. To enable testing set cmake `BUILD_TESTING` variable to `ON`,
27  [.travis.yml](../.travis.yml) and [appveyor.yml](../appveyor.yml) have up to
28  date examples.
29