src: Adding conditional compilation against boost or bundled "ndnboost"
Change-Id: Ic6a9718d6cad920ffa7a1b4d74851a338ac6f5da
diff --git a/src/encoding/der/visitor/visitor.hpp b/src/encoding/der/visitor/visitor.hpp
index 5965ccb..06c469f 100644
--- a/src/encoding/der/visitor/visitor.hpp
+++ b/src/encoding/der/visitor/visitor.hpp
@@ -9,8 +9,15 @@
#ifndef NDN_DER_VISITOR_HPP
#define NDN_DER_VISITOR_HPP
+#include <ndn-cpp/common.hpp>
+
+#if NDN_CPP_USE_SYSTEM_BOOST
+#include <boost/any.hpp>
+namespace ndnboost = boost;
+#else
// We can use ndnboost::any because this is an internal header and will not conflict with the application if it uses boost::any.
#include <ndnboost/any.hpp>
+#endif
namespace ndn {
diff --git a/src/security/certificate/certificate.cpp b/src/security/certificate/certificate.cpp
index 82b6364..3275ac5 100644
--- a/src/security/certificate/certificate.cpp
+++ b/src/security/certificate/certificate.cpp
@@ -6,10 +6,20 @@
* See COPYING for copyright and distribution information.
*/
+#include <ndn-cpp/common.hpp>
+
#include <float.h>
+
+#if NDN_CPP_USE_SYSTEM_BOOST
+#include <boost/iostreams/stream.hpp>
+#include <boost/iostreams/device/array.hpp>
+namespace ndnboost = boost;
+#else
// We can use ndnboost::iostreams because this is internal and will not conflict with the application if it uses boost::iostreams.
#include <ndnboost/iostreams/stream.hpp>
#include <ndnboost/iostreams/device/array.hpp>
+#endif
+
#include <ndn-cpp/sha256-with-rsa-signature.hpp>
#include "../../encoding/der/der.hpp"
#include "../../encoding/der/visitor/certificate-data-visitor.hpp"
diff --git a/src/security/certificate/public-key.cpp b/src/security/certificate/public-key.cpp
index f57f5a6..fc41a94 100644
--- a/src/security/certificate/public-key.cpp
+++ b/src/security/certificate/public-key.cpp
@@ -6,10 +6,19 @@
* See COPYING for copyright and distribution information.
*/
+#include <ndn-cpp/common.hpp>
+
+#if NDN_CPP_USE_SYSTEM_BOOST
+#include <boost/iostreams/stream.hpp>
+#include <boost/iostreams/device/array.hpp>
+namespace ndnboost = boost;
+#else
// We can use ndnboost::iostreams because this is internal and will not conflict with the application if it uses boost::iostreams.
#include <ndnboost/iostreams/stream.hpp>
#include <ndnboost/iostreams/device/array.hpp>
-#include <ndn-cpp/security//security-exception.hpp>
+#endif
+
+#include <ndn-cpp/security/security-exception.hpp>
#include "../../c/util/crypto.h"
#include "../../encoding/der/der.hpp"
#include <ndn-cpp/security/certificate/public-key.hpp>
diff --git a/src/util/blob-stream.hpp b/src/util/blob-stream.hpp
index 53d7e52..e376b77 100644
--- a/src/util/blob-stream.hpp
+++ b/src/util/blob-stream.hpp
@@ -9,11 +9,19 @@
#ifndef NDN_BLOB_STREAM_HPP
#define NDN_BLOB_STREAM_HPP
+#include <ndn-cpp/common.hpp>
+
+#if NDN_CPP_USE_SYSTEM_BOOST
+#include <boost/iostreams/detail/ios.hpp>
+#include <boost/iostreams/categories.hpp>
+#include <boost/iostreams/stream.hpp>
+namespace ndnboost = boost;
+#else
// We can use ndnboost::iostreams because this is internal and will not conflict with the application if it uses boost::iostreams.
#include <ndnboost/iostreams/detail/ios.hpp>
#include <ndnboost/iostreams/categories.hpp>
#include <ndnboost/iostreams/stream.hpp>
-#include <ndn-cpp/common.hpp>
+#endif
namespace ndn {