From 90e827ba660b3346d554e73c25bc1ad229fd736e Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 14 Jan 2016 12:38:46 +0500 Subject: CMake: De-duplicate checks around unordered maps and shared pointer Previously several areas were calling TEST_SHARED_PTR_SUPPORT and TEST_UNORDERED_MAP_SUPPORT which isn't that bad on it's own but was causing some quite verbose output with same information line printed multiple times. additionally, what's more worse, define flags for Ceres were duplicated in main CMakeLists and Ceres's CMakeLists. Now we've got a single place where checks for those classes are happening and other areas are simply checking for variables set by those check macros, keeping CMake output clean and nice. --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 73d219e0e1c..e91f4b503a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -731,6 +731,9 @@ if(HAVE_STDBOOL_H) add_definitions(-DHAVE_STDBOOL_H) endif() +TEST_SHARED_PTR_SUPPORT() +TEST_UNORDERED_MAP_SUPPORT() + if(WITH_AUDASPACE) if(WITH_SYSTEM_AUDASPACE) set(AUDASPACE_DEFINITIONS @@ -2604,7 +2607,6 @@ endif() if(WITH_LIBMV) set(CERES_DEFINES) - TEST_SHARED_PTR_SUPPORT() if(SHARED_PTR_FOUND) if(SHARED_PTR_TR1_MEMORY_HEADER) list(APPEND CERES_DEFINES -DCERES_TR1_MEMORY_HEADER) @@ -2616,7 +2618,6 @@ if(WITH_LIBMV) message(FATAL_ERROR "Ceres: Unable to find shared_ptr.") endif() - TEST_UNORDERED_MAP_SUPPORT() if(HAVE_STD_UNORDERED_MAP_HEADER) if(HAVE_UNORDERED_MAP_IN_STD_NAMESPACE) list(APPEND CERES_DEFINES -DCERES_STD_UNORDERED_MAP) -- cgit v1.2.3