Simple CURL wrapper for general usage
- Add it to your CMakeLists.txt
cmake_minimum_required(VERSION 3.13)
project(your_proj)
include(ExternalProject)
set(EXTERNAL_INSTALL_LOCATION ${CMAKE_BINARY_DIR}/external)
ExternalProject_Add(NetworkDownload
GIT_REPOSITORY https://github.com/wtlgo/Network.git
GIT_TAG v4.0.0
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
)
include_directories(${EXTERNAL_INSTALL_LOCATION}/include)
link_directories(${EXTERNAL_INSTALL_LOCATION}/lib)
add_executable(your_target main.cpp)
target_compile_features(your_target PRIVATE cxx_std_17)
add_dependencies(your_target NetworkDownload)
target_link_libraries(your_target Network)
- Use it
#include <iostream>
#include <wtlgo/Network.hpp>
int main() {
using namespace wtlgo;
std::cout << network.request("http://httpbin.org/ip") << std::endl;
return 0;
}
- ????
- PROFIT