conanfile.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. from conans import ConanFile, CMake
  2. class LsStdConan(ConanFile):
  3. name = "ls-std"
  4. version = "2022.2.0"
  5. license = "MIT"
  6. url = "<Package recipe repository url here, for issues about the package>"
  7. description = "This is a cross-platform standard library written in C++ offering functionalities you would " \
  8. "usually miss in C++'s standard template library (STL), especially if you would search for " \
  9. "cross-platform implementations."
  10. topics = ("boxing", "core", "encoding", "event", "io", "logic", "time")
  11. settings = "os", "compiler", "build_type", "arch"
  12. options = {"shared": [True, False]}
  13. default_options = {"shared": False}
  14. generators = "cmake"
  15. def source(self):
  16. self.run("git clone https://vcs.lynarstudios.de/public/ls-standard-library.git --branch v" + self.version +
  17. " --single-branch")
  18. def build(self):
  19. cmake = self.__configure_cmake()
  20. cmake.build()
  21. def package(self):
  22. self.copy("*.hpp", dst="include", src="ls-standard-library/include")
  23. self.copy("*.lib", dst="lib", keep_path=False)
  24. self.copy("*.a", dst="lib", keep_path=False)
  25. self.copy("*.so", dst="lib", keep_path=False)
  26. self.copy("*.dll", dst="lib", keep_path=False)
  27. def package_info(self):
  28. self.cpp_info.libs = ["ls_std_boxing", "ls_std_core", "ls_std_encoding", "ls_std_event", "ls_std_io", "ls_std_logic", "ls_std_time"]
  29. def __configure_cmake(self):
  30. cmake = CMake(self)
  31. if self.options.shared:
  32. cmake.definitions['LS_STD_BUILD_STATIC'] = "OFF"
  33. cmake.definitions['LS_STD_BUILD_SHARED'] = "ON"
  34. cmake.configure(source_folder="ls-standard-library")
  35. return cmake