libsdl-org / SDL_ttf

Support for TrueType (.ttf) font files with Simple Directmedia Layer.
zlib License
402 stars 131 forks source link

Issues finding freetype. #410

Closed cnlohr closed 1 month ago

cnlohr commented 1 month ago

When building on ARM64 debian, if I install

sudo apt-get install libfreetype-dev libfreetype6 libfreetype6-dev

I can validate the installation with the following:

pkg-config --cflags freetype2 
-I/usr/include/freetype2 -I/usr/include/libpng16

But when I try to run cmake, I get the following:

$ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSDL3TTF_HARFBUZZ=ON -DSDL3TTF_VENDORED=ON   ..
-- Configuring SDL3_ttf 3.0.0
-- SDL3_ttf: Using system freetype library
CMake Error at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
  Could NOT find Freetype (missing: FREETYPE_LIBRARY) (found version
  "2.10.4")
Call Stack (most recent call first):
  /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.18/Modules/FindFreetype.cmake:157 (find_package_handle_standard_args)
  CMakeLists.txt:265 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/[...]/SDL_ttf/build/CMakeFiles/CMakeOutput.log".

But nothing in the CMakeOutput.log file contains freetype, ft, etc...

Any idea what is going on here or how to resolve the issue?

slouken commented 1 month ago

Did you run external/download.sh to get the vendored libraries?

slouken commented 1 month ago

SDL_ttf provides it's own copies of those libraries and builds them into SDL_ttf.

cnlohr commented 1 month ago

Yes, it was all gotten via the download script. I tried setting -DSDLTTF_FREETYPE_VENDORED=ON to no avail. And, in my SDL_ttf/external folder is freetype - fully populated.

slouken commented 1 month ago

Oh, try this: cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSDLTTF_HARFBUZZ=ON -DSDLTTF_VENDORED=ON ..

cnlohr commented 1 month ago

SDLTTF vs SDL3TTF

That was it.