WiiDuktape/dependencies/GRRLIB/CMakeLists.txt
Fries 9f1b00d39d add file support
file loading is implemented with an asset generator script that reads
all the files in the data folder and converts them into c arrays and
puts them inside a c source file.
2024-06-20 18:41:49 -07:00

46 lines
1.3 KiB
CMake

cmake_minimum_required(VERSION 3.13)
project(GRRLIB)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PNG REQUIRED libpng)
pkg_check_modules(FREETYPE REQUIRED freetype2)
pkg_check_modules(JPEG REQUIRED libjpeg)
set(GRRLIB_DIR ./source/GRRLIB/GRRLIB)
set(PNGU_DIR ./source/GRRLIB/lib/pngu)
set (pngu_sources
${PNGU_DIR}/pngu.c
)
add_library(pngu ${pngu_sources})
target_link_libraries(pngu PRIVATE ${PNG_LIBRARIES})
target_include_directories(pngu PRIVATE ${PNG_INCLUDE_DIRS})
target_include_directories(pngu PUBLIC ${PNGU_DIR})
set(grrlib_sources
${GRRLIB_DIR}/GRRLIB_3D.c
${GRRLIB_DIR}/GRRLIB_bmf.c
${GRRLIB_DIR}/GRRLIB_bmfx.c
${GRRLIB_DIR}/GRRLIB_core.c
${GRRLIB_DIR}/GRRLIB_fbAdvanced.c
${GRRLIB_DIR}/GRRLIB_fileIO.c
${GRRLIB_DIR}/GRRLIB_gecko.c
${GRRLIB_DIR}/GRRLIB_print.c
${GRRLIB_DIR}/GRRLIB_render.c
${GRRLIB_DIR}/GRRLIB_snapshot.c
${GRRLIB_DIR}/GRRLIB_texEdit.c
${GRRLIB_DIR}/GRRLIB_ttf.c
)
add_library(GRRLIB ${grrlib_sources})
target_link_libraries(GRRLIB PRIVATE pngu)
target_link_libraries(GRRLIB PRIVATE ${FREETYPE_LIBRARIES})
target_link_libraries(GRRLIB PRIVATE fat)
target_link_libraries(GRRLIB PRIVATE ${JPEG_LIBRARIES})
target_include_directories(GRRLIB PRIVATE ${FREETYPE_INCLUDE_DIRS})
target_include_directories(GRRLIB PRIVATE ${JPEG_INCLUDE_DIRS})
target_include_directories(GRRLIB PUBLIC ${GRRLIB_DIR})