mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
* build: add nlohmann/json library * build(deps): add harfbuzz dependency * feat(cmake): add guard to reject macOS builds * feat(font): add HarfBuzz shaping and replace font with unifont * feat(localization): add i18n support with en_US and zh_CN translations Implement Localization class to load JSON translation files. Replace hardcoded strings in UI with translation keys and update sliders/combo buttons to use dynamic text. * feat(localization): detect system locale for language default * feat(settings): add language selection option with restart notification * fix: use vckpg to add freetype on windows
73 lines
1.8 KiB
CMake
73 lines
1.8 KiB
CMake
include(FetchContent)
|
|
|
|
# System packages
|
|
find_package(OpenGL REQUIRED)
|
|
find_package(Protobuf REQUIRED)
|
|
find_package(absl REQUIRED)
|
|
find_package(zstd REQUIRED)
|
|
find_package(OpenAL REQUIRED)
|
|
find_package(harfbuzz REQUIRED)
|
|
find_package(Freetype REQUIRED)
|
|
if (UNIX AND NOT APPLE)
|
|
find_package(glfw3 REQUIRED)
|
|
endif()
|
|
|
|
|
|
# Third-party libraries
|
|
FetchContent_Declare(
|
|
glm
|
|
GIT_REPOSITORY https://github.com/g-truc/glm.git
|
|
GIT_TAG 1.0.3
|
|
|
|
)
|
|
FetchContent_MakeAvailable(glm)
|
|
FetchContent_Declare(
|
|
soil2
|
|
GIT_REPOSITORY https://github.com/SpartanJ/SOIL2.git
|
|
GIT_TAG 1.31
|
|
|
|
)
|
|
FetchContent_MakeAvailable(soil2)
|
|
FetchContent_Declare(
|
|
tomlplusplus
|
|
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
|
|
GIT_TAG v3.4.0
|
|
)
|
|
FetchContent_MakeAvailable(tomlplusplus)
|
|
|
|
|
|
if (WIN32)
|
|
FetchContent_Declare(
|
|
glfw
|
|
GIT_REPOSITORY https://github.com/glfw/glfw.git
|
|
GIT_TAG 3.4
|
|
)
|
|
|
|
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
|
|
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
|
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
|
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
|
|
set(GLFW_VULKAN_STATIC ON CACHE BOOL "" FORCE)
|
|
set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
|
|
|
|
FetchContent_MakeAvailable(glfw)
|
|
|
|
set(_BUILD_SHARED_LIBS_SAVED ${BUILD_SHARED_LIBS})
|
|
set(BUILD_SHARED_LIBS ON)
|
|
|
|
FetchContent_Declare(
|
|
onetbb
|
|
GIT_REPOSITORY https://github.com/uxlfoundation/oneTBB.git
|
|
GIT_TAG v2023.0.0
|
|
)
|
|
|
|
set(BUILD_TESTING OFF CACHE BOOL "Build tests" FORCE)
|
|
set(TBB_TEST OFF CACHE BOOL "Build TBB tests" FORCE)
|
|
FetchContent_MakeAvailable(onetbb)
|
|
|
|
set(BUILD_SHARED_LIBS ${_BUILD_SHARED_LIBS_SAVED})
|
|
unset(_BUILD_SHARED_LIBS_SAVED)
|
|
|
|
endif()
|
|
|