conanfile.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. from conans import ConanFile, CMake, tools
  2. import os
  3. class LibTiffConan(ConanFile):
  4. name = "libtiff"
  5. version = "4.0.3"
  6. license = "libtiff"
  7. author = "Shawn Morford <DarkMorford@Gmail.com>"
  8. url = "https://code.darkmorford.net/conan-pkg/libtiff"
  9. description = ("This software provides support for the Tag Image File Format (TIFF), "
  10. "a widely used format for storing image data.")
  11. homepage = "http://simplesystems.org/libtiff/"
  12. topics = ("image", "graphic")
  13. settings = "os", "compiler", "build_type", "arch"
  14. options = {"shared": [True, False]}
  15. default_options = {"shared": False}
  16. generators = "cmake"
  17. @property
  18. def subfolder(self):
  19. return os.path.join(self.source_folder, f"tiff-{self.version}")
  20. def source(self):
  21. self.output.info(f"Downloading source for version {self.version}")
  22. tools.get(**self.conan_data["sources"][self.version])
  23. def configure(self):
  24. del self.settings.compiler.cppstd
  25. del self.settings.compiler.libcxx
  26. def build(self):
  27. cmake = CMake(self)
  28. cmake.configure(source_folder="hello")
  29. cmake.build()
  30. # Explicit way:
  31. # self.run('cmake %s/hello %s'
  32. # % (self.source_folder, cmake.command_line))
  33. # self.run("cmake --build . %s" % cmake.build_config)
  34. def package(self):
  35. self.copy("*.h", dst="include", src="hello")
  36. self.copy("*hello.lib", dst="lib", keep_path=False)
  37. self.copy("*.dll", dst="bin", keep_path=False)
  38. self.copy("*.so", dst="lib", keep_path=False)
  39. self.copy("*.dylib", dst="lib", keep_path=False)
  40. self.copy("*.a", dst="lib", keep_path=False)
  41. def package_info(self):
  42. self.cpp_info.libs = ["hello"]