conanfile.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. from conans import ConanFile, CMake
  2. class LsStdConan(ConanFile):
  3. name = "ls-std"
  4. version = "2021.2.0"
  5. license = "MIT"
  6. url = "https://vcs.lynarstudios.de/public/ls-standard-library.git"
  7. description = "This library provides standard functionalities like serialization, json, xml, file operations, " \
  8. "boxing, state machine, event handling."
  9. topics = ("serialization", "events", "boxing", "xml", "json", "files", "state machine")
  10. settings = "os", "compiler", "build_type", "arch"
  11. options = {"shared": [True, False], "static": [True, False]}
  12. default_options = {"shared": False, "static": True}
  13. generators = "cmake"
  14. def source(self):
  15. self.run("git clone " + self.url + " --branch v" + self.version + " --single-branch")
  16. def build(self):
  17. cmake = CMake(self)
  18. if self.options.shared:
  19. cmake.definitions["LS_STD_BUILD_SHARED"] = "ON"
  20. cmake.definitions["LS_STD_BUILD_STATIC"] = "OFF"
  21. cmake.configure(source_folder="ls-standard-library")
  22. self.run("cmake --build . --config Release")
  23. def package(self):
  24. self.copy("*.hpp", dst="include", src="ls-standard-library/include")
  25. self.copy("*.lib", dst="lib", keep_path=False)
  26. self.copy("*.dll", dst="lib", keep_path=False)
  27. self.copy("*.so", dst="lib", keep_path=False)
  28. self.copy("*.dylib", dst="lib", keep_path=False)
  29. self.copy("*.a", dst="lib", keep_path=False)
  30. def package_info(self):
  31. if self.options.shared:
  32. self.cpp_info.libs = ["ls_std_" + self.version + "_shared"]
  33. else:
  34. self.cpp_info.libs = ["ls_std_" + self.version + "_static"]