Moved another dependency

This commit is contained in:
kdeng00
2020-12-18 01:50:58 -05:00
parent 3ad04ca9a6
commit 231b12d60b
6 changed files with 21 additions and 27 deletions
-3
View File
@@ -4,9 +4,6 @@
[submodule "build/3rdparty/jwt-cpp"] [submodule "build/3rdparty/jwt-cpp"]
path = build/3rdparty/jwt-cpp path = build/3rdparty/jwt-cpp
url = https://github.com/Thalhammer/jwt-cpp url = https://github.com/Thalhammer/jwt-cpp
[submodule "3rdparty/jwt-cpp"]
path = 3rdparty/jwt-cpp
url = https://github.com/Thalhammer/jwt-cpp
[submodule "3rdparty/ormpp"] [submodule "3rdparty/ormpp"]
path = 3rdparty/ormpp path = 3rdparty/ormpp
url = https://github.com/qicosmos/ormpp url = https://github.com/qicosmos/ormpp
-1
Submodule 3rdparty/jwt-cpp deleted from 65b632b674
+9 -11
View File
@@ -90,19 +90,11 @@ set (BCRYPTLIB
${CMAKE_SOURCE_DIR}/3rdparty/libbcrypt ${CMAKE_SOURCE_DIR}/3rdparty/libbcrypt
) )
set(JWT_CPP_INCLUDE
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/jwt-cpp/include
)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
#find_library(BCRYPT bcrypt ${BCRYPTLIB}) #find_library(BCRYPT bcrypt ${BCRYPTLIB})
include_directories(include ${CPR_INCLUDE_DIRS} ${BCRYPTLIB}) include_directories(include ${BCRYPTLIB})
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/cpr)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/oatpp) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/oatpp)
add_library(bcrypt STATIC IMPORTED) add_library(bcrypt STATIC IMPORTED)
@@ -117,7 +109,13 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/database.json ${CMAKE_BINARY_DIR}/bin
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/paths.json ${CMAKE_BINARY_DIR}/bin/paths.json COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/paths.json ${CMAKE_BINARY_DIR}/bin/paths.json COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Images/Stock/CoverArt.png ${CMAKE_BINARY_DIR}/bin/CoverArt.png COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Images/Stock/CoverArt.png ${CMAKE_BINARY_DIR}/bin/CoverArt.png COPYONLY)
find_path(JWT_CPP_INCLUDE_DIRS "jwt-cpp/base.h")
find_package(nlohmann_json CONFIG REQUIRED)
find_package(cpr CONFIG REQUIRED)
add_executable(icarus ${SOURCES} ${HEADERS}) add_executable(icarus ${SOURCES} ${HEADERS})
target_include_directories(icarus PUBLIC ${JWT_CPP_INCLUDE})
target_link_libraries(icarus "-lstdc++fs" oatpp tag mysqlclient ${CONAN_LIBS} ${CPR_LIBRARIES} bcrypt) target_include_directories(icarus PRIVATE ${JWT_CPP_INCLUDE_DIRS})
target_link_libraries(icarus PRIVATE "-lstdc++fs" oatpp tag mysqlclient nlohmann_json nlohmann_json::nlohmann_json cpr bcrypt)
+9 -3
View File
@@ -21,6 +21,7 @@ One can interface with Icarus the music server either by:
* [cpr](https://www.github.com/whoshuu/cpr) * [cpr](https://www.github.com/whoshuu/cpr)
* [TagLib](https://github.com/taglib/taglib) * [TagLib](https://github.com/taglib/taglib)
* [jwt-cpp](https://github.com/Thalhammer/jwt-cpp) * [jwt-cpp](https://github.com/Thalhammer/jwt-cpp)
* libmysql
* [libbcrypt](https://github.com/rg3/libbcrypt) * [libbcrypt](https://github.com/rg3/libbcrypt)
* [oatpp](https://github.com/oatpp/oatpp) * [oatpp](https://github.com/oatpp/oatpp)
@@ -149,14 +150,19 @@ From this point the database has been successfully created. Metadata and song fi
## Building and Running ## Building and Running
``` ```
git clone --recursive https://github.com/kdeng00/icarus git clone --recursive https://github.com/kdeng00/icarus
cd 3rdparty/libbcrypt/
cd icarus/3rdparty/vcpkg
./bootstrap-vcpkg.sh
./vcpkg install nlohmann-json cpr taglib jwt-cpp
cd ../3rdparty/libbcrypt/
make make
cd ../.. cd ../..
mkdir build mkdir build
cd build cd build
conan install ..
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DUSE_SYSTEM_CURL=ON -DBUILD_CPR_TESTS=OFF -DOATPP_BUILD_TESTS=OFF cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DUSE_SYSTEM_CURL=ON -DBUILD_CPR_TESTS=OFF -DOATPP_BUILD_TESTS=OFF
make cmake --build .
bin/icarus bin/icarus
``` ```
Runs the server on localhost port 5002 Runs the server on localhost port 5002
-5
View File
@@ -1,5 +0,0 @@
[requires]
jsonformoderncpp/3.7.3@vthiery/stable
[generators]
cmake
+3 -4
View File
@@ -3,7 +3,6 @@
#include <iostream> #include <iostream>
#include <iterator> #include <iterator>
#include <fstream> #include <fstream>
#include <filesystem>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <sstream> #include <sstream>
@@ -11,8 +10,6 @@
#include "manager/DirectoryManager.h" #include "manager/DirectoryManager.h"
namespace fs = std::filesystem;
namespace manager { namespace manager {
model::Token TokenManager::retrieveToken(const model::BinaryPath& bConf) { model::Token TokenManager::retrieveToken(const model::BinaryPath& bConf) {
auto cred = parseAuthCredentials(bConf); auto cred = parseAuthCredentials(bConf);
@@ -93,7 +90,9 @@ namespace manager {
cpr::Response TokenManager::sendRequest(std::string_view uri, nlohmann::json& obj) { cpr::Response TokenManager::sendRequest(std::string_view uri, nlohmann::json& obj) {
auto resp = cpr::Post(cpr::Url{uri}, cpr::Body{obj.dump()}, const std::string uriString(uri.begin(), uri.end());
auto resp = cpr::Post(cpr::Url(uriString), cpr::Body{obj.dump()},
cpr::Header{{"Content-type", "application/json"}, cpr::Header{{"Content-type", "application/json"},
{"Connection", "keep-alive"}}); {"Connection", "keep-alive"}});