Collab_RPG/CMakeLists.txt
mibi88 5c58e11fea Revert "Fixes"
This reverts commit 47cd6dc351.
2024-07-27 15:26:31 +02:00

169 lines
4.6 KiB
CMake

# 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)
include(GenerateG1A)
include(GenerateG3A)
include(Fxconv)
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)
#set the color mode either to 1b or 2b
set(COLORMODE_fx 2b)
#set the color mode either to 1b, 2b or EGA64
set(COLORMODE_cg EGA64)
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
# ...
)
# Shared assets, fx-9860G-only assets and fx-CG-50-only assets
set(ASSETS
assets/WorldRPG.world
# ...
)
set(ASSETS_cg
assets-cg/demo_player.png
assets-cg/npc/char/npc_male.png
assets-cg/SignAction.png
assets-cg/npc/face/npc_male.png
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_1b
assets-cg/1b/tileset/tileset1b_CG.png
)
set(ASSETS_cg_2b
assets-cg/2b/tileset/tileset2b_CG.png
)
set(ASSETS_cg_EGA64
assets-cg/ega64/tileset/tilesetEGA64_CG.png
)
set(ASSETS_fx
assets-fx/demo_player.png
assets-fx/npc/char/npc_male.png
assets-fx/SignAction.png
assets-fx/npc/face/npc_male.png
assets-fx/npc/face/npc_female.png
assets-fx/npc/face/npc_milkman.png
assets-fx/npc/face/npc_police.png
assets-fx/SGN_Icon.png
assets-fx/INFO_Icon.png
assets-fx/player_face.png
assets-fx/font.png
# ...
)
set(ASSETS_fx_1b
assets-fx/1b/tileset/tileset1b.png
# ...
)
set(ASSETS_fx_2b
assets-fx/2b/tileset/tileset2b.png
# ...
)
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)
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)
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)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
# fx colormode
if("${COLORMODE_fx}" STREQUAL 1b)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR1BIT)
endif()
if("${COLORMODE_fx}" STREQUAL 2b)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR2BIT)
endif()
if("${COLORMODE_fx}" STREQUAL 1b)
generate_g1a(TARGET myaddin OUTPUT "RPG_1b.g1a"
NAME "RPG PC 1b" ICON assets-fx/1b/icon1b.png)
endif()
if("${COLORMODE_fx}" STREQUAL 2b)
generate_g1a(TARGET myaddin OUTPUT "RPG_2b.g1a"
NAME "RPG PC 2b" ICON assets-fx/2b/icon2b.png)
endif()
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
# cg colormode
if("${COLORMODE_cg}" STREQUAL 1b)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR1BIT)
endif()
if("${COLORMODE_cg}" STREQUAL 2b)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR2BIT)
endif()
if("${COLORMODE_cg}" STREQUAL EGA64)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOREGA)
endif()
if("${COLORMODE_cg}" STREQUAL 1b)
generate_g3a(TARGET myaddin OUTPUT "RPG_1b.g3a"
NAME "RPG PC 1b" 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_2b.g3a"
NAME "RPG PC 2b" 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()