From 2aa22005f11e8b50d5dd5332e9e59104c1996b4c Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Fri, 6 Dec 2024 11:32:12 -0500 Subject: [PATCH 1/2] add CMake switch for GPerfTools --- cmake/FindGooglePerfTools.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/FindGooglePerfTools.cmake b/cmake/FindGooglePerfTools.cmake index f73f449ec..4af268528 100644 --- a/cmake/FindGooglePerfTools.cmake +++ b/cmake/FindGooglePerfTools.cmake @@ -36,3 +36,5 @@ MARK_AS_ADVANCED( GPERFTOOLS_TCMALLOC GPERFTOOLS_PROFILER ) + +option(GTSAM_ENABLE_GPERFTOOLS "Enable/Disable Gperftools" OFF) From c00de92854fce0038bf5e5ac3b49bbf45784a77e Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Fri, 6 Dec 2024 11:32:34 -0500 Subject: [PATCH 2/2] use the switch --- gtsam/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtsam/CMakeLists.txt b/gtsam/CMakeLists.txt index 9a4b6ac3a..87440d19f 100644 --- a/gtsam/CMakeLists.txt +++ b/gtsam/CMakeLists.txt @@ -147,7 +147,7 @@ if (GTSAM_USE_EIGEN_MKL) target_include_directories(gtsam PUBLIC ${MKL_INCLUDE_DIR}) endif() -if (GPERFTOOLS_FOUND) +if (GTSAM_ENABLE_GPERFTOOLS AND GPERFTOOLS_FOUND) target_link_libraries(gtsam PRIVATE ${GPERFTOOLS_TCMALLOC} ${GPERFTOOLS_PROFILER}) endif()