Collab_RPG/CMakeLists.txt

55 lines
1.8 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(Fxconv)
find_package(Gint 2.9 REQUIRED)
find_package(LibProf 2.4 REQUIRED)
fxconv_declare_converters(assets-fx/converters.py)
add_custom_command(
COMMENT "Convert Tiled TMX map to usable JSON file"
COMMAND tiled --export-tileset json tilesetnpp.tsx tilesetnpp.json
COMMAND find | grep .*.tmx | sed 's/.tmx//g' | xargs -l bash -c 'tiled --export-map json $$0.tmx $$0.json'
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/assets-fx/levels/
OUTPUT "${CMAKE_CURRENT_LIST_DIR}/assets-fx/levels/level0.json"
# if several levels/maps are created, just copy the previous line and change the .json name with the new level/map
DEPENDS assets-fx/converters.py
assets-fx/levels/tileset.png
assets-fx/levels/tilesetnpp.tsx
assets-fx/levels/level0.tmx
# if several levels/maps are created, just copy the previous line and change the .json name with the new level/map
)
set(SOURCES
src/main.c
src/map.c
# ...
)
# Shared assets, fx-9860G-only assets and fx-CG-50-only assets
set(ASSETS
# ...
)
set(ASSETS_fx
assets-fx/levels/tileset.png
assets-fx/levels/level0.json
# ...
)
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os)
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)
generate_g1a(TARGET myaddin OUTPUT "Prj_PC.g1a"
NAME "Collab RPG" ICON assets-fx/icon.png)
endif()