diff --git a/CMakeLists.txt b/CMakeLists.txt index b573ead887..413c56af75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,7 @@ endif() option(BENCHMARK_ENABLE_INSTALL "Enable installation of benchmark. (Projects embedding benchmark may want to turn this OFF.)" ON) option(BENCHMARK_ENABLE_DOXYGEN "Build documentation with Doxygen." OFF) option(BENCHMARK_INSTALL_DOCS "Enable installation of documentation." ON) +option(BENCHMARK_INSTALL_TOOLS "Enable installation of tools." 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 fe7325365f..8e5db4115e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -194,3 +194,11 @@ else() DESTINATION ${CMAKE_INSTALL_DOCDIR}) endif() endif() + +set(CMAKE_INSTALL_PYTOOLSDIR "${CMAKE_INSTALL_DATADIR}/googlebenchmark/tools" CACHE PATH "") + +if (BENCHMARK_ENABLE_INSTALL AND BENCHMARK_INSTALL_TOOLS) + install( + DIRECTORY "${PROJECT_SOURCE_DIR}/tools/" + DESTINATION ${CMAKE_INSTALL_PYTOOLSDIR}) +endif()