From 0c6ea4057cc896cc79183ab37446bd8954ae2073 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Sun, 13 Oct 2013 22:55:59 +0000 Subject: [PATCH] Small cleanup on last commit --- CMakeLists.txt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ee67fb76..bf0fc1993 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -205,19 +205,14 @@ if(GTSAM_USE_TBB) else() list(APPEND possible_allocators BoostPool STL) set(preferred_allocator BoostPool) - if(GOOGLE_PERFTOOLS_FOUND) - list(APPEND possible_allocators tcmalloc) - endif() +endif() +if(GOOGLE_PERFTOOLS_FOUND) + list(APPEND possible_allocators tcmalloc) endif() -# Check if current allocator choice is valid +# Check if current allocator choice is valid and set cache option list(FIND possible_allocators "${GTSAM_DEFAULT_ALLOCATOR}" allocator_valid) if(allocator_valid EQUAL -1) - set(force_allocator true) -endif() - -# Set allocator cache option -if(force_allocator) set(GTSAM_DEFAULT_ALLOCATOR ${preferred_allocator} CACHE STRING "Default allocator" FORCE) else() set(GTSAM_DEFAULT_ALLOCATOR ${preferred_allocator} CACHE STRING "Default allocator")