<div dir="ltr"><div><div><div><div><div><div><div><div><div>Hey guys,<br><br></div>I wanted to try something out with CMake and latest version of freetype (2.6.3). So I downloaded freetype, compiled it with the commands<br><br></div>> ./configure --prefix=/home/kristian/Documents/freetype/freetype<br></div>> make<br></div>> make install<br><br></div>After that, I created a small C++-file and a CMakeLists.txt. The C++-file depends on freetype, so my CMakeLists.txt looks like this:<br><br>=====<br><br>> cmake_minimum_required(VERSION 3.5)<br>> project(freetype_ex)<br>> <br>> set(FREETYPE_DIR "/home/kristian/Documents/freetype/freetype")<br>> find_package(Freetype)<br>> <br>> set(SOURCES main.cpp)<br>> <br>> include_directories(${FREETYPE_INCLUDE_DIRS})<br>> <br>> add_executable(${PROJECT_NAME} ${SOURCES})<br>> target_link_libraries(${PROJECT_NAME} ${FREETYPE_LIBRARIES})<br><br>=====<br><br></div>But when calling cmake, I am getting this error:<br>=====<br><br>> -- Could NOT find Freetype (missing:  FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS) <br>> CMake Error: The following variables are used in this project, but they are set to NOTFOUND.<br>> Please set them or make sure they are set and tested correctly in the CMake files:<br>> FREETYPE_LIBRARY (ADVANCED)<br>>     linked by target "freetype_ex" in directory /home/kristian/Documents/freetype/cmake<br>> <br>> -- Configuring incomplete, errors occurred!<br>> See also "/home/kristian/Documents/freetype/cmake/CMakeFiles/CMakeOutput.log".<br><br>=====<br><br></div>This sort of error seems for me to be a bug, because I would assume, that when I set the variable FREETYPE_DIR, then CMake would also look at this dir.<br><br></div>I looked at the FindFreetype.cmake file (<a href="https://github.com/Kitware/CMake/blob/master/Modules/FindFreetype.cmake">https://github.com/Kitware/CMake/blob/master/Modules/FindFreetype.cmake</a>) and my first assumption is, that it would help, to add something like ${FREETYPE_DIR} the the find_path calls.<br><br></div>What do you think of this? Another idea is, to add another variable instead of FREETYPE_DIR, e.g. FREETYPE_ROOT_DIR...<br></div>