Skip to content

Commit

Permalink
cmake: better handling for missing default icon/etc
Browse files Browse the repository at this point in the history
  • Loading branch information
fincs committed Sep 24, 2022
1 parent 7d622da commit 5addce4
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 21 deletions.
3 changes: 0 additions & 3 deletions cmake/3ds/3DS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,3 @@ if (NOT CTR_TEX3DS_EXE)
endif()

find_file(CTR_DEFAULT_ICON NAMES default_icon.png HINTS "${CTR_ROOT}" NO_CMAKE_FIND_ROOT_PATH)
if (NOT CTR_DEFAULT_ICON AND NOT DKP_PLATFORM_BOOTSTRAP)
message(FATAL_ERROR "Could not find default icon: try installing libctru")
endif()
3 changes: 3 additions & 0 deletions cmake/3ds/Nintendo3DS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ function(ctr_generate_smdh)
set(SMDH_AUTHOR "Unspecified Author")
endif()
if (NOT DEFINED SMDH_ICON)
if(NOT CTR_DEFAULT_ICON)
message(FATAL_ERROR "ctr_generate_smdh: could not find default icon, try installing libctru")
endif()
set(SMDH_ICON "${CTR_DEFAULT_ICON}")
else()
get_filename_component(SMDH_ICON "${SMDH_ICON}" ABSOLUTE)
Expand Down
4 changes: 2 additions & 2 deletions cmake/gba/GBA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ __dkp_platform_prefix(

find_program(PKG_CONFIG_EXECUTABLE NAMES arm-none-eabi-pkg-config HINTS "${DEVKITPRO}/portlibs/gba/bin")
if (NOT PKG_CONFIG_EXECUTABLE)
message(WARNING "Could not find arm-none-eabi-pkg-config: try installing gba-pkg-config")
message(FATAL_ERROR "Could not find arm-none-eabi-pkg-config: try installing gba-pkg-config")
endif()

find_program(GBA_GBAFIX_EXE NAMES gbafix HINTS "${DEVKITPRO}/tools/bin")
if (NOT GBA_GBAFIX_EXE)
message(WARNING "Could not find gbafix: try installing gba-tools")
message(FATAL_ERROR "Could not find gbafix: try installing gba-tools")
endif()

include(dkp-gba-ds-common)
11 changes: 2 additions & 9 deletions cmake/nds/NDS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,15 @@ __dkp_platform_prefix(

find_program(PKG_CONFIG_EXECUTABLE NAMES arm-none-eabi-pkg-config HINTS "${DEVKITPRO}/portlibs/nds/bin")
if (NOT PKG_CONFIG_EXECUTABLE)
message(WARNING "Could not find arm-none-eabi-pkg-config: try installing nds-pkg-config")
message(FATAL_ERROR "Could not find arm-none-eabi-pkg-config: try installing nds-pkg-config")
endif()

find_program(NDS_NDSTOOL_EXE NAMES ndstool HINTS "${DEVKITPRO}/tools/bin")
if (NOT NDS_NDSTOOL_EXE)
message(WARNING "Could not find ndstool: try installing ndstool")
message(FATAL_ERROR "Could not find ndstool: try installing ndstool")
endif()

find_file(NDS_DEFAULT_ICON NAMES icon.bmp HINTS "${DEVKITPRO}/libnds" NO_CMAKE_FIND_ROOT_PATH)
if (NOT NDS_DEFAULT_ICON AND NOT DKP_PLATFORM_BOOTSTRAP)
message(WARNING "Could not find default icon: try installing libnds")
endif()

find_file(NDS_DEFAULT_ARM7 NAMES default.elf HINTS "${DEVKITPRO}/libnds" NO_CMAKE_FIND_ROOT_PATH)
if (NOT NDS_DEFAULT_ARM7 AND NOT DKP_PLATFORM_BOOTSTRAP)
message(WARNING "Could not find default ARM7 component: try installing default-arm7")
endif()

include(dkp-gba-ds-common)
3 changes: 3 additions & 0 deletions cmake/nds/NintendoDS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ function(nds_create_rom target)
endif()

if(NOT DEFINED NDSTOOL_ARM7)
if(NOT NDS_DEFAULT_ARM7)
message(FATAL_ERROR "Could not find default ARM7 component: try installing default-arm7")
endif()
set(NDSTOOL_ARM7 "${NDS_DEFAULT_ARM7}")
elseif(NOT TARGET "${NDSTOOL_ARM7}" AND NOT IS_ABSOLUTE "${NDSTOOL_ARM7}")
message(FATAL_ERROR "nds_create_rom: ARM7 component must either be an imported target or an absolute path")
Expand Down
8 changes: 4 additions & 4 deletions cmake/ogc/ogc-common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ __dkp_platform_prefix(

find_program(PKG_CONFIG_EXECUTABLE NAMES powerpc-eabi-pkg-config HINTS "${DEVKITPRO}/portlibs/${OGC_CONSOLE}/bin")
if (NOT PKG_CONFIG_EXECUTABLE)
message(WARNING "Could not find powerpc-eabi-pkg-config: try installing ${OGC_CONSOLE}-pkg-config")
message(FATAL_ERROR "Could not find powerpc-eabi-pkg-config: try installing ${OGC_CONSOLE}-pkg-config")
endif()

find_program(ELF2DOL_EXE NAMES elf2dol HINTS "${DEVKITPRO}/tools/bin")
if (NOT ELF2DOL_EXE)
message(WARNING "Could not find elf2dol: try installing gamecube-tools")
message(FATAL_ERROR "Could not find elf2dol: try installing gamecube-tools")
endif()

find_program(GCDSPTOOL_EXE NAMES gcdsptool HINTS "${DEVKITPRO}/tools/bin")
if (NOT GCDSPTOOL_EXE)
message(WARNING "Could not find gcdsptool: try installing gamecube-tools")
message(FATAL_ERROR "Could not find gcdsptool: try installing gamecube-tools")
endif()

find_program(GXTEXCONV_EXE NAMES gxtexconv HINTS "${DEVKITPRO}/tools/bin")
if (NOT GXTEXCONV_EXE)
message(WARNING "Could not find gxtexconv: try installing gamecube-tools")
message(FATAL_ERROR "Could not find gxtexconv: try installing gamecube-tools")
endif()
3 changes: 3 additions & 0 deletions cmake/switch/NintendoSwitch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ function(nx_create_nro target)
endif()

if (NOT DEFINED ELF2NRO_ICON AND NOT ELF2NRO_NOICON)
if(NOT NX_DEFAULT_ICON)
message(FATAL_ERROR "nx_create_nro: could not find default icon, try installing libnx")
endif()
set(ELF2NRO_ICON "${NX_DEFAULT_ICON}")
endif()

Expand Down
3 changes: 0 additions & 3 deletions cmake/switch/Switch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,3 @@ if (NOT NX_UAM_EXE)
endif()

find_file(NX_DEFAULT_ICON NAMES default_icon.jpg HINTS "${NX_ROOT}" NO_CMAKE_FIND_ROOT_PATH)
if (NOT NX_DEFAULT_ICON AND NOT DKP_PLATFORM_BOOTSTRAP)
message(FATAL_ERROR "Could not find default icon: try installing libnx")
endif()

0 comments on commit 5addce4

Please sign in to comment.