Product Setup
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import conan
|
||||
import conan.tools.build
|
||||
import conan.tools.cmake
|
||||
|
||||
class product_fpol_conan(conan.ConanFile):
|
||||
name = "product_fpol"
|
||||
version = "latest"
|
||||
description = "Fantasy Politics web application scaffold"
|
||||
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",
|
||||
)
|
||||
def requirements(self):
|
||||
self.requires(str(self.python_requires["modulus"].ref), transitive_headers=True, transitive_libs=True, options={"with_openssl": True})
|
||||
self.requires("ligo/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 = []
|
||||
Reference in New Issue
Block a user