conanfile.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. from conans import ConanFile, CMake
  2. class LsMathConan(ConanFile):
  3. name = "ls-math"
  4. version = "2023.1.0"
  5. license = "MIT"
  6. url = "<Package recipe repository url here, for issues about the package>"
  7. description = "This library provides mathematical functionalities."
  8. topics = ("vector", "core")
  9. settings = "os", "compiler", "build_type", "arch"
  10. options = {"shared": [True, False]}
  11. default_options = {"shared": False}
  12. generators = "cmake"
  13. def source(self):
  14. self.run("git clone https://vcs.lynarstudios.de/public/ls-math.git --branch v" + self.version +
  15. " --single-branch")
  16. def build(self):
  17. cmake = self.__configure_cmake()
  18. cmake.build()
  19. def package(self):
  20. self.copy("*.hpp", dst="include", src="ls-math/include")
  21. self.copy("*.lib", dst="lib", keep_path=False)
  22. self.copy("*.a", dst="lib", keep_path=False)
  23. self.copy("*.so", dst="lib", keep_path=False)
  24. self.copy("*.dll", dst="lib", keep_path=False)
  25. def package_info(self):
  26. self.cpp_info.libs = ["ls-math-vector"]
  27. def __configure_cmake(self):
  28. cmake = CMake(self)
  29. if self.options.shared:
  30. cmake.definitions['BUILD_LS_MATH_STATIC'] = "OFF"
  31. cmake.definitions['BUILD_LS_MATH_SHARED'] = "ON"
  32. cmake.configure(source_folder="ls-math")
  33. return cmake