Closed wutipong closed 1 year ago
find_package(freetype CONFIG REQUIRED)
If you use freetype
provided by vcpkg, please use the correct way:
find_package(Freetype REQUIRED)
target_link_libraries(main PRIVATE Freetype::Freetype) # since CMake 3.10
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.
Host Environment
To Reproduce Steps to reproduce the behavior:
make
.Failure logs
Additional context
set the project name
project(font-render-tester)
add the executable
add_executable(font-render-tester "main.cpp" "scene.hpp" "scene.cpp" "imgui-filebrowser/imfilebrowser.h" "texture.hpp" "texture.cpp" "main_scene.hpp" "main_scene.cpp" "font.cpp" "font.hpp" "text_renderer.hpp" "text_renderer.cpp" "context.cpp" "test_scene.cpp" "draw_rect.cpp" "draw_glyph.hpp" "draw_glyph.cpp" "io_util.hpp" "gl_util.hpp" "gl_util.cpp")
target_compile_features(font-render-tester PRIVATE cxx_std_17) set_property(TARGET font-render-tester PROPERTY CXX_STANDARD 17) set_property(TARGET font-render-tester PROPERTY CXX_STANDARD_REQUIRED ON)
if (MSVC) set_property(TARGET font-render-tester PROPERTY WIN32_EXECUTABLE ON) target_compile_options(font-render-tester PRIVATE /Zc:__cplusplus) endif()
find_package(SDL2 CONFIG REQUIRED) find_package(freetype CONFIG REQUIRED) find_package(gl3w CONFIG REQUIRED) find_package(glm CONFIG REQUIRED) find_package(harfbuzz CONFIG REQUIRED) find_package(imgui CONFIG REQUIRED) find_package(spdlog CONFIG REQUIRED) find_package(utf8cpp CONFIG REQUIRED)
target_include_directories(font-render-tester PRIVATE ${STB_INCLUDE_DIRS})
target_link_libraries(font-render-tester PRIVATE SDL2::SDL2 SDL2::SDL2main imgui::imgui harfbuzz harfbuzz::harfbuzz utf8cpp unofficial::gl3w::gl3w freetype spdlog::spdlog spdlog::spdlog_header_only)
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/fonts/NotoSans-Regular.ttf" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/fonts") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/fonts/NotoSansThai-Regular.ttf" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/fonts") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/fonts/NotoSansCJKjp-Regular.otf" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/fonts") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/fonts/NotoSansCJKkr-Regular.otf" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/fonts") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/fonts/NotoSansCJKsc-Regular.otf" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/fonts")
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/shaders/draw_rect.vert" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/shaders") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/shaders/draw_rect.frag" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/shaders") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/shaders/draw_glyph.vert" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/shaders") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/shaders/draw_glyph.frag" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/shaders")