Skip to content
This repository was archived by the owner on Mar 14, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 44 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,47 @@ if(NOT MSVC AND NOT APPLE)
find_package(Threads REQUIRED)
endif()

find_package(OpenSSL REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Olm 2 REQUIRED)
find_package(sodium REQUIRED)
include(FeatureSummary)

find_package(OpenSSL)
set_package_properties(OpenSSL PROPERTIES
DESCRIPTION "Open source SSL and TLS implementation and cryptographic library"
URL "https://www.openssl.org/"
TYPE REQUIRED
)

find_package(ZLIB)
set_package_properties(ZLIB PROPERTIES
DESCRIPTION "A free compression library unencumbered by patents"
URL "https://www.zlib.net/"
TYPE REQUIRED
)

find_package(Olm 2)
set_package_properties(Olm PROPERTIES
DESCRIPTION "An implementation of the Double Ratchet cryptographic ratchet"
URL "https://git.matrix.org/git/olm/about/"
TYPE REQUIRED
)

find_package(sodium)
set_package_properties(sodium PROPERTIES
DESCRIPTION "A modern, portable, easy to use crypto library"
URL "https://github.com/jedisct1/libsodium"
TYPE REQUIRED
)

find_package(nlohmann_json 3.2.0)
set_package_properties(nlohmann_json PROPERTIES
DESCRIPTION "JSON for Modern C++, a C++11 header-only JSON class"
URL "https://nlohmann.github.io/json/"
TYPE REQUIRED
)

set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_STATIC_RUNTIME OFF)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.66 REQUIRED
find_package(Boost 1.66
COMPONENTS atomic
chrono
date_time
Expand All @@ -64,6 +96,11 @@ find_package(Boost 1.66 REQUIRED
regex
system
thread)
set_package_properties(Boost PROPERTIES
DESCRIPTION "Free peer-reviewed portable C++ source libraries"
URL "https://www.boost.org/"
TYPE REQUIRED
)

add_library(matrix_client
lib/http/client.cpp
Expand Down Expand Up @@ -153,6 +190,8 @@ if(BUILD_LIB_EXAMPLES)
add_subdirectory(examples)
endif()

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)

#
# Installation & Target configuration.
#
Expand Down
2 changes: 1 addition & 1 deletion deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ set(JSON_HEADER_URL
set(JSON_HEADER_HASH
ce6b5610a051ec6795fa11c33854abebb086f0fd67c311f5921c3c07f9531b44)

file(DOWNLOAD ${JSON_HEADER_URL} ${DEPS_INSTALL_DIR}/include/json.hpp
file(DOWNLOAD ${JSON_HEADER_URL} ${DEPS_INSTALL_DIR}/nlohmann/include/json.hpp
EXPECTED_HASH SHA256=${JSON_HEADER_HASH})

if(USE_BUNDLED_BOOST)
Expand Down
7 changes: 6 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
find_package(spdlog 1.0.0 CONFIG REQUIRED)
find_package(spdlog 1.0.0 CONFIG)
set_package_properties(spdlog PROPERTIES
DESCRIPTION "Very fast, header only, C++ logging library"
URL "https://github.com/gabime/spdlog"
TYPE REQUIRED
)

include_directories(../tests)

Expand Down
2 changes: 1 addition & 1 deletion examples/crypto_bot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <atomic>
#include <fstream>
#include <iostream>
#include <json.hpp>
#include <nlohmann/json.hpp>
#include <stdexcept>
#include <unistd.h>

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_bot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <boost/variant.hpp>

#include <iostream>
#include <json.hpp>
#include <nlohmann/json.hpp>
#include <unistd.h>

#include <mtx.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/common.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>

#include <map>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/errors.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>

#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/aliases.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>

using json = nlohmann::json;

Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/avatar.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>

using json = nlohmann::json;

Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/canonical_alias.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>

using json = nlohmann::json;

Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/common.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>

using json = nlohmann::json;

Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/create.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>

using json = nlohmann::json;

Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/encrypted.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>

#include "mtx/events.hpp"

Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/encryption.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>

using json = nlohmann::json;

Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/guest_access.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/history_visibility.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/join_rules.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/member.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/messages/audio.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

#include "mtx/events/common.hpp"
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/messages/emote.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/messages/file.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

#include "mtx/events/common.hpp"
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/messages/image.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

#include "mtx/events/common.hpp"
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/messages/notice.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/messages/text.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/messages/video.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

#include "mtx/events/common.hpp"
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/name.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/pinned_events.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/power_levels.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/redaction.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/tag.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/events/topic.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <string>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/identifiers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <exception>
#include <iostream>

#include <json.hpp>
#include <nlohmann/json.hpp>

namespace mtx {
namespace identifiers {
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/requests.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <string>

#include <json.hpp>
#include <nlohmann/json.hpp>
#include <mtx/common.hpp>

using json = nlohmann::json;
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/responses/common.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>

#include <string>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/responses/create_room.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>

namespace mtx {
namespace responses {
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/responses/crypto.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <json.hpp>
#include <nlohmann/json.hpp>

#include "mtx/common.hpp"

Expand Down
2 changes: 1 addition & 1 deletion include/mtx/responses/empty.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <string>

#include <json.hpp>
#include <nlohmann/json.hpp>

#include "mtx/identifiers.hpp"

Expand Down
2 changes: 1 addition & 1 deletion include/mtx/responses/groups.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "json.hpp"
#include <nlohmann/json.hpp>

namespace mtx {
namespace responses {
Expand Down
2 changes: 1 addition & 1 deletion include/mtx/responses/login.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <string>

#include <json.hpp>
#include <nlohmann/json.hpp>

#include "mtx/identifiers.hpp"

Expand Down
Loading