Skip to content

Commit

Permalink
glew: Use the mesa-glu Conan package
Browse files Browse the repository at this point in the history
This is done the same way as for the FreeGLUT package.
Fixes #22944.
  • Loading branch information
jwillikers committed Mar 2, 2024
1 parent 1c888e8 commit 51ae03f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions recipes/glew/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from conan import ConanFile
from conan.tools.apple import is_apple_os
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir
import os
Expand Down Expand Up @@ -45,7 +46,10 @@ def layout(self):

def requirements(self):
self.requires("opengl/system")
self.requires("glu/system")
if is_apple_os(self) or self.settings.os == "Windows":
self.requires("glu/system")
else:
self.requires("mesa-glu/9.0.3")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand Down Expand Up @@ -90,7 +94,11 @@ def package_info(self):
self.cpp_info.components["glewlib"].libs = [lib_name]
if self.settings.os == "Windows" and not self.options.shared:
self.cpp_info.components["glewlib"].defines.append("GLEW_STATIC")
self.cpp_info.components["glewlib"].requires = ["opengl::opengl", "glu::glu"]
self.cpp_info.components["glewlib"].requires = ["opengl::opengl"]
if is_apple_os(self) or self.settings.os == "Windows":
self.cpp_info.components["glewlib"].requires.append("glu::glu")
else:
self.cpp_info.components["glewlib"].requires.append("mesa-glu::mesa-glu")

# TODO: to remove in conan v2 once cmake_find_package_* generators removed
self.cpp_info.filenames["cmake_find_package"] = "GLEW"
Expand Down

0 comments on commit 51ae03f

Please sign in to comment.