text: from conans import ConanFile, CMake, tools
  import os, platform
  
  glfw_version = os.getenv('GLFW_VERSION', '0.0')
  glfw_commit = os.getenv('GLFW_COMMIT', '')
  
  class GLFWConan(ConanFile):
      name = "glfw"
      license = "MIT"
      url = "https://github.com/BentouDev/conan-glfw"
      version = glfw_version
      commit = glfw_commit
  
      description = "GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan development on the desktop."
      settings = "os", "compiler", "build_type", "arch"
      generators = "cmake"
      exports_sources = ["glfw-source/*"]
  
      options = {}
      default_options = {}
  
      def source(self):
          if platform.system() != "Windows":
              return
  
          # This small hack might be useful to guarantee proper /MT /MD linkage in MSVC
          # if the packaged project doesn't have variables to set it properly
          print (' [*] Injecting conanbuildinfo.cmake...')
          tools.replace_in_file("%s/CMakeLists.txt" % ("glfw-source"), "project(GLFW VERSION 3.4.0 LANGUAGES C)", 
  
  """project(GLFW VERSION 3.4.0 LANGUAGES C)
  include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
  conan_basic_setup()""")
  
      def build(self):
          # Workaround for conan choosing cmake embedded in Visual Studio
          if platform.system() == "Windows" and 'AZURE' in os.environ:
              cmake_path = '"C:\\Program Files\\CMake\\bin\\cmake.exe"'
              print (' [DEBUG] Forcing CMake : ' + cmake_path)
              os.environ['CONAN_CMAKE_PROGRAM'] = cmake_path
  
          cmake = CMake(self)
          cmake.definitions["GLFW_BUILD_EXAMPLES"] = False
          cmake.definitions["GLFW_BUILD_TESTS"] = False
          cmake.definitions["GLFW_BUILD_DOCS"] = False
          cmake.configure(source_folder="glfw-source")
          cmake.build()
          cmake.install()
  
      def package_info(self):
          self.cpp_info.libs = tools.collect_libs(self)
          self.env_info.PKG_CONFIG_PATH.append(os.path.join(self.package_folder, "lib", "pkgconfig"))
          for file in os.listdir(os.path.join(self.package_folder, "lib", "pkgconfig")):
              setattr(self.env_info, "PKG_CONFIG_%s_PREFIX" % file[:-3].replace(".", "_").replace("-", "_").upper(), self.package_folder)
          self.env_info.SOURCE_PATH.append(os.path.join(self.package_folder, "src"))
          self.cpp_info.srcdirs.append("src")
  