diff --git a/CMakeLists.txt b/CMakeLists.txt index 01ec1e525..07329aaf3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,9 +126,11 @@ if (BUILD_SDF) ################################################ # Find psutil python package for memory tests - find_python_module(psutil) - if (NOT PY_PSUTIL) - gz_build_warning("Python psutil package not found. Memory leak tests will be skipped") + if (BUILD_TESTING) + find_python_module(psutil) + if (NOT PY_PSUTIL) + gz_build_warning("Python psutil package not found. Memory leak tests will be skipped") + endif() endif() ########################################