diff --git a/CMakeLists.txt b/CMakeLists.txt index 49f2ae2a..d32dbd83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,7 @@ else() set(BENCHMARK_BUILD_32_BITS OFF CACHE BOOL "Build a 32 bit version of the library - unsupported when using MSVC)" FORCE) endif() option(BENCHMARK_ENABLE_INSTALL "Enable installation of benchmark. (Projects embedding benchmark may want to turn this OFF.)" ON) +option(BENCHMARK_INSTALL_DOCS "Enable installation of documentation." ON) # Allow unmet dependencies to be met using CMake's ExternalProject mechanics, which # may require downloading the source code. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1df8a4aa..19ff8857 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -118,7 +118,9 @@ if (BENCHMARK_ENABLE_INSTALL) NAMESPACE "${namespace}" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") - install( - DIRECTORY "${PROJECT_SOURCE_DIR}/docs/" - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}") + if (BENCHMARK_INSTALL_DOCS) + install( + DIRECTORY "${PROJECT_SOURCE_DIR}/docs/" + DESTINATION "${CMAKE_INSTALL_DOCDIR}") + endif() endif()