diff --git a/.gitignore b/.gitignore index 57797e0..ecc66e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /build/ /doc/ /update_gh-pages.sh +/src/mastodon-cpp /src/examples/example99* diff --git a/CMakeLists.txt b/CMakeLists.txt index cb25364..f7d5fa5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastodon-cpp - VERSION 0.7.0 + VERSION 0.7.1 LANGUAGES CXX ) @@ -26,6 +26,10 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug") add_definitions(-DDEBUG=1) endif() +if(WITHOUT_EASY) + add_definitions(-DWITHOUT_EASY=1) +endif() + # Library if(WITHOUT_EASY) file(GLOB sources src/*.cpp src/api/*.cpp) @@ -39,16 +43,16 @@ set_target_properties(mastodon-cpp PROPERTIES ) if(WITHOUT_EASY) target_link_libraries(mastodon-cpp curlpp) - install(FILES src/mastodon-cpp.hpp - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mastodon-cpp) else() target_link_libraries(mastodon-cpp curlpp jsoncpp) - install(FILES src/mastodon-cpp.hpp src/easy/easy.hpp - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mastodon-cpp) endif() install(TARGETS mastodon-cpp LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install(FILES ${PROJECT_SOURCE_DIR}/src/mastodon-cpp.hpp - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(FILES src/mastodon-cpp.hpp + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mastodon-cpp) +if(NOT WITHOUT_EASY) + install(FILES src/easy/easy.hpp + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mastodon-cpp) +endif() # Documentation if(WITH_DOC) diff --git a/README.md b/README.md index 26764a4..9028417 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,16 @@ The HTML reference can be generated with `build_doc.sh`, if doxygen is installed Or just look in `src/mastodon-cpp.hpp`. It is also available at [tastytea.github.io/mastodon-cpp/](https://tastytea.github.io/mastodon-cpp/docs/classMastodon_1_1API.html). There are [examples](https://github.com/tastytea/mastodon-cpp/tree/master/src/examples) in `src/examples/`. +## Upgrading from below 0.7.0 + +The header location has changed. It is now in `mastodon-cpp/`. + ## Most basic example ```C++ #include #include -#include +#include int main() { @@ -85,8 +89,8 @@ To use the DEB package on stretch, you will need [libcurlpp0](https://packages.d * [libcurl](https://curl.haxx.se/) (tested: 7.58.0/7.35.0) * [curlpp](http://www.curlpp.org/) (tested: 0.8.1/0.7.3) * Optional + * Easy interface & Examples: [jsoncpp](https://github.com/open-source-parsers/jsoncpp) (tested: 1.8.1 / 1.7.2) * Documentation: [doxygen](https://www.stack.nl/~dimitri/doxygen/) (tested: 1.8.13) - * Examples: [jsoncpp](https://github.com/open-source-parsers/jsoncpp) (tested: 1.8.1 / 1.7.2) * DEB package: [dpkg](https://packages.qa.debian.org/dpkg) (tested: 1.19.0.5) * RPM package: [rpm](http://www.rpm.org) (tested: 4.11.0.1) @@ -112,6 +116,7 @@ Download the current release at [GitHub](https://github.com/tastytea/mastodon-cp cmake options: * `-DCMAKE_BUILD_TYPE=Debug` for a debug build + * `-DWITHOUT_EASY=ON` to not build the Easy abstractions and to get rid of the jsoncpp-dependency (not recommended) * `-DWITH_EXAMPLES=ON` if you want to compile the examples * `-DWITH_TESTS=ON` if you want to compile the tests * `-DWITH_DOC=ON` if you want to compile the HTML reference diff --git a/src/easy/easy.hpp b/src/easy/easy.hpp index 8dc4308..3cf06f0 100644 --- a/src/easy/easy.hpp +++ b/src/easy/easy.hpp @@ -21,7 +21,7 @@ #include #include #include -#include "mastodon-cpp.hpp" +#include "mastodon-cpp/mastodon-cpp.hpp" using std::string; using std::uint16_t; diff --git a/src/examples/example01_dump_json.cpp b/src/examples/example01_dump_json.cpp index 40d7db4..32ffdec 100644 --- a/src/examples/example01_dump_json.cpp +++ b/src/examples/example01_dump_json.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "../mastodon-cpp.hpp" +#include "mastodon-cpp/mastodon-cpp.hpp" using Mastodon::API; diff --git a/src/examples/example02_parse_account.cpp b/src/examples/example02_parse_account.cpp index 7cc9064..78d27db 100644 --- a/src/examples/example02_parse_account.cpp +++ b/src/examples/example02_parse_account.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "../mastodon-cpp.hpp" +#include "mastodon-cpp/mastodon-cpp.hpp" using Mastodon::API; using std::cout; diff --git a/src/examples/example03_mastocron.cpp b/src/examples/example03_mastocron.cpp index 21cfe44..e2c8108 100644 --- a/src/examples/example03_mastocron.cpp +++ b/src/examples/example03_mastocron.cpp @@ -11,7 +11,7 @@ #include #include #include -#include "../mastodon-cpp.hpp" +#include "mastodon-cpp/mastodon-cpp.hpp" using Mastodon::API; using std::cout; diff --git a/src/examples/example04_update_credentials.cpp b/src/examples/example04_update_credentials.cpp index 5c16fbe..0ae4991 100644 --- a/src/examples/example04_update_credentials.cpp +++ b/src/examples/example04_update_credentials.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "../mastodon-cpp.hpp" +#include "mastodon-cpp/mastodon-cpp.hpp" using Mastodon::API; diff --git a/src/examples/example05_follow_unfollow.cpp b/src/examples/example05_follow_unfollow.cpp index 0415e1a..05d7b95 100644 --- a/src/examples/example05_follow_unfollow.cpp +++ b/src/examples/example05_follow_unfollow.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "../mastodon-cpp.hpp" +#include "mastodon-cpp/mastodon-cpp.hpp" using Mastodon::API; diff --git a/src/examples/example06_toot_delete-toot.cpp b/src/examples/example06_toot_delete-toot.cpp index ef15012..5fda1a1 100644 --- a/src/examples/example06_toot_delete-toot.cpp +++ b/src/examples/example06_toot_delete-toot.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "../mastodon-cpp.hpp" +#include "mastodon-cpp/mastodon-cpp.hpp" using Mastodon::API; diff --git a/src/examples/example07_register_app.cpp b/src/examples/example07_register_app.cpp index fcfe855..1302900 100644 --- a/src/examples/example07_register_app.cpp +++ b/src/examples/example07_register_app.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "../mastodon-cpp.hpp" +#include "mastodon-cpp/mastodon-cpp.hpp" using Mastodon::API; diff --git a/src/examples/example08_rate_limiting.cpp b/src/examples/example08_rate_limiting.cpp index 1aeeedb..2e90d6d 100644 --- a/src/examples/example08_rate_limiting.cpp +++ b/src/examples/example08_rate_limiting.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "../mastodon-cpp.hpp" +#include "mastodon-cpp/mastodon-cpp.hpp" using Mastodon::API; diff --git a/src/examples/example09_streaming_api.cpp b/src/examples/example09_streaming_api.cpp index f05372e..127e38d 100644 --- a/src/examples/example09_streaming_api.cpp +++ b/src/examples/example09_streaming_api.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "../mastodon-cpp.hpp" +#include "mastodon-cpp/mastodon-cpp.hpp" using Mastodon::API; diff --git a/src/examples/example10_simplify.cpp b/src/examples/example10_simplify.cpp index 1cd9195..02b33da 100644 --- a/src/examples/example10_simplify.cpp +++ b/src/examples/example10_simplify.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "../mastodon-cpp.hpp" +#include "mastodon-cpp/mastodon-cpp.hpp" using Mastodon::API; diff --git a/src/examples/example11_post_media.cpp b/src/examples/example11_post_media.cpp index b93dd43..f9df024 100644 --- a/src/examples/example11_post_media.cpp +++ b/src/examples/example11_post_media.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "../mastodon-cpp.hpp" +#include "mastodon-cpp/mastodon-cpp.hpp" using Mastodon::API;