From 3dae25828f604ac06a50eea5d8df2a3feccfab90 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 1 Feb 2018 16:42:53 -0800 Subject: [PATCH] Describe cmake use of header-only target --- doc/usage.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/doc/usage.rst b/doc/usage.rst index 3045cb15..e4b3abf9 100644 --- a/doc/usage.rst +++ b/doc/usage.rst @@ -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( PRIVATE fmt-header-only) + Building the documentation ==========================