summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJosh Blum2013-07-25 21:15:02 -0700
committerJosh Blum2013-07-25 21:15:02 -0700
commitb877d078b11cb848b344f4f7534398f70157aa15 (patch)
treef6dd132e102929a1749e6d041370888a93a6a60d /lib
parente3fa9993cd1e0f9bb5aea8a065646200b8701519 (diff)
downloadsandhi-b877d078b11cb848b344f4f7534398f70157aa15.tar.gz
sandhi-b877d078b11cb848b344f4f7534398f70157aa15.tar.bz2
sandhi-b877d078b11cb848b344f4f7534398f70157aa15.zip
gras: make ptree usage optional on old boosts
Diffstat (limited to 'lib')
-rw-r--r--lib/CMakeLists.txt20
-rw-r--r--lib/top_block_query.cpp3
-rw-r--r--lib/top_block_query_no_ptree.cpp10
3 files changed, 28 insertions, 5 deletions
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 <boost/foreach.hpp>
#include <boost/format.hpp>
-#include <boost/property_tree/ptree.hpp>
#include <Theron/DefaultAllocator.h>
#include <algorithm>
#include <set>
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 "";
+}