Skip to content

Commit

Permalink
freeglut: Use the mesa-glu package when not on Apple or Windows
Browse files Browse the repository at this point in the history
The glu/system package installs the Mesa GLU system package on Linux and FreeBSD.
Now that the mesa-glu package is available in Conan, use that instead.
  • Loading branch information
jwillikers committed Jan 18, 2024
1 parent 3b78ae0 commit 6e60396
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions recipes/freeglut/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.apple import is_apple_os
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import collect_libs, copy, get, rmdir
from conan.tools.scm import Version
Expand Down Expand Up @@ -49,7 +50,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")
if self.settings.os == "Linux":
self.requires("xorg/system")

Expand Down Expand Up @@ -124,6 +128,10 @@ def package_info(self):
self.cpp_info.components["freeglut_"].names["cmake_find_package_multi"] = config_target
self.cpp_info.components["freeglut_"].set_property("cmake_target_name", f"FreeGLUT::{config_target}")
self.cpp_info.components["freeglut_"].set_property("pkg_config_name", pkg_config)
self.cpp_info.components["freeglut_"].requires.extend(["opengl::opengl", "glu::glu"])
self.cpp_info.components["freeglut_"].requires.append("opengl::opengl")
if is_apple_os(self) or self.settings.os == "Windows":
self.cpp_info.components["freeglut_"].requires.append("glu::glu")
else:
self.cpp_info.components["freeglut_"].requires.append("mesa-glu::mesa-glu")
if self.settings.os == "Linux":
self.cpp_info.components["freeglut_"].requires.append("xorg::xorg")

0 comments on commit 6e60396

Please sign in to comment.