~kikoodx/painfull-success-cg

429dfee085732cd499e044f5c9fbcb373cfa345c — KikooDX 1 year, 7 months ago 1ed7169
rewrite CMakeLists.txt
1 files changed, 32 insertions(+), 45 deletions(-)

M CMakeLists.txt
M CMakeLists.txt => CMakeLists.txt +32 -45
@@ 5,20 5,20 @@ cmake_minimum_required(VERSION 3.18)
project(PainfullSuccess)

add_custom_command(OUTPUT "${CMAKE_CURRENT_LIST_DIR}/src/gen_levels.c"
  COMMENT "Generate src/gen_levels.c from KBLE files."
  COMMAND python3 kble.py
  WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
  DEPENDS
    assets/levels/chaos.kble
    assets/levels/damage_boosting_101.kble
    assets/levels/die_and_retry.kble
    assets/levels/dome.kble
    assets/levels/end.kble
    assets/levels/hello_world.kble
    assets/levels/key_101.kble
    assets/levels/so_far_but_so_close.kble
    assets/levels/two_for_one.kble
    assets/levels/up_and_down.kble)
	COMMENT "Generate src/gen_levels.c from KBLE files."
	COMMAND python3 kble.py
	WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
	DEPENDS
		assets/levels/chaos.kble
		assets/levels/damage_boosting_101.kble
		assets/levels/die_and_retry.kble
		assets/levels/dome.kble
		assets/levels/end.kble
		assets/levels/hello_world.kble
		assets/levels/key_101.kble
		assets/levels/so_far_but_so_close.kble
		assets/levels/two_for_one.kble
		assets/levels/up_and_down.kble)

include(GenerateG1A)
include(GenerateG3A)


@@ 27,37 27,24 @@ include_directories(include)
find_package(Gint 2.4.0 REQUIRED)

set(SOURCES
  src/main.c
  src/input.c
  src/level.c
  src/player.c
  src/tiles.c
  src/gen_levels.c
  # ...
	src/main.c
	src/input.c
	src/level.c
	src/player.c
	src/tiles.c
	src/gen_levels.c
	# ...
)
# Shared assets, fx-9860G-only assets and fx-CG-50-only assets
set(ASSETS
  # ...
)
#set(ASSETS_fx
#  assets-fx/example.png
#  # ...
#)
#set(ASSETS_cg
#  assets-cg/example.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)

set(ASSETS)

set(FLAGS -Wall -Wextra -Os -std=c99)

fxconv_declare_assets(${ASSETS} WITH_METADATA)

add_executable(myaddin ${SOURCES} ${ASSETS})
target_compile_options(myaddin PRIVATE ${FLAGS})
target_link_libraries(myaddin Gint::Gint)

#if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
#  generate_g1a(TARGET myaddin OUTPUT "Painfull.g1a"
#    NAME "Painful" ICON assets-fx/icon.png)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
  generate_g3a(TARGET myaddin OUTPUT "PainfullSuccess.g3a"
    NAME "PainSuccess" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
endif()
generate_g3a(TARGET myaddin OUTPUT "${PROJECT_NAME}.g3a"
	NAME "${PROJECT_NAME}" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)