udoprog / c10t

A minecraft cartography tool
Other
226 stars 50 forks source link

Freetype can't be found on compiling #290

Closed Sworddragon closed 10 years ago

Sworddragon commented 10 years ago

On Ubuntu 14.10 dev with following the instructions on the README.md I'm getting the following output from cmake:

sworddragon@ubuntu:~/.git/c10t/build$ cmake .. -- The C compiler identification is GNU 4.8.3 -- The CXX compiler identification is GNU 4.8.3 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") -- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found suitable version "1.2.50", minimum required is "1.2") -- Looking for include file pthread.h -- Looking for include file pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Boost version: 1.55.0 -- Found the following Boost libraries: -- thread -- filesystem -- system CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: FREETYPE_INCLUDE_DIR_freetype2 used as include directory in directory /home/sworddragon/.git/c10t used as include directory in directory /home/sworddragon/.git/c10t used as include directory in directory /home/sworddragon/.git/c10t used as include directory in directory /home/sworddragon/.git/c10t used as include directory in directory /home/sworddragon/.git/c10t/libs/unc used as include directory in directory /home/sworddragon/.git/c10t/libs/unc used as include directory in directory /home/sworddragon/.git/c10t/src/image used as include directory in directory /home/sworddragon/.git/c10t/src/engine used as include directory in directory /home/sworddragon/.git/c10t/src/nbt used as include directory in directory /home/sworddragon/.git/c10t/src/mc used as include directory in directory /home/sworddragon/.git/c10t/test FREETYPE_INCLUDE_DIR_ft2build used as include directory in directory /home/sworddragon/.git/c10t used as include directory in directory /home/sworddragon/.git/c10t used as include directory in directory /home/sworddragon/.git/c10t used as include directory in directory /home/sworddragon/.git/c10t used as include directory in directory /home/sworddragon/.git/c10t/libs/unc used as include directory in directory /home/sworddragon/.git/c10t/libs/unc used as include directory in directory /home/sworddragon/.git/c10t/src/image used as include directory in directory /home/sworddragon/.git/c10t/src/engine used as include directory in directory /home/sworddragon/.git/c10t/src/nbt used as include directory in directory /home/sworddragon/.git/c10t/src/mc used as include directory in directory /home/sworddragon/.git/c10t/test

-- Configuring incomplete, errors occurred! See also "/home/sworddragon/.git/c10t/build/CMakeFiles/CMakeOutput.log". See also "/home/sworddragon/.git/c10t/build/CMakeFiles/CMakeError.log".

The freetype files are installed here:

sworddragon@ubuntu:~/.git/c10t/build$ sudo find / | grep -E 'ft2build.h|ftheader.h' /usr/include/freetype2/config/ftheader.h /usr/include/freetype2/ft2build.h

Golden-Lion commented 10 years ago

Had the same issue with Ubuntu 14.04, this is my workaround: cmake .. -DFREETYPE_INCLUDE_DIR_freetype2=/usr/include/freetype2 -DFREETYPE_INCLUDE_DIR_ft2build=/usr/include/freetype2

evildeeds commented 10 years ago

I don't have this problem, but I'm not using Ubuntu sooo... Someone should to take a look at https://github.com/udoprog/c10t/blob/master/cmake/modules/FindFreeType.cmake and figure out why it fails to find freetype on Ubuntu.

Edit: NVM, after a full system update I managed to hit this issue as well. Looking into it, the FindFreetype provided with c10t is ancient. Normally a proper one should be provided by the system, cmake or freetype itself. In my case I already have a much newer version of this file in my shared cmake directory, however it is named "FindFreetype" note the non-capitalized "t". An easy fix is to remove the module include from CMakeLists.txt and change "find_package(FreeType 2 REQUIRED)" to "find_package(Freetype 2 REQUIRED)", however I have no idea how this affects potential Windows builds, if c10t even builds on Windows - probably not since there is no registery search in the current FindFreeType. I'll provide a patch.

evildeeds commented 10 years ago

Pretty sure this can be closed now, unless anyone else still has this issue with the current master?

Sworddragon commented 10 years ago

On testing this with the current git the issue doesn't appear anymore.