CMake не может найти SDL2_ttf, я пытаюсь связать его так же, как и с SDL2, и оба правильно установлены в Ubuntu 18.04 - PullRequest
0 голосов
/ 26 сентября 2019

Я получаю сообщение об ошибке:

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

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

    SDL2_ttfConfig.cmake
    sdl2_ttf-config.cmake

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

Вот как выглядит мой файл cmake:

cmake_minimum_required(VERSION 3.14)
project(Smithereens)

set(CMAKE_CXX_STANDARD 17)

add_executable(Smithereens main.cpp)

find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})

find_package(SDL2_ttf REQUIRED)
include_directories(${SDL2_ttf_INCLUDE_DIRS})

target_link_libraries(Smithereens ${SDL2_LIBRARIES} ${SDL2_ttf_LIBRARIES})

На моем компьютере установлены SDL2 и SDL2_ttf, яя уверен, что я просто неправильно соединяюсь, изучение CMake стало для меня огромной головной болью.

...