From 6859cef2674bf44384dd5ec6eac69d741698d58a Mon Sep 17 00:00:00 2001
From: Adrian Perez de Castro <aperez@igalia.com>
Date: Wed, 25 Oct 2017 14:47:16 +0300
Subject: [PATCH] cmake: Introduce a INSTALL_TOOLS build option

Packagers and distributors which use the CMake-based build system may
want to install the woff2_{decompress,compress,info} tools as well when
building shared libraries. Using "cmake -DINSTALL_TOOLS=ON" allows that.
---
 CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 68d1c62..619dc20 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,7 @@ include(GNUInstallDirs)
 
 # Build options
 option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+option(INSTALL_TOOLS "Install tools when building shared libraries" OFF)
 option(CANONICAL_PREFIXES "Canonical prefixes" OFF)
 option(NOISY_LOGGING "Noisy logging" ON)
 
@@ -260,7 +261,7 @@ generate_pkg_config ("${CMAKE_CURRENT_BINARY_DIR}/libwoff2enc.pc"
   LIBRARIES woff2enc)
 
 # Installation
-if (NOT BUILD_SHARED_LIBS)
+if (NOT BUILD_SHARED_LIBS OR INSTALL_TOOLS)
   install(
     TARGETS woff2_decompress woff2_compress woff2_info
     RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
