Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glew: Use the mesa-glu Conan package #22956

Merged
merged 3 commits into from
Mar 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 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,11 @@ def layout(self):

def requirements(self):
self.requires("opengl/system")
self.requires("glu/system")
# GL/glew.h includes glu.h.
if is_apple_os(self) or self.settings.os == "Windows":
self.requires("glu/system", transitive_headers=True)
else:
self.requires("mesa-glu/9.0.3", transitive_headers=True)

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand Down Expand Up @@ -90,7 +95,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
Loading