+1
-21
@@ -8,8 +8,6 @@ import conan.tools.files
|
||||
|
||||
import modulus.config
|
||||
|
||||
config = modulus.config
|
||||
|
||||
class modulus_recipe(conan.ConanFile):
|
||||
name = "modulus"
|
||||
version = "latest"
|
||||
@@ -83,26 +81,18 @@ class modulus_recipe(conan.ConanFile):
|
||||
"tools/docker/*",
|
||||
"README.md",
|
||||
)
|
||||
|
||||
def config_options(self):
|
||||
settings = self.settings
|
||||
options = self.options
|
||||
if settings.os == "Windows":
|
||||
del options.fPIC
|
||||
|
||||
def configure(self):
|
||||
options = self.options
|
||||
if options.shared:
|
||||
del options.fPIC
|
||||
|
||||
def requirements(self):
|
||||
config = modulus.config.load_recipe_config(self)
|
||||
self.requires(
|
||||
modulus.config.boost_ref(config),
|
||||
transitive_headers=True,
|
||||
transitive_libs=True,
|
||||
options=modulus.config.boost_requirement_options(config),
|
||||
)
|
||||
self.requires(modulus.config.boost_ref(config), transitive_headers=True, transitive_libs=True, options=modulus.config.boost_requirement_options(config))
|
||||
if self.options.with_openssl:
|
||||
self.requires(
|
||||
"openssl/4.0.1",
|
||||
@@ -127,7 +117,6 @@ class modulus_recipe(conan.ConanFile):
|
||||
transitive_headers=True,
|
||||
transitive_libs=True,
|
||||
)
|
||||
|
||||
def generate(self):
|
||||
options = self.options
|
||||
deps = conan.tools.cmake.CMakeDeps(self)
|
||||
@@ -142,7 +131,6 @@ class modulus_recipe(conan.ConanFile):
|
||||
toolchain.variables["MODULUS_WITH_RAYLIB"] = bool(options.with_raylib)
|
||||
toolchain.variables["MODULUS_WITH_MINIAUDIO"] = bool(options.with_miniaudio)
|
||||
toolchain.generate()
|
||||
|
||||
def build(self):
|
||||
options = self.options
|
||||
cmake = conan.tools.cmake.CMake(self)
|
||||
@@ -150,17 +138,14 @@ class modulus_recipe(conan.ConanFile):
|
||||
cmake.build()
|
||||
if 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):
|
||||
cmake = conan.tools.cmake.CMake(self)
|
||||
cmake.install()
|
||||
package = pathlib.Path(self.package_folder)
|
||||
conan.tools.files.copy(self, "*.py", src=pathlib.Path(self.recipe_folder) / "modulus", dst=package / "modulus", keep_path=True)
|
||||
conan.tools.files.copy(self, "*", src=pathlib.Path(self.source_folder) / "tools", dst=package / "tools", keep_path=True)
|
||||
|
||||
def package_info(self):
|
||||
cpp_info = self.cpp_info
|
||||
cpp_info.set_property("cmake_file_name", "modulus")
|
||||
@@ -173,18 +158,14 @@ class modulus_recipe(conan.ConanFile):
|
||||
components["modulus"].set_property("cmake_target_name", "modulus::modulus")
|
||||
components["modulus"].libs = ["modulus"]
|
||||
components["modulus"].requires = ["boost::json"]
|
||||
|
||||
components["boost_json"].set_property("cmake_target_name", "modulus::boost_json")
|
||||
components["boost_json"].requires = ["boost::json"]
|
||||
|
||||
if self.options.with_openssl:
|
||||
components["openssl"].set_property("cmake_target_name", "modulus::openssl")
|
||||
components["openssl"].requires = ["openssl::ssl", "openssl::crypto"]
|
||||
|
||||
if self.options.with_sqlite:
|
||||
components["sqlite"].set_property("cmake_target_name", "modulus::sqlite")
|
||||
components["sqlite"].requires = ["sqlite3::sqlite"]
|
||||
|
||||
if self.options.with_raylib:
|
||||
components["raylib"].set_property("cmake_target_name", "modulus::raylib")
|
||||
components["raylib"].requires = ["raylib::raylib"]
|
||||
@@ -197,7 +178,6 @@ class modulus_recipe(conan.ConanFile):
|
||||
"atomic",
|
||||
"dl",
|
||||
]
|
||||
|
||||
if self.options.with_miniaudio:
|
||||
components["miniaudio"].set_property("cmake_target_name", "modulus::miniaudio")
|
||||
components["miniaudio"].requires = ["miniaudio::miniaudio"]
|
||||
|
||||
Reference in New Issue
Block a user