From b877d078b11cb848b344f4f7534398f70157aa15 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 25 Jul 2013 21:15:02 -0700 Subject: gras: make ptree usage optional on old boosts --- lib/CMakeLists.txt | 20 +++++++++++++++++--- lib/top_block_query.cpp | 3 +-- lib/top_block_query_no_ptree.cpp | 10 ++++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 lib/top_block_query_no_ptree.cpp diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index ffd53af..749be10 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -83,14 +83,28 @@ list(APPEND GRAS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/output_handlers.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hier_block.cpp ${CMAKE_CURRENT_SOURCE_DIR}/top_block.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/top_block_query.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/json_parser.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/pmc_to_ptree.cpp ${CMAKE_CURRENT_SOURCE_DIR}/register_messages.cpp ${CMAKE_CURRENT_SOURCE_DIR}/weak_container.cpp ${CMAKE_CURRENT_SOURCE_DIR}/serialize_types.cpp ) +if (${Boost_VERSION} LESS 104100) + + message(WARNING "Boost library version < 104100 does not support property tree - GRAS will be compiled without query interface") + list(APPEND GRAS_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/top_block_query_no_ptree.cpp + ) + +else() + + list(APPEND GRAS_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/top_block_query.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/json_parser.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/pmc_to_ptree.cpp + ) + +endif() + ######################################################################## # Build library ######################################################################## diff --git a/lib/top_block_query.cpp b/lib/top_block_query.cpp index 8be8419..ccc5c29 100644 --- a/lib/top_block_query.cpp +++ b/lib/top_block_query.cpp @@ -1,10 +1,9 @@ // Copyright (C) by Josh Blum. See LICENSE.txt for licensing information. -#include "element_impl.hpp" #include "gras_impl/query_common.hpp" +#include "element_impl.hpp" #include #include -#include #include #include #include diff --git a/lib/top_block_query_no_ptree.cpp b/lib/top_block_query_no_ptree.cpp new file mode 100644 index 0000000..0ec6dd5 --- /dev/null +++ b/lib/top_block_query_no_ptree.cpp @@ -0,0 +1,10 @@ +// Copyright (C) by Josh Blum. See LICENSE.txt for licensing information. + +#include "element_impl.hpp" + +using namespace gras; + +std::string TopBlock::query(const std::string &) +{ + return ""; +} -- cgit