mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-12-23 20:22:40 +00:00
Merge pull request #244 from pspdev/set-eboot-output-directory
Add support for setting the output directory to create_pbp_file macro
This commit is contained in:
@@ -18,6 +18,7 @@ macro(create_pbp_file)
|
|||||||
PREVIEW_PATH # optional, absolute path to .png file, 480x272
|
PREVIEW_PATH # optional, absolute path to .png file, 480x272
|
||||||
MUSIC_PATH # optional, absolute path to .at3 file
|
MUSIC_PATH # optional, absolute path to .at3 file
|
||||||
VERSION # optional, adds version information to PARAM.SFO
|
VERSION # optional, adds version information to PARAM.SFO
|
||||||
|
OUTPUT_DIR # optional, set the output directory for the EBOOT.PBP
|
||||||
)
|
)
|
||||||
set(options
|
set(options
|
||||||
BUILD_PRX # optional, generates and uses PRX file instead of ELF in EBOOT.PBP
|
BUILD_PRX # optional, generates and uses PRX file instead of ELF in EBOOT.PBP
|
||||||
@@ -30,6 +31,20 @@ macro(create_pbp_file)
|
|||||||
set(ARG_VERSION "")
|
set(ARG_VERSION "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# set output directory to where the target is build if not set
|
||||||
|
if (NOT DEFINED ARG_OUTPUT_DIR)
|
||||||
|
set(ARG_OUTPUT_DIR $<TARGET_FILE_DIR:${ARG_TARGET}>)
|
||||||
|
else()
|
||||||
|
# Make sure the output directory exists
|
||||||
|
if(NOT IS_DIRECTORY ${ARG_OUTPUT_DIR})
|
||||||
|
add_custom_command(
|
||||||
|
TARGET ${APP} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||||
|
${ARG_OUTPUT_DIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# As pack-pbp takes undefined arguments in form of "NULL" string,
|
# As pack-pbp takes undefined arguments in form of "NULL" string,
|
||||||
# set each undefined macro variable to such value:
|
# set each undefined macro variable to such value:
|
||||||
foreach(arg ${oneValueArgs})
|
foreach(arg ${oneValueArgs})
|
||||||
@@ -146,6 +161,13 @@ macro(create_pbp_file)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
TARGET ${APP} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E remove
|
||||||
|
${ARG_OUTPUT_DIR}/PARAM.SFO
|
||||||
|
COMMENT "Cleaning up PARAM.SFO for target ${ARG_TARGET}"
|
||||||
|
)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${ARG_TARGET}
|
TARGET ${ARG_TARGET}
|
||||||
POST_BUILD COMMAND
|
POST_BUILD COMMAND
|
||||||
|
|||||||
Reference in New Issue
Block a user