2022-06-05 14:03:26 +02:00
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# ," /\ ", Azur: A game engine for CASIO fx-CG and PC #
|
|
|
|
# | _/__\_ | Designed by Lephe' and the Planète Casio community. #
|
|
|
|
# "._`\/'_." License: MIT <https://opensource.org/licenses/MIT> #
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# Main library build system
|
2021-07-04 14:46:36 +02:00
|
|
|
|
|
|
|
configure_file(include/azur/config.h.in include/azur/config.h)
|
|
|
|
|
|
|
|
set(SOURCES
|
2022-07-19 00:01:42 +02:00
|
|
|
src/log.cpp)
|
2021-07-04 14:46:36 +02:00
|
|
|
set(ASSETS)
|
|
|
|
|
|
|
|
# SDL/OpenGL rendering
|
|
|
|
if(AZUR_TOOLKIT_SDL AND AZUR_GRAPHICS_OPENGL)
|
|
|
|
list(APPEND SOURCES
|
2022-07-19 00:01:42 +02:00
|
|
|
src/gl/init.cpp
|
|
|
|
src/gl/util.cpp
|
2022-06-05 14:03:26 +02:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/src/glsl.c")
|
|
|
|
|
2021-07-04 14:46:36 +02:00
|
|
|
list(APPEND ASSETS
|
|
|
|
glsl/vs_prelude_gles2.glsl
|
|
|
|
glsl/fs_prelude_gles2.glsl
|
2022-06-05 14:03:26 +02:00
|
|
|
glsl/vs_prelude_gl3.glsl
|
|
|
|
glsl/fs_prelude_gl3.glsl
|
2021-07-04 14:46:36 +02:00
|
|
|
glsl/vs_tex2d.glsl
|
|
|
|
glsl/fs_tex2d.glsl)
|
2022-06-05 14:03:26 +02:00
|
|
|
|
|
|
|
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/src/glsl.c"
|
|
|
|
COMMAND mkdir -p "${CMAKE_CURRENT_BINARY_DIR}/src"
|
|
|
|
COMMAND python gen_glsl.py "${CMAKE_CURRENT_BINARY_DIR}/src/glsl.c"
|
|
|
|
${ASSETS}
|
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
|
|
COMMENT "Generating a C file with prebuilt shaders"
|
|
|
|
DEPENDS gen_glsl.py ${ASSETS})
|
2021-07-04 14:46:36 +02:00
|
|
|
endif()
|
|
|
|
|
2023-04-22 16:51:20 +02:00
|
|
|
if(AZUR_TOOLKIT_GINT)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
src/gint/init.cpp)
|
|
|
|
endif()
|
|
|
|
|
2021-07-04 14:46:36 +02:00
|
|
|
# gint rendering
|
|
|
|
if(AZUR_GRAPHICS_GINT_CG)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
src/gint/render.c
|
2022-05-07 19:17:33 +02:00
|
|
|
src/gint/r61524.s
|
|
|
|
# Clear shader
|
2021-08-20 11:16:58 +02:00
|
|
|
src/gint/shaders/clear.c
|
|
|
|
src/gint/shaders/clear.S
|
2022-05-07 19:17:33 +02:00
|
|
|
# Image shader
|
2021-09-27 11:04:59 +02:00
|
|
|
src/gint/shaders/image.c
|
2022-05-07 19:17:33 +02:00
|
|
|
src/gint/shaders/image_rgb16_normal.S
|
|
|
|
src/gint/shaders/image_rgb16_clearbg.S
|
|
|
|
src/gint/shaders/image_rgb16_swapcolor.S
|
|
|
|
src/gint/shaders/image_rgb16_dye.S
|
|
|
|
src/gint/shaders/image_p8_normal.S
|
|
|
|
src/gint/shaders/image_p8_swapcolor.S
|
|
|
|
src/gint/shaders/image_p4_normal.S
|
|
|
|
# Image shader interface
|
|
|
|
src/gint/shaders/image_rgb16.c
|
|
|
|
src/gint/shaders/image_rgb16_effect.c
|
|
|
|
src/gint/shaders/image_rgb16_swapcolor.c
|
|
|
|
src/gint/shaders/image_rgb16_dye.c
|
|
|
|
src/gint/shaders/image_p8.c
|
|
|
|
src/gint/shaders/image_p8_effect.c
|
|
|
|
src/gint/shaders/image_p8_swapcolor.c
|
|
|
|
src/gint/shaders/image_p8_dye.c
|
|
|
|
src/gint/shaders/image_p4.c
|
|
|
|
src/gint/shaders/image_p4_effect.c
|
|
|
|
src/gint/shaders/image_p4_swapcolor.c
|
2022-08-20 11:49:21 +02:00
|
|
|
src/gint/shaders/image_p4_dye.c
|
|
|
|
# Triangle shader
|
|
|
|
src/gint/shaders/triangle.c
|
2023-05-31 23:29:04 +02:00
|
|
|
src/gint/shaders/triangle.S
|
|
|
|
# Rectangle shader
|
|
|
|
src/gint/shaders/rect.c
|
2023-06-12 19:00:28 +02:00
|
|
|
src/gint/shaders/rect.S
|
|
|
|
# Text shader
|
|
|
|
src/gint/shaders/text.c
|
|
|
|
src/gint/shaders/text.S)
|
2021-07-04 14:46:36 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(azur STATIC ${SOURCES})
|
|
|
|
|
2022-06-05 14:03:26 +02:00
|
|
|
set_target_properties(azur PROPERTIES OUTPUT_NAME "azur_${AZUR_PLATFORM}")
|
2021-07-04 14:46:36 +02:00
|
|
|
|
2022-06-05 14:03:26 +02:00
|
|
|
# Link with GL3W to load the OpenGL 3.3 core profile
|
2021-07-05 14:03:21 +02:00
|
|
|
if(AZUR_GRAPHICS_OPENGL_3_3)
|
|
|
|
target_link_libraries(azur PUBLIC gl3w)
|
|
|
|
endif()
|
|
|
|
|
2022-06-05 14:03:26 +02:00
|
|
|
target_include_directories(azur PRIVATE
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/include"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/include")
|
2022-06-02 22:18:58 +02:00
|
|
|
|
|
|
|
#---
|
|
|
|
# Install
|
|
|
|
#---
|
|
|
|
|
2022-06-05 14:03:26 +02:00
|
|
|
# Library file: libazur_*.a
|
2022-06-02 22:18:58 +02:00
|
|
|
install(TARGETS azur DESTINATION ${LIBDIR})
|
|
|
|
# Headers: azur/*.h
|
|
|
|
install(DIRECTORY include/ DESTINATION ${INCDIR} FILES_MATCHING PATTERN "*.h")
|
|
|
|
# Generated header: azur/config.h
|
2022-06-05 14:03:26 +02:00
|
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/azur/config.h"
|
2022-06-02 22:18:58 +02:00
|
|
|
DESTINATION ${INCDIR}/azur)
|