Collab_RPG/CMakeLists.txt

192 lines
5.4 KiB
Text
Raw Normal View History

# Configure with [fxsdk build-fx] or [fxsdk build-cg], which provide the
# toolchain file and module path of the fxSDK
cmake_minimum_required(VERSION 3.15)
project(MyAddin)
#set the color mode either to 1b or 2b
set(COLORMODE_fx 1b)
#set the color mode either to 1b, 2b or EGA64
set(COLORMODE_cg EGA64)
if(NOT "${COLORMODE_cg}" STREQUAL EGA64)
set(FXSDK_PLATFORM_LONG fx9860G_G3A)
set(FXSDK_PLATFORM fx)
endif()
include(GenerateG1A)
include(GenerateG3A)
include(Fxconv)
2024-07-25 13:20:56 +02:00
find_package(Gint 2.11 REQUIRED)
# Gint 2.11 is required, because we're using the new macros like GINT_RENDER_RGB
find_package(LibProf 2.4 REQUIRED)
fxconv_declare_converters(assets/converters.py)
set(SOURCES
src/main.c
src/map.c
src/player.c
src/memory.c
src/game.c
src/dialogs.c
src/npc.c
2024-07-20 16:53:13 +02:00
src/events.c
2024-08-01 16:47:53 +02:00
src/animation.c
# ...
)
# Shared assets, fx-9860G-only assets and fx-CG-50-only assets
set(ASSETS
2024-07-31 20:10:45 +02:00
assets/level0_dialogs.json
assets/level1_dialogs.json
assets/level2_dialogs.json
assets/level3_dialogs.json
assets/level4_dialogs.json
assets/level0.tmx
assets/level1.tmx
assets/level2.tmx
assets/level3.tmx
assets/level4.tmx
2024-07-31 21:57:37 +02:00
assets/interior1_0_dialogs.json
assets/interior1_0.tmx
# ...
)
set(ASSETS_cg
2024-07-27 16:51:47 +02:00
assets-cg/player_male.png
assets-cg/player_female.png
2024-07-25 17:03:34 +02:00
assets-cg/npc/char/npc_male.png
2024-07-27 17:20:06 +02:00
assets-cg/npc/char/npc_female.png
assets-cg/npc/char/npc_milkman.png
assets-cg/npc/char/npc_police.png
assets-cg/SignAction.png
2024-07-25 17:03:34 +02:00
assets-cg/npc/face/npc_male.png
2024-07-26 17:01:51 +02:00
assets-cg/npc/face/npc_female.png
assets-cg/npc/face/npc_milkman.png
assets-cg/npc/face/npc_police.png
assets-cg/SGN_Icon.png
assets-cg/INFO_Icon.png
assets-cg/player_face.png
assets-cg/font.png
)
set(ASSETS_cg_EGA64
assets-cg/ega64/tileset/tilesetEGA64_CG.png
2024-08-01 13:04:20 +02:00
assets-cg/ega64/tileset/tileset_inEGA64_CG.png
)
set(ASSETS_fx
2024-07-27 16:51:47 +02:00
assets-fx/player_male.png
2024-07-27 17:38:58 +02:00
assets-fx/player_female.png
assets-fx/SignAction.png
assets-fx/SGN_Icon.png
assets-fx/player_face.png
assets-fx/font.png
# ...
)
2023-07-06 21:16:07 +02:00
set(ASSETS_fx_1b
assets-fx/1b/tileset/tileset1b.png
2024-08-01 13:04:20 +02:00
assets-fx/1b/tileset/tileset_in1b.png
assets-fx/1b/npc/char/npc_male.png
assets-fx/1b/npc/char/npc_female.png
assets-fx/1b/npc/char/npc_milkman.png
assets-fx/1b/npc/char/npc_police.png
assets-fx/1b/npc/face/npc_male.png
assets-fx/1b/npc/face/npc_female.png
assets-fx/1b/npc/face/npc_milkman.png
assets-fx/1b/npc/face/npc_police.png
assets-fx/1b/INFO_Icon.png
2023-07-06 21:16:07 +02:00
# ...
)
set(ASSETS_fx_2b
assets-fx/2b/tileset/tileset2b.png
2024-08-01 13:04:20 +02:00
assets-fx/2b/tileset/tileset_in2b.png
assets-fx/2b/npc/char/npc_male.png
assets-fx/2b/npc/char/npc_female.png
assets-fx/2b/npc/char/npc_milkman.png
assets-fx/2b/npc/char/npc_police.png
assets-fx/2b/npc/face/npc_male.png
assets-fx/2b/npc/face/npc_female.png
assets-fx/2b/npc/face/npc_milkman.png
assets-fx/2b/npc/face/npc_police.png
assets-fx/1b/INFO_Icon.png
2023-07-06 21:16:07 +02:00
# ...
)
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} ${ASSETS_fx_1b} ${ASSETS_fx_2b} ${ASSETS_cg_1b} ${ASSETS_cg_2b} ${ASSETS_cg_EGA64} WITH_METADATA)
2023-07-06 21:16:07 +02:00
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}} ${ASSETS_${FXSDK_PLATFORM}_${COLORMODE_fx}} )
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}} ${ASSETS_${FXSDK_PLATFORM}_${COLORMODE_cg}} )
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G_G3A)
2024-08-01 16:47:53 +02:00
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}} ${ASSETS_${FXSDK_PLATFORM}_${COLORMODE_fx}} )
endif()
target_link_options(myaddin PRIVATE -Wl,-Map=Build_Addin.map -Wl,--print-memory-usage)
target_link_libraries(myaddin LibProf::LibProf Gint::Gint)
2023-07-06 21:16:07 +02:00
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
2024-07-25 13:20:56 +02:00
# fx colormode
if("${COLORMODE_fx}" STREQUAL 1b)
2024-07-31 20:10:45 +02:00
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -g -DCOLOR1BIT)
2024-07-25 13:20:56 +02:00
endif()
if("${COLORMODE_fx}" STREQUAL 2b)
2024-07-31 20:10:45 +02:00
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -g -DCOLOR2BIT)
2024-07-25 13:20:56 +02:00
endif()
if("${COLORMODE_fx}" STREQUAL 1b)
generate_g1a(TARGET myaddin OUTPUT "RPG_1b.g1a"
NAME "RPG PC 1b" ICON assets-fx/1b/icon1b.png)
2023-07-06 21:16:07 +02:00
endif()
if("${COLORMODE_fx}" STREQUAL 2b)
generate_g1a(TARGET myaddin OUTPUT "RPG_2b.g1a"
NAME "RPG PC 2b" ICON assets-fx/2b/icon2b.png)
2023-07-06 21:16:07 +02:00
endif()
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
2024-07-25 13:20:56 +02:00
# cg colormode
if("${COLORMODE_cg}" STREQUAL EGA64)
2024-07-31 20:10:45 +02:00
target_compile_options(myaddin PRIVATE -Wall -Wextra -O0 -g -DCOLOREGA)
2024-07-25 13:20:56 +02:00
endif()
if("${COLORMODE_cg}" STREQUAL 1b)
generate_g3a(TARGET myaddin OUTPUT "RPG_1bfx.g3a"
NAME "RPG PC 1b fx" ICONS assets-cg/1b/icon-uns-1b.png assets-cg/1b/icon-sel-1b.png)
endif()
if("${COLORMODE_cg}" STREQUAL 2b)
generate_g3a(TARGET myaddin OUTPUT "RPG_2bfx.g3a"
NAME "RPG PC 2b fx" ICONS assets-cg/2b/icon-uns-2b.png assets-cg/2b/icon-sel-2b.png)
endif()
if("${COLORMODE_cg}" STREQUAL EGA64)
generate_g3a(TARGET myaddin OUTPUT "RPG_ega.g3a"
NAME "RPG PC EGA" ICONS assets-cg/ega64/icon-uns-ega64.png assets-cg/ega64/icon-sel-ega64.png)
endif()
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G_G3A)
if("${COLORMODE_fx}" STREQUAL 1b)
generate_g3a(TARGET myaddin OUTPUT "RPG_1bfx.g3a"
NAME "RPG PC 1b fx" ICONS assets-cg/1b/icon-uns-1b.png assets-cg/1b/icon-sel-1b.png)
endif()
if("${COLORMODE_fx}" STREQUAL 2b)
generate_g3a(TARGET myaddin OUTPUT "RPG_2bfx.g3a"
NAME "RPG PC 2b fx" ICONS assets-cg/2b/icon-uns-2b.png assets-cg/2b/icon-sel-2b.png)
endif()
endif()