about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorComradeCrow <comradecrow@vivaldi.net>2023-03-24 02:08:51 -0700
committerComradeCrow <comradecrow@vivaldi.net>2023-03-24 02:08:51 -0700
commitf12eca235e59c0ea64d2c569674ea7ad31753215 (patch)
treeb8131413756f8d0f01957e373c7125423550566e
parent2d178326a3af7546b311aa9937176a092babfdfc (diff)
downloadytcpp-f12eca235e59c0ea64d2c569674ea7ad31753215.tar.gz
first steps
-rw-r--r--CMakeLists.txt19
-rw-r--r--LICENSE2
-rw-r--r--main.cpp12
3 files changed, 32 insertions, 1 deletions
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) <year> <copyright holders>
+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 <cpr/cpr.h>
+#include <iostream>
+
+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