diff --git a/cmake/FindGooglePerfTools.cmake b/cmake/FindGooglePerfTools.cmake index f73f449ecf..4af2685289 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) diff --git a/gtsam/CMakeLists.txt b/gtsam/CMakeLists.txt index 9a4b6ac3a5..87440d19f1 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()