conanfile.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. from conans import ConanFile, CMake, tools
  2. class LibTiffConan(ConanFile):
  3. name = "libtiff"
  4. version = "4.0.3"
  5. license = "<Put the package license here>"
  6. author = "<Put your name here> <And your email here>"
  7. url = "<Package recipe repository url here, for issues about the package>"
  8. description = "<Description of Libtiff here>"
  9. topics = ("<Put some tag here>", "<here>", "<and here>")
  10. settings = "os", "compiler", "build_type", "arch"
  11. options = {"shared": [True, False]}
  12. default_options = {"shared": False}
  13. generators = "cmake"
  14. def source(self):
  15. self.run("git clone https://github.com/conan-io/hello.git")
  16. # This small hack might be useful to guarantee proper /MT /MD linkage
  17. # in MSVC if the packaged project doesn't have variables to set it
  18. # properly
  19. tools.replace_in_file("hello/CMakeLists.txt", "PROJECT(HelloWorld)",
  20. '''PROJECT(HelloWorld)
  21. include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
  22. conan_basic_setup()''')
  23. def build(self):
  24. cmake = CMake(self)
  25. cmake.configure(source_folder="hello")
  26. cmake.build()
  27. # Explicit way:
  28. # self.run('cmake %s/hello %s'
  29. # % (self.source_folder, cmake.command_line))
  30. # self.run("cmake --build . %s" % cmake.build_config)
  31. def package(self):
  32. self.copy("*.h", dst="include", src="hello")
  33. self.copy("*hello.lib", dst="lib", keep_path=False)
  34. self.copy("*.dll", dst="bin", keep_path=False)
  35. self.copy("*.so", dst="lib", keep_path=False)
  36. self.copy("*.dylib", dst="lib", keep_path=False)
  37. self.copy("*.a", dst="lib", keep_path=False)
  38. def package_info(self):
  39. self.cpp_info.libs = ["hello"]
  40. def configure(self):
  41. del self.settings.compiler.libcxx