49 lines
1.8 KiB
Python
49 lines
1.8 KiB
Python
import conan
|
|
import conan.tools.build
|
|
import conan.tools.cmake
|
|
|
|
class product_fpol_conan(conan.ConanFile):
|
|
name = "product_fpol"
|
|
version = "latest"
|
|
description = "Private fantasy election leagues with C++ services"
|
|
package_type = "application"
|
|
settings = "os", "arch", "compiler", "build_type"
|
|
options = {"with_tests": [True, False]}
|
|
default_options = {"with_tests": False}
|
|
python_requires = "modulus/latest"
|
|
exports = "modulus.json"
|
|
exports_sources = (
|
|
"CMakeLists.txt",
|
|
"src/*.cpp",
|
|
"src/*.hpp",
|
|
"tests/*.py",
|
|
"data/demo/*.json",
|
|
"data/real/*.json",
|
|
)
|
|
def requirements(self):
|
|
self.requires(str(self.python_requires["modulus"].ref), transitive_headers=True, transitive_libs=True, options={"with_openssl": True, "with_sqlite": True})
|
|
self.requires("ligo/latest", transitive_headers=True, transitive_libs=True)
|
|
self.requires("noto/latest", transitive_headers=True, transitive_libs=True)
|
|
def generate(self):
|
|
dependencies = conan.tools.cmake.CMakeDeps(self)
|
|
dependencies.generate()
|
|
toolchain = conan.tools.cmake.CMakeToolchain(self)
|
|
toolchain.user_presets_path = False
|
|
toolchain.variables["BUILD_TESTING"] = bool(self.options.with_tests)
|
|
toolchain.variables.update(self.python_requires["modulus"].module.python_cmake_variables(self))
|
|
toolchain.generate()
|
|
def build(self):
|
|
cmake = conan.tools.cmake.CMake(self)
|
|
cmake.configure()
|
|
cmake.build()
|
|
if self.options.with_tests and conan.tools.build.can_run(self):
|
|
cmake.test(target="check")
|
|
def package_id(self):
|
|
self.info.options.rm_safe("with_tests")
|
|
def package(self):
|
|
conan.tools.cmake.CMake(self).install()
|
|
def package_info(self):
|
|
self.cpp_info.bindirs = ["bin"]
|
|
self.cpp_info.libdirs = []
|
|
self.cpp_info.includedirs = []
|