From 7fd269fed19a82e396629ed718907211498b4348 Mon Sep 17 00:00:00 2001 From: BuildMonkey Date: Wed, 6 Aug 2025 12:15:25 +1200 Subject: [PATCH 1/3] 2011: Installing contents from benchmark's tools/ subdirectory. --- CMakeLists.txt | 1 + src/CMakeLists.txt | 6 ++++++ 2 files changed, 7 insertions(+) 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..3af5764b12 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -194,3 +194,9 @@ else() DESTINATION ${CMAKE_INSTALL_DOCDIR}) endif() endif() + +if (BENCHMARK_ENABLE_INSTALL AND BENCHMARK_INSTALL_TOOLS) + install( + DIRECTORY "${PROJECT_SOURCE_DIR}/tools/" + DESTINATION ${CMAKE_INSTALL_PREFIX}/tools) +endif() From 7ff7bb4a0884a93fa92ca2017c9f3614f0e77adb Mon Sep 17 00:00:00 2001 From: BuildMonkey Date: Thu, 7 Aug 2025 16:38:28 +1200 Subject: [PATCH 2/3] Incorporating feedback from the PR --- src/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3af5764b12..ff9e3eadd4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -195,8 +195,12 @@ else() endif() endif() +if (NOT DEFINED CMAKE_INSTALL_PYTOOLSDIR) + set(CMAKE_INSTALL_PYTOOLSDIR "${CMAKE_INSTALL_DATADIR}/googlebenchmark/tools" CACHE PATH "") +endif() + if (BENCHMARK_ENABLE_INSTALL AND BENCHMARK_INSTALL_TOOLS) install( DIRECTORY "${PROJECT_SOURCE_DIR}/tools/" - DESTINATION ${CMAKE_INSTALL_PREFIX}/tools) + DESTINATION ${CMAKE_INSTALL_PYTOOLSDIR}) endif() From ea3c256e184e6cf8d2b4030ab12be5d53fa31184 Mon Sep 17 00:00:00 2001 From: BuildMonkey Date: Wed, 13 Aug 2025 13:11:15 +1200 Subject: [PATCH 3/3] Per PR feedback, removing guards to when setting CMAKE_INSTALL_PYTOOLSDIR --- src/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ff9e3eadd4..8e5db4115e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -195,9 +195,7 @@ else() endif() endif() -if (NOT DEFINED CMAKE_INSTALL_PYTOOLSDIR) - set(CMAKE_INSTALL_PYTOOLSDIR "${CMAKE_INSTALL_DATADIR}/googlebenchmark/tools" CACHE PATH "") -endif() +set(CMAKE_INSTALL_PYTOOLSDIR "${CMAKE_INSTALL_DATADIR}/googlebenchmark/tools" CACHE PATH "") if (BENCHMARK_ENABLE_INSTALL AND BENCHMARK_INSTALL_TOOLS) install(