conanfile.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. from conans import ConanFile, CMake, tools
  2. class LibOggConan(ConanFile):
  3. name = "libogg"
  4. version = "1.3.4"
  5. license = "BSD-2-Clause"
  6. author = "Shawn Morford <DarkMorford@Gmail.com>"
  7. url = "https://code.darkmorford.net/conan-pkg/libogg"
  8. description = ("Ogg is a multimedia container format, and the native file and stream format for the "
  9. "Xiph.org multimedia codecs. As with all Xiph.org technology it is an open format "
  10. "free for anyone to use.")
  11. homepage = "https://www.xiph.org/ogg/"
  12. topics = ("xiph.org", "media", "container")
  13. settings = "os", "compiler", "build_type", "arch"
  14. options = {"shared": [True, False]}
  15. default_options = {"shared": False}
  16. generators = "cmake"
  17. def source(self):
  18. self.run("git clone https://github.com/conan-io/hello.git")
  19. # This small hack might be useful to guarantee proper /MT /MD linkage
  20. # in MSVC if the packaged project doesn't have variables to set it
  21. # properly
  22. tools.replace_in_file("hello/CMakeLists.txt", "PROJECT(HelloWorld)",
  23. '''PROJECT(HelloWorld)
  24. include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
  25. conan_basic_setup()''')
  26. def configure(self):
  27. del self.settings.compiler.libcxx
  28. def build(self):
  29. cmake = CMake(self)
  30. cmake.configure(source_folder="hello")
  31. cmake.build()
  32. # Explicit way:
  33. # self.run('cmake %s/hello %s'
  34. # % (self.source_folder, cmake.command_line))
  35. # self.run("cmake --build . %s" % cmake.build_config)
  36. def package(self):
  37. self.copy("*.h", dst="include", src="hello")
  38. self.copy("*hello.lib", dst="lib", keep_path=False)
  39. self.copy("*.dll", dst="bin", keep_path=False)
  40. self.copy("*.so", dst="lib", keep_path=False)
  41. self.copy("*.dylib", dst="lib", keep_path=False)
  42. self.copy("*.a", dst="lib", keep_path=False)
  43. def package_info(self):
  44. self.cpp_info.libs = ["hello"]