| | @@ -2,6 +2,32 @@ |
| 2 | 2 | |
| 3 | 3 | project(shaderplayground LANGUAGES CXX VERSION 0.1.0) |
| 4 | 4 | |
| 5 | +set(NOTOCJK_BINARY "${CMAKE_CURRENT_SOURCE_DIR}/ass/NotoSansCJKjp-Regular.otf") |
| 6 | +set(NOTOCJK_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/ass/NotoSansCJKjp-Regular.h") |
| 7 | + |
| 8 | +add_custom_command( |
| 9 | + OUTPUT "${NOTOCJK_HEADER}" |
| 10 | + COMMAND xxd -i -n __NotoSansCJKjp_Regular_otf "${NOTOCJK_BINARY}" > "${NOTOCJK_HEADER}" |
| 11 | + DEPENDS "${NOTOCJK_BINARY}" |
| 12 | + COMMENT "NotoSansCJKjp-Regular.hを作成中・・・" |
| 13 | + VERBATIM |
| 14 | +) |
| 15 | + |
| 16 | +set(NOTOMONO_BINARY "${CMAKE_CURRENT_SOURCE_DIR}/ass/NotoMono-Regular.ttf") |
| 17 | +set(NOTOMONO_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/ass/NotoMono-Regular.h") |
| 18 | + |
| 19 | +add_custom_command( |
| 20 | + OUTPUT "${NOTOMONO_HEADER}" |
| 21 | + COMMAND xxd -i -n __NotoMono_Regular_ttf "${NOTOMONO_BINARY}" > "${NOTOMONO_HEADER}" |
| 22 | + DEPENDS "${NOTOMONO_BINARY}" |
| 23 | + COMMENT "NotoMono-Regular.hを作成中・・・" |
| 24 | + VERBATIM |
| 25 | +) |
| 26 | + |
| 27 | +add_custom_target(generate_fonts |
| 28 | + DEPENDS "${NOTOCJK_HEADER}" "${NOTOMONO_HEADER}" |
| 29 | +) |
| 30 | + |
| 5 | 31 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) |
| 6 | 32 | set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "デバッグ又はリリース" FORCE) |
| 7 | 33 | endif() |
| | @@ -42,6 +68,7 @@ |
| 42 | 68 | file(GLOB_RECURSE SHADERPLAYGROUND_INC CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.hh") |
| 43 | 69 | |
| 44 | 70 | add_executable(shaderplayground main.cc ${SHADERPLAYGROUND_SRC} ${SHADERPLAYGROUND_INC}) |
| 71 | +add_dependencies(shaderplayground generate_fonts) |
| 45 | 72 | set_target_properties(shaderplayground PROPERTIES CXX_STANDARD 20) |
| 46 | 73 | |
| 47 | 74 | set(PLATFORM_LIBS "") |
| | @@ -174,6 +201,7 @@ |
| 174 | 201 | |
| 175 | 202 | target_include_directories(shaderplayground PRIVATE |
| 176 | 203 | "${CMAKE_CURRENT_SOURCE_DIR}/include" |
| 204 | + "${CMAKE_CURRENT_SOURCE_DIR}/ass" |
| 177 | 205 | ) |
| 178 | 206 | |
| 179 | 207 | if(MSVC) |