Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error compiling on Arch Linux (package "SDL2" is considered to be NOT FOUND) #18

@jose1711

Description

@jose1711

With the current master:

$ cmake .. 
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at CMakeLists.txt:28 (find_package):
  Found package configuration file:

    /usr/lib64/cmake/SDL2/SDL2Config.cmake

  but it set SDL2_FOUND to FALSE so package "SDL2" is considered to be NOT
  FOUND.

What worked for me (although I am not sure if such fix makes any sense) was changing

find_package(SDL2 REQUIRED sdl2)

in CMakeLists.txt to

find_package(SDL2 REQUIRED)

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