Skip to content

Tooling

Morwenn edited this page Sep 16, 2019 · 17 revisions

cpp-sort offers some tooling support out-of-the-box, notably for CMake and Conan.

The library's repository does contain files specific to other tools, but most of those exist to properly instrument the continuous integration, so they are not documented here. If you have use for such files outside of continuous integration, please open a documentation issue.

CMake

Using cpp-sort

cpp-sort can be installed via CMake, in which case it exports a cpp-sort::cpp-sort target and all the files required for a basic integration. Once it has been installed on the system, the following lines should be enough to use it as a dependency:

find_package(cpp-sort REQUIRED)
target_link_libraries(my-target PRIVATE cpp-sort::cpp-sort)

Building cpp-sort

The project's CMake files do offer some options, but they are mainly used to configure the test suite and the examples:

  • BUILD_TESTING: whether to build the test suite, defaults to ON.
  • BUILD_EXAMPLES: whether to build the examples, defaults to OFF.
  • ENABLE_COVERAGE: whether to produce code coverage information when building the test suite, defaults to OFF.
  • USE_VALGRIND: whether to run the test suite through Valgrind, defaults to OFF.

New in version 1.6.0: added the option BUILD_EXAMPLES.

Conan

cpp-sort is available directly on conan-center. You can find the different versions available with the following command:

conan search cpp-sort --remote=conan-center

And then install any version to your local cache as follows (here with version 1.5.1):

conan install cpp-sort/1.5.1@morwenn/stable

The packages downloaded from conan-center are minimal and only contain the files required to use cpp-sort as a library: the headers, CMake files and licensing information. If you need anything else you have to use the source available in this GitHub repository.