Guest User

Untitled

a guest
Jun 19th, 2021
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.53 KB | None | 0 0
  1. from conans import ConanFile, CMake, tools
  2. from conans.client.tools import settings
  3. import os, sys
  4.  
  5. sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
  6. from help_config import *
  7.  
  8. class ImplotConan(ConanFile):
  9.     name = "implot"
  10.     version = "0.9"
  11.     license = "MIT"
  12.     author = "Evan Pezent"
  13.     description = "Advanced 2D Plotting for Dear ImGui"
  14.     settings = "os", "compiler", "build_type", "arch"
  15.     options = {"shared": [True, False], "fPIC": [True, False]}
  16.     default_options = {"shared": False, "fPIC": True}
  17.     requires = "imgui/1.83"
  18.     exports_sources = "src/*"
  19.     generators = "cmake"
  20.  
  21.     def config_options(self):
  22.         if self.settings.os == "Windows":
  23.             del self.options.fPIC
  24.  
  25.     def source(self):
  26.         self.run("git clone https://github.com/epezent/implot src/implot")
  27.         self.run("cd src/implot && git checkout tags/v0.9")
  28.  
  29.     def build(self):
  30.         cmake = CMake(self)
  31.         cmake.configure(args = "-DBUILD_SHARED=" + ("ON" if libraries_type == "shared" else "ON"), source_folder="src")
  32.         cmake.build()
  33.  
  34.     def package(self):
  35.         self.copy("*.hpp", dst="include", src="src")
  36.         self.copy("*.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.  
  42.     def package_info(self):
  43.         self.cpp_info.libs = ["implot"]
  44.  
Advertisement
Add Comment
Please, Sign In to add comment