I'm trying to include FreeType with cmake but am having issues with ft2build.h not being found. Here are my cmake files
main cmakelist:
cmake_minimum_required(VERSION 2.8)
project(game)
add_subdirectory(Managers)
add_subdirectory(Core)
add_subdirectory(Rendering)
add_subdirectory(Input)
add_executable(game main.cpp)
target_link_libraries(game initglew initglut camera modelmanager scenemanager shadermanager renderinglib)
find_library(GLUT glut)
find_library(OPENGL GL)
find_library(GLEW GLEW)
find_library(MATH m)
find_package(Freetype REQUIRED)
target_link_libraries(game ${GLUT} ${OPENGL} ${GLEW} ${MATH} ${FREETYPE_LIBRARIES})
include_directories(${FREETYPE_INCLUDE_DIRS})
SET(GCC_FLAGS "-Wall -Wextra -pedantic -std=c++17 -Wno-unused-parameter -g")
add_definitions(${GCC_FLAGS})
install(TARGETS game DESTINATION bin)
Rendering cmakelist:
cmake_minimum_required(VERSION 2.8)
project(rendering)
file(GLOB_RECURSE renderingcpps CONFIGURE_DEPENDS "*.cpp")
file(GLOB_RECURSE renderinghpps CONFIGURE_DEPENDS "*.hpp")
add_library(renderinglib STATIC ${renderingcpps})
install(TARGETS renderinglib DESTINATION lib)
install(FILES ${renderinghpps} DESTINATION include)
I'm including FreeType in the highest level cmakelist but a file inside a subfolder of rendering cant find ft2build.h. I tried following this link Linking freetype with cmake which got me where I am now but ft2build.h still cant be found. I was originally compiling with "-lfreetype -I/usr/include/freetype2" before trying to switch to cmake
I logged some output and FREETYPE_INCLUDE_DIRS is being populated with /usr/include/freetype2 but its two subcomponets are empty, not sure if thats related