Skip to content

[question] sdl2_ttf/2.0.15: cannot find SDL2 package #1360

@PieKing1215

Description

@PieKing1215

(Marked as a question because I'm not sure if it's my fault or not)

I'm using Conan for a project and sometimes (depending on build configuration?) I encounter this error when building sdl2_ttf:

CMake Error at source_subfolder/CMakeLists.txt:12 (find_package):
  By not providing "FindSDL2.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "SDL2", but
  CMake did not find one.

  Could not find a package configuration file provided by "SDL2" with any of
  the following names:

    SDL2Config.cmake
    sdl2-config.cmake

  Add the installation prefix of "SDL2" to CMAKE_PREFIX_PATH or set
  "SDL2_DIR" to a directory containing one of the above files.  If "SDL2"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!

I'm able to reproduce this using this conanfile.txt:

[requires]
sdl2/2.0.14@bincrafters/stable
sdl2_ttf/2.0.15@bincrafters/stable

[generators]
visual_studio

[options]
sdl2:iconv=False
sdl2:shared=False
sdl2:sdl2main=False

Putting it into an empty folder and doing conan install . --build results in this build config:
(I am on the latest version of conan, 1.33.1)

Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=Visual Studio
compiler.runtime=MD
compiler.version=16
os=Windows
os_build=Windows
[options]
[build_requires]
[env]

conanfile.txt: Installing package
Requirements
    bzip2/1.0.6@conan/stable from 'conan-center' - Cache
    freetype/2.9.1@bincrafters/stable from 'conan-center' - Cache
    libpng/1.6.37 from 'conan-center' - Cache
    sdl2/2.0.14@bincrafters/stable from 'bincrafters' - Cache
    sdl2_ttf/2.0.15@bincrafters/stable from 'bincrafters' - Cache
    zlib/1.2.11 from 'conan-center' - Cache
Packages
    bzip2/1.0.6@conan/stable:d16a91eadaaf5829b928b12d2f836ff7680d3df5 - Build
    freetype/2.9.1@bincrafters/stable:2eda287fd36b7b010dea069857045000246077e3 - Build
    libpng/1.6.37:d140711d95cc16a85766a8fc3a551dfafe84cf63 - Build
    sdl2/2.0.14@bincrafters/stable:5273cb1e5c61509a97e93d6b4616e05b71d63f69 - Build
    sdl2_ttf/2.0.15@bincrafters/stable:17de3557bbe07e478f7ba96ee56b6a13d5aeb49c - Build
    zlib/1.2.11:3fb49604f9c2f729b85ba3115852006824e72cab - Build

Which leads to the error at the top.

I'm not very familiar with cmake and I'm relatively new to conan so I'm not sure if this is a problem on my end or if it's with the sdl2_ttf package.
Hopefully someone more experienced has some insight as to what would cause this.

(Lmk if more info is needed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions