From f12eca235e59c0ea64d2c569674ea7ad31753215 Mon Sep 17 00:00:00 2001 From: ComradeCrow Date: Fri, 24 Mar 2023 02:08:51 -0700 Subject: first steps --- CMakeLists.txt | 19 +++++++++++++++++++ LICENSE | 2 +- main.cpp | 12 ++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 CMakeLists.txt create mode 100644 main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b11fdf7 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.26.0) + +project(ytcpp) + +add_executable(${PROJECT_NAME} main.cpp) + +set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) + +if(WIN32) # Install dlls in the same directory as the executable on Windows + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) +endif() + +include(FetchContent) +FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git + GIT_TAG c4713a704ca12237485ecbfec185f76c2a81bd09) +FetchContent_MakeAvailable(cpr) + +target_link_libraries(${PROJECT_NAME} PRIVATE cpr::cpr) diff --git a/LICENSE b/LICENSE index 2071b23..11c45b7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) +Copyright (c) 2023 comradecrow Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..a48631e --- /dev/null +++ b/main.cpp @@ -0,0 +1,12 @@ +#include +#include + +using namespace std; + +int main() { + + cpr::Response r = cpr::Get(cpr::Url{"https://httpbin.org/get"}); + cout << r.status_code << endl + << r.header["content-type"] << endl + << r.text << endl; +} \ No newline at end of file -- cgit 1.4.1-2-gfad0