Skip to content

Commit

Permalink
Describe cmake use of header-only target
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Feb 2, 2018
1 parent 1c7b751 commit 3dae258
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions doc/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ To build a `shared library`__ set the ``BUILD_SHARED_LIBS`` CMake variable to

__ http://en.wikipedia.org/wiki/Library_%28computing%29#Shared_libraries

Header-only usage with CMake
============================

You can add the ``fmt`` library directory into your project and include it in
your ``CMakeLists.txt`` file::

add_subdirectory(fmt)

or
::

add_subdirectory(fmt EXCLUDE_FROM_ALL)

to exclude it from ``make``, ``make all``, or ``cmake --build .``.

Settting up your target to use a header-only version of ``fmt`` is equaly easy::

target_link_libraries(<your-target> PRIVATE fmt-header-only)

Building the documentation
==========================

Expand Down

0 comments on commit 3dae258

Please sign in to comment.