|
rdobuilder |
2a3bc1 |
From 1bd8098d3d5b7aa8e305e57b2451ab8f98a58965 Mon Sep 17 00:00:00 2001
|
|
rdobuilder |
2a3bc1 |
From: Vitaly Zaitsev <vitaly@easycoding.org>
|
|
rdobuilder |
2a3bc1 |
Date: Wed, 8 Sep 2021 19:40:25 +0200
|
|
rdobuilder |
2a3bc1 |
Subject: [PATCH] Optimized docs installation (#1225)
|
|
rdobuilder |
2a3bc1 |
|
|
rdobuilder |
2a3bc1 |
* Use GNUInstallDirs to install docs.
|
|
rdobuilder |
2a3bc1 |
|
|
rdobuilder |
2a3bc1 |
Signed-off-by: Vitaly Zaitsev <vitaly@easycoding.org>
|
|
rdobuilder |
2a3bc1 |
|
|
rdobuilder |
2a3bc1 |
* Added an option to disable docs installation.
|
|
rdobuilder |
2a3bc1 |
|
|
rdobuilder |
2a3bc1 |
Signed-off-by: Vitaly Zaitsev <vitaly@easycoding.org>
|
|
rdobuilder |
2a3bc1 |
---
|
|
rdobuilder |
2a3bc1 |
CMakeLists.txt | 1 +
|
|
rdobuilder |
2a3bc1 |
src/CMakeLists.txt | 8 +++++---
|
|
rdobuilder |
2a3bc1 |
2 files changed, 6 insertions(+), 3 deletions(-)
|
|
rdobuilder |
2a3bc1 |
|
|
rdobuilder |
2a3bc1 |
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
rdobuilder |
2a3bc1 |
index 49f2ae2a0..d32dbd83d 100644
|
|
rdobuilder |
2a3bc1 |
--- a/CMakeLists.txt
|
|
rdobuilder |
2a3bc1 |
+++ b/CMakeLists.txt
|
|
rdobuilder |
2a3bc1 |
@@ -25,6 +25,7 @@ else()
|
|
rdobuilder |
2a3bc1 |
set(BENCHMARK_BUILD_32_BITS OFF CACHE BOOL "Build a 32 bit version of the library - unsupported when using MSVC)" FORCE)
|
|
rdobuilder |
2a3bc1 |
endif()
|
|
rdobuilder |
2a3bc1 |
option(BENCHMARK_ENABLE_INSTALL "Enable installation of benchmark. (Projects embedding benchmark may want to turn this OFF.)" ON)
|
|
rdobuilder |
2a3bc1 |
+option(BENCHMARK_INSTALL_DOCS "Enable installation of documentation." ON)
|
|
rdobuilder |
2a3bc1 |
|
|
rdobuilder |
2a3bc1 |
# Allow unmet dependencies to be met using CMake's ExternalProject mechanics, which
|
|
rdobuilder |
2a3bc1 |
# may require downloading the source code.
|
|
rdobuilder |
2a3bc1 |
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
|
rdobuilder |
2a3bc1 |
index 1df8a4aa8..19ff8857a 100644
|
|
rdobuilder |
2a3bc1 |
--- a/src/CMakeLists.txt
|
|
rdobuilder |
2a3bc1 |
+++ b/src/CMakeLists.txt
|
|
rdobuilder |
2a3bc1 |
@@ -118,7 +118,9 @@ if (BENCHMARK_ENABLE_INSTALL)
|
|
rdobuilder |
2a3bc1 |
NAMESPACE "${namespace}"
|
|
rdobuilder |
2a3bc1 |
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
|
|
rdobuilder |
2a3bc1 |
|
|
rdobuilder |
2a3bc1 |
- install(
|
|
rdobuilder |
2a3bc1 |
- DIRECTORY "${PROJECT_SOURCE_DIR}/docs/"
|
|
rdobuilder |
2a3bc1 |
- DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}")
|
|
rdobuilder |
2a3bc1 |
+ if (BENCHMARK_INSTALL_DOCS)
|
|
rdobuilder |
2a3bc1 |
+ install(
|
|
rdobuilder |
2a3bc1 |
+ DIRECTORY "${PROJECT_SOURCE_DIR}/docs/"
|
|
rdobuilder |
2a3bc1 |
+ DESTINATION "${CMAKE_INSTALL_DOCDIR}")
|
|
rdobuilder |
2a3bc1 |
+ endif()
|
|
rdobuilder |
2a3bc1 |
endif()
|