summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortastytea2020-01-18 23:51:34 +0100
committertastytea2020-01-18 23:51:34 +0100
commit161554e677a9d080479cf53ec1e93a508edd3cde (patch)
tree38026a253fcbd9cebab7c0487019ed9c2158868d
parent9bc3fe6fe248aa58fc16add1d58b5d7da9459563 (diff)
downloadmastodonpp-161554e677a9d080479cf53ec1e93a508edd3cde.tar
mastodonpp-161554e677a9d080479cf53ec1e93a508edd3cde.tar.gz
mastodonpp-161554e677a9d080479cf53ec1e93a508edd3cde.zip
Allow examples to build outside mastodonpp.
-rw-r--r--examples/example01_instance_info.cpp6
-rw-r--r--examples/example02_streaming.cpp6
-rw-r--r--examples/example03_post_status.cpp6
-rw-r--r--examples/example04_post_with_attachment.cpp6
-rw-r--r--examples/example05_update_notification_settings.cpp6
-rw-r--r--examples/example06_update_name.cpp6
-rw-r--r--examples/example07_delete_status.cpp6
-rw-r--r--examples/example08_obtain_token.cpp6
8 files changed, 40 insertions, 8 deletions
diff --git a/examples/example01_instance_info.cpp b/examples/example01_instance_info.cpp
index 97549a6..aa32b28 100644
--- a/examples/example01_instance_info.cpp
+++ b/examples/example01_instance_info.cpp
@@ -15,7 +15,11 @@
// Print information about an instance (/api/v1/instance).
-#include "mastodonpp.hpp"
+#if __has_include("mastodonpp.hpp")
+# include "mastodonpp.hpp" // We're building mastodonpp.
+#else
+# include <mastodonpp/mastodonpp.hpp> // We're building outside mastodonpp.
+#endif
#include <iostream>
#include <string>
diff --git a/examples/example02_streaming.cpp b/examples/example02_streaming.cpp
index 4a24b3c..748e5f8 100644
--- a/examples/example02_streaming.cpp
+++ b/examples/example02_streaming.cpp
@@ -15,7 +15,11 @@
// Print new public events (/api/v1/streaming/public).
-#include "mastodonpp.hpp"
+#if __has_include("mastodonpp.hpp")
+# include "mastodonpp.hpp" // We're building mastodonpp.
+#else
+# include <mastodonpp/mastodonpp.hpp> // We're building outside mastodonpp.
+#endif
#include <chrono>
#include <iostream>
diff --git a/examples/example03_post_status.cpp b/examples/example03_post_status.cpp
index 62fc919..bdf88dc 100644
--- a/examples/example03_post_status.cpp
+++ b/examples/example03_post_status.cpp
@@ -15,7 +15,11 @@
// Post a status (/api/v1/status).
-#include "mastodonpp.hpp"
+#if __has_include("mastodonpp.hpp")
+# include "mastodonpp.hpp" // We're building mastodonpp.
+#else
+# include <mastodonpp/mastodonpp.hpp> // We're building outside mastodonpp.
+#endif
#include <iostream>
#include <string>
diff --git a/examples/example04_post_with_attachment.cpp b/examples/example04_post_with_attachment.cpp
index f40170f..2f8b3db 100644
--- a/examples/example04_post_with_attachment.cpp
+++ b/examples/example04_post_with_attachment.cpp
@@ -15,7 +15,11 @@
// Post a status (/api/v1/status) with an attachment (/api/v1/media).
-#include "mastodonpp.hpp"
+#if __has_include("mastodonpp.hpp")
+# include "mastodonpp.hpp" // We're building mastodonpp.
+#else
+# include <mastodonpp/mastodonpp.hpp> // We're building outside mastodonpp.
+#endif
#include <iostream>
#include <string>
diff --git a/examples/example05_update_notification_settings.cpp b/examples/example05_update_notification_settings.cpp
index 5690265..f4c1fca 100644
--- a/examples/example05_update_notification_settings.cpp
+++ b/examples/example05_update_notification_settings.cpp
@@ -15,7 +15,11 @@
// Update notification settings (/api/pleroma/notification_settings).
-#include "mastodonpp.hpp"
+#if __has_include("mastodonpp.hpp")
+# include "mastodonpp.hpp" // We're building mastodonpp.
+#else
+# include <mastodonpp/mastodonpp.hpp> // We're building outside mastodonpp.
+#endif
#include <iostream>
#include <string>
diff --git a/examples/example06_update_name.cpp b/examples/example06_update_name.cpp
index 5232362..2db1a95 100644
--- a/examples/example06_update_name.cpp
+++ b/examples/example06_update_name.cpp
@@ -15,7 +15,11 @@
// Update account display name settings (/api/v1/accounts/update_credentials).
-#include "mastodonpp.hpp"
+#if __has_include("mastodonpp.hpp")
+# include "mastodonpp.hpp" // We're building mastodonpp.
+#else
+# include <mastodonpp/mastodonpp.hpp> // We're building outside mastodonpp.
+#endif
#include <iostream>
#include <string>
diff --git a/examples/example07_delete_status.cpp b/examples/example07_delete_status.cpp
index fc333b5..864ba9f 100644
--- a/examples/example07_delete_status.cpp
+++ b/examples/example07_delete_status.cpp
@@ -15,7 +15,11 @@
// Post a status (/api/v1/status), then delete it (/api/v1/statuses/:id).
-#include "mastodonpp.hpp"
+#if __has_include("mastodonpp.hpp")
+# include "mastodonpp.hpp" // We're building mastodonpp.
+#else
+# include <mastodonpp/mastodonpp.hpp> // We're building outside mastodonpp.
+#endif
#include <chrono>
#include <iostream>
diff --git a/examples/example08_obtain_token.cpp b/examples/example08_obtain_token.cpp
index 5a072a6..82ac39a 100644
--- a/examples/example08_obtain_token.cpp
+++ b/examples/example08_obtain_token.cpp
@@ -15,7 +15,11 @@
// Obtain an access token and verify that it works.
-#include "mastodonpp.hpp"
+#if __has_include("mastodonpp.hpp")
+# include "mastodonpp.hpp" // We're building mastodonpp.
+#else
+# include <mastodonpp/mastodonpp.hpp> // We're building outside mastodonpp.
+#endif
#include <cstdlib>
#include <iostream>