Skip to content

Hahn-Schickard/Oatpp-Swagger-Conan-Recipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oatpp-swagger conan package

This repository is a fork of original oatpp-swagger 669d8e4 conan recipe. This fork fixes missing headers bug as well as updates the Oat++ dependency to oatpp/1.3.0.latest.

Available Configuration Options

  • shared - builds dynamically linked targets
  • fPIC - enables Position Independent Code, used in conjunction with shared

Building the package

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.3.0 --user=hahn-schickard --channel=stable --build=missing

Using the package

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 .

Conanfile

Conanfile.txt

[requires]
oatpp-swagger/1.3.0@hahn-schickard/stable

[generators]
CMakeDeps
CMakeToolchain

[layout]
cmake_layout

[options]
oatpp-swagger/*:shared=False
oatpp-swagger/*:fPIC=True

Conanfile.py

from 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("oatpp-swagger/1.3.0@hahn-schickard/stable")

     def configure(self):
        self.options["oatpp-swagger/*"].shared=False
        self.options["oatpp-swagger/*"].fPIC=True

    def layout(self):
        cmake_layout(self)

Cmake

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(oatpp-swagger REQUIRED)

Add the following line to your CMakeLists.txt to link the library to your target:

target_link_libraries(YOUR_TARGET oatpp-swagger::oatpp-swagger)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors