Adoranda/CMakeLists.txt

63 lines
1.8 KiB
CMake
Raw Normal View History

2021-07-29 18:33:22 +02:00
# 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)
include_directories(include)
find_package(Gint 2.1 REQUIRED)
fxconv_declare_converters(assets-cg/converters.py)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_LIST_DIR}/assets-cg/maps/testCarte.json"
2021-08-27 22:50:00 +02:00
"${CMAKE_CURRENT_LIST_DIR}/assets-cg/maps/inside/1.json"
"${CMAKE_CURRENT_LIST_DIR}/assets-cg/maps/inside/2.json"
COMMENT "Convert tmx map to json"
COMMAND tiled --export-tileset json tileset.tsx tileset.json
COMMAND tiled --export-map json testCarte.tmx testCarte.json
2021-08-27 22:50:00 +02:00
COMMAND tiled --export-map json inside/1.tmx inside/1.json
COMMAND tiled --export-map json inside/2.tmx inside/2.json
2021-07-29 18:33:22 +02:00
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/assets-cg/maps/
2021-08-27 22:50:00 +02:00
DEPENDS assets-cg/maps/testCarte.tmx
assets-cg/tileset.png
assets-cg/maps/tileset.tsx
assets-cg/converters.py
assets-cg/maps/inside/1.tmx
assets-cg/maps/inside/2.tmx)
2021-08-25 00:29:31 +02:00
2021-07-29 18:33:22 +02:00
set(SOURCES
src/main.c
src/talkable.c
2021-08-25 01:01:43 +02:00
src/vec2.c
2021-07-29 18:33:22 +02:00
src/game.c
src/engine.c
2021-08-25 01:01:43 +02:00
src/camera.c
src/map.c
2021-08-25 01:01:43 +02:00
src/player.c
src/util.c
2021-08-25 01:01:43 +02:00
src/animation.c
2021-07-29 18:33:22 +02:00
)
set(ASSETS_cg
assets-cg/tileset.png
assets-cg/maps/testCarte.json
2021-08-27 22:50:00 +02:00
assets-cg/maps/inside/1.json
assets-cg/maps/inside/2.json
2021-07-29 18:33:22 +02:00
assets-cg/spritesheet.png
)
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_libraries(myaddin Gint::Gint)
target_link_options(myaddin PRIVATE -Wl,-Map=map)
2021-07-29 18:33:22 +02:00
if("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
generate_g3a(TARGET myaddin OUTPUT "MyAddin.g3a"
NAME "MyAddin" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
endif()