# 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.9 REQUIRED) 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 2b) 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 # ... ) # 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/demo_PNJ.png assets-cg/SignAction.png assets-cg/NPC_Icon.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/levels/tileset1b_CG.png ) set(ASSETS_cg_2b assets-cg/levels/tileset2b_CG.png ) set(ASSETS_cg_EGA64 assets-cg/levels/tilesetEGA64_CG.png ) set(ASSETS_fx assets-fx/demo_player.png assets-fx/demo_PNJ.png assets-fx/SignAction.png assets-fx/NPC_Icon.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/levels/tileset1b.png # ... ) set(ASSETS_fx_2b assets-fx/levels/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}} ) endif() # 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() # 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() 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) if("${COLORMODE_fx}" STREQUAL 1b) generate_g1a(TARGET myaddin OUTPUT "PrjPC1b.g1a" NAME "Col RPG NB" ICON assets-fx/icon1.png) endif() if("${COLORMODE_fx}" STREQUAL 2b) generate_g1a(TARGET myaddin OUTPUT "PrjPC2b.g1a" NAME "Col RPG Grey" ICON assets-fx/icon2.png) endif() elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50) if("${COLORMODE_cg}" STREQUAL 1b) generate_g3a(TARGET myaddin OUTPUT "PrjPC1b.g3a" NAME "Col RPG 1bit" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png) endif() if("${COLORMODE_cg}" STREQUAL 2b) generate_g3a(TARGET myaddin OUTPUT "PrjPC2b.g3a" NAME "Col RPG Grey" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png) endif() if("${COLORMODE_cg}" STREQUAL EGA64) generate_g3a(TARGET myaddin OUTPUT "PrjPCega.g3a" NAME "Col RPG EGA" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png) endif() endif()