Skip to content

with get --from-source c.raylib: CMake cannot find glfw3 (the Conan glfw binary ships no glfw3Config.cmake) #1900

Closed

Description

@ehartford

Symptom

On macOS (arm64), with get --from-source c.raylib (raylib/6.0, Conan Center recipe) installs the recipe's requirement glfw/3.4 as a Conan Center binary into .with/deps/c/glfw/3.4/, then fails at configure:

  configuring...
CMake Error at cmake/GlfwImport.cmake:3 (find_package):
  Could not find a package configuration file provided by "glfw3" (requested version 3.4) with any of the following names:
    glfw3.cps
    glfw3Config.cmake
    glfw3-config.cmake
Call Stack (most recent call first):
  src/CMakeLists.txt:43 (include)
error: CMake could not configure raylib/6.0 (its output is above)

Cause

src/compiler/ConanClient.w conan_install_from_source evaluates the recipe's tc.variables with src/compiler/ConanRecipe.w; for desktop the raylib conanfile sets USE_EXTERNAL_GLFW = "ON", which makes raylib's cmake/GlfwImport.cmake call find_package(glfw3 3.4 REQUIRED). The installed requirement is passed through CMAKE_PREFIX_PATH, but a Conan Center binary package carries no CMake package config (the glfw package's lib/cmake/ holds only conan-official-glfw-targets.cmake); Conan itself generates glfw3Config.cmake with its CMakeDeps generator at install time, which with get does not do.

So every recipe whose requirements are found through find_package(<Config>) fails the from-source path on any platform, not only raylib. The Windows lane hit the same class for other packages before (#1129 notes).

Not affected

The darwin release-UAT lane (#1375) builds raylib on PLATFORM=RGFW, which imports no GLFW; WITH_GET_CMAKE_RAYLIB=PLATFORM=RGFW;OPENGL_VERSION=Software;USE_EXTERNAL_GLFW=OFF passes USE_EXTERNAL_GLFW=OFF for that reason.

Fix direction

with get's source build should give CMake what CMakeDeps would: a <name>Config.cmake (or Find<name>.cmake) per installed requirement, generated from the metadata conan_write_binary_metadata already records (include dir, lib dir, libs, defines, frameworks), placed on CMAKE_PREFIX_PATH; the target name comes from the recipe's cpp_info.set_property("cmake_target_name", ...). No hand table per package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions