This repository is a fork of conan-center-index/cpr 33dd2b2 commit repository
shared- builds dynamically linked targets, not available for Windows systemsfPIC- enables Position Independent Code, used in conjunction withsharedwith_ssl- enables encrypted message parsing, available values:False- disabled"openssl"- uses openssl as encryption provider"darwinssl"- uses darwinssl as encryption provider"winssl"- uses mbedtls as encryption provider
signal- enables using signal handlers for timeoutsverbose_logging- configures the logger for verbose logging
Important
Only run the following commands inside the root directory of this project.
Warning
Running the following commands outside the root directory of this project will either fail or create conan packages for other conan recipes.
To build the package locally, run the following command inside the project root:
conan create . --version=1.14.1 --user=hahn-schickard --channel=stable --build=missing
Important
DO NOT use the following instructions inside this project directory. Only run the following commands outside this project directory.
Warning
Running the following commands inside this project directory will fail.
To consume the package, define either conanfile.txt or conanfile.py files in your project and use conan to install the package.
This can be done by running the following in your project directory:
conan install . --output-folder=build --build=missing
This will install all of the dependencies inside the build directory, from which you can run the following cmake command to generate your build rules:
cmake .. -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake"
And once that is successful, the following cmake command to build your project:
cmake --build .
[requires]
cpr/1.14.1@hahn-schickard/stable
[generators]
CMakeDeps
CMakeToolchain
[layout]
cmake_layout
[options]
cpr/*:shared=False
cpr/*:fPIC=True
cpr/*:build_executable=False
cpr/*:with_ssl="openssl"
cpr/*:signal=True
cpr/*:verbose_logging=Falsefrom conan import ConanFile
from conan.tools.cmake import cmake_layout
class ExampleRecipe(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeDeps", "CMakeToolchain"
def requirements(self):
self.requires("cpr/1.14.1@hahn-schickard/stable")
def configure(self):
self.options["cpr/*"].shared=False
self.options["cpr/*"].fPIC=True
self.options["cpr/*"].build_executable=False
self.options["cpr/*"].with_ssl="openssl"
self.options["cpr/*"].signal=True
self.options["cpr/*"].verbose_logging=False
def layout(self):
cmake_layout(self)Once installed, conan will provide the cmake package and targets. This will be exposed as a standard CMake package.
Add the following line to your CMakeLists.txt to find the package:
find_package(cpr REQUIRED)Add the following line to your CMakeLists.txt to link the library to your target:
target_link_libraries(YOUR_TARGET cpr::cpr)