diff options
author | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-08-14 17:09:07 +0200 |
---|---|---|
committer | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-08-14 17:09:07 +0200 |
commit | 4a5f7464c14f214eadfeb177705902777f52d326 (patch) | |
tree | eef8b7dc86e83f8fdb0ba27a5abedd62892c51e3 /cmake/nx/NXFunctions.cmake | |
parent | ginput script (diff) | |
parent | Fix artifact path (diff) | |
download | re3-4a5f7464c14f214eadfeb177705902777f52d326.tar re3-4a5f7464c14f214eadfeb177705902777f52d326.tar.gz re3-4a5f7464c14f214eadfeb177705902777f52d326.tar.bz2 re3-4a5f7464c14f214eadfeb177705902777f52d326.tar.lz re3-4a5f7464c14f214eadfeb177705902777f52d326.tar.xz re3-4a5f7464c14f214eadfeb177705902777f52d326.tar.zst re3-4a5f7464c14f214eadfeb177705902777f52d326.zip |
Diffstat (limited to 'cmake/nx/NXFunctions.cmake')
-rw-r--r-- | cmake/nx/NXFunctions.cmake | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/cmake/nx/NXFunctions.cmake b/cmake/nx/NXFunctions.cmake new file mode 100644 index 00000000..f67b3ebc --- /dev/null +++ b/cmake/nx/NXFunctions.cmake @@ -0,0 +1,38 @@ +if(NOT COMMAND nx_generate_nacp) + message(FATAL_ERROR "The `nx_generate_nacp` cmake command is not available. Please use an appropriate Nintendo Switch toolchain.") +endif() + +if(NOT COMMAND nx_create_nro) + message(FATAL_ERROR "The `nx_create_nro` cmake command is not available. Please use an appropriate Nintendo Switch toolchain.") +endif() + +set(CMAKE_EXECUTABLE_SUFFIX ".elf") + +function(reVC_platform_target TARGET) + cmake_parse_arguments(RPT "INSTALL" "" "" ${ARGN}) + + get_target_property(TARGET_TYPE "${TARGET}" TYPE) + if(TARGET_TYPE STREQUAL "EXECUTABLE") + nx_generate_nacp(${TARGET}.nacp + NAME "${TARGET}" + AUTHOR "${${PROJECT}_AUTHOR}" + VERSION "1.0.0-${GIT_SHA1}" + ) + + nx_create_nro(${TARGET} + NACP ${TARGET}.nacp + ICON "${PROJECT_SOURCE_DIR}/res/images/logo_256.jpg" + ) + + if(${PROJECT}_INSTALL AND RPT_INSTALL) + get_target_property(TARGET_OUTPUT_NAME ${TARGET} OUTPUT_NAME) + if(NOT TARGET_OUTPUT_NAME) + set(TARGET_OUTPUT_NAME "${TARGET}") + endif() + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_OUTPUT_NAME}.nro" + DESTINATION "." + ) + endif() + endif() +endfunction() |