conanfile.py 917 B

1234567891011121314151617181920212223242526
  1. from conans import ConanFile, CMake, tools, RunEnvironment
  2. import os
  3. class TestPackageConan(ConanFile):
  4. settings = "os", "compiler", "build_type", "arch"
  5. generators = "cmake"
  6. def build(self):
  7. cmake = CMake(self)
  8. cmake.configure()
  9. cmake.build()
  10. def imports(self):
  11. self.copy("*paho*.dll", dst="bin", src="bin")
  12. self.copy("*paho*.dylib*", dst="bin", src="lib")
  13. def test(self):
  14. with tools.environment_append(RunEnvironment(self).vars):
  15. bin_path = os.path.join("bin", "test_package")
  16. if self.settings.os == "Windows":
  17. self.run(bin_path)
  18. elif self.settings.os == "Macos":
  19. self.run("DYLD_LIBRARY_PATH=%s %s" % (os.environ.get('DYLD_LIBRARY_PATH', ''), bin_path))
  20. else:
  21. self.run("LD_LIBRARY_PATH=%s %s" % (os.environ.get('LD_LIBRARY_PATH', ''), bin_path))