71 lines
2.1 KiB
Python
71 lines
2.1 KiB
Python
from conan import ConanFile
|
|
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
|
|
from conan.tools.build import check_min_cppstd, can_run
|
|
|
|
|
|
class event_transformerRecipe(ConanFile):
|
|
name = "event_transformer"
|
|
version = "0.1"
|
|
package_type = "library"
|
|
|
|
# Optional metadata
|
|
license = "<Put the package license here>"
|
|
author = "<Put your name here> <And your email here>"
|
|
url = "<Package recipe repository url here, for issues about the package>"
|
|
description = "<Description of event_transformer package here>"
|
|
topics = ("<Put some tag here>", "<here>", "<and here>")
|
|
|
|
# Binary configuration
|
|
settings = "os", "compiler", "build_type", "arch"
|
|
options = {"shared": [True, False], "fPIC": [True, False]}
|
|
default_options = {"shared": False, "fPIC": True}
|
|
|
|
# Sources are located in the same place as this recipe, copy them to the recipe
|
|
exports_sources = "CMakeLists.txt", "src/*", "include/*"
|
|
|
|
def requirements(self):
|
|
"""
|
|
todo clean up this thing.
|
|
"""
|
|
# build
|
|
self.tool_requires("cmake/[>=3.14 <=3.26]")
|
|
# test
|
|
self.test_requires("gtest/[~1.13]")
|
|
self.test_requires("sobjectizer/[~5.8]")
|
|
self.test_requires("eventpp/[~0.1]")
|
|
self.test_requires("sigslot/[~1.2]")
|
|
self.test_requires("caf/[~0.19]")
|
|
self.test_requires("spdlog/[~1.13]")
|
|
|
|
def validate(self):
|
|
check_min_cppstd(self, "17")
|
|
|
|
def config_options(self):
|
|
if self.settings.os == "Windows":
|
|
self.options.rm_safe("fPIC")
|
|
|
|
def configure(self):
|
|
if self.options.shared:
|
|
self.options.rm_safe("fPIC")
|
|
|
|
def layout(self):
|
|
cmake_layout(self)
|
|
|
|
def generate(self):
|
|
deps = CMakeDeps(self)
|
|
deps.generate()
|
|
tc = CMakeToolchain(self)
|
|
tc.generate()
|
|
|
|
def build(self):
|
|
cmake = CMake(self)
|
|
cmake.configure()
|
|
cmake.build()
|
|
|
|
def package(self):
|
|
cmake = CMake(self)
|
|
cmake.install()
|
|
|
|
def package_info(self):
|
|
self.cpp_info.libs = ["event_transformer"]
|