Skip to content

Commit

Permalink
cmake: add linux release packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
Cpasjuste committed Mar 21, 2019
1 parent a3079bc commit d583916
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ add_subdirectory(libcross2dui)
project(pemu)

# pnes
set(PNES_VERSION_MAJOR 1)
set(PNES_VERSION_MAJOR 3)
set(PNES_VERSION_MINOR 1)
add_subdirectory(pnes)

Expand Down
25 changes: 25 additions & 0 deletions pfba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,31 @@ target_include_directories(${PROJECT_NAME}.elf PRIVATE ${INC})
target_link_libraries(${PROJECT_NAME}.elf cross2dui ${LDFLAGS})
add_dependencies(${PROJECT_NAME}.elf ${PROJECT_NAME}.data)

###########################
# LINUX (ubuntu, release)
###########################
if (BUILD_LINUX)
add_custom_target(${PROJECT_NAME}_release_linux.zip
DEPENDS ${PROJECT_NAME}.elf
COMMAND rm -rf ${CMAKE_BINARY_DIR}/release/pfba
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/pfba
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/pfba/skins
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/pfba/roms
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/pfba/hiscores
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/pfba/titles
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/pfba/previews
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/pfba/icons
COMMAND cp -f ${CMAKE_CURRENT_BINARY_DIR}/pfba.elf ${CMAKE_BINARY_DIR}/release/pfba/pfba
COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/pfba/data/hiscore.dat ${CMAKE_BINARY_DIR}/release/pfba/hiscores
# zip skin
COMMAND rm -rf ${CMAKE_BINARY_DIR}/release/pfba/skins/default.zip
COMMAND zip -j ${CMAKE_BINARY_DIR}/release/pfba/skins/default.zip ${CMAKE_CURRENT_SOURCE_DIR}/pfba/data/skin/*
# zip release
COMMAND rm -rf ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-${PFBA_VERSION_MAJOR}.${PFBA_VERSION_MINOR}_linux.zip
COMMAND cd ${CMAKE_BINARY_DIR}/release && zip -r ../${PROJECT_NAME}-${PFBA_VERSION_MAJOR}.${PFBA_VERSION_MINOR}_linux.zip pfba && cd ${CMAKE_BINARY_DIR}
)
endif (BUILD_LINUX)

#####################
# PSP2 (vita) vpk
#####################
Expand Down
26 changes: 25 additions & 1 deletion pnes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,31 @@ target_compile_options(${PROJECT_NAME}.elf PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-st
target_link_libraries(${PROJECT_NAME}.elf cross2dui ${NESTOPIA_LDFLAGS})
add_dependencies(${PROJECT_NAME}.elf ${PROJECT_NAME}.data)

## TODO: use cross2d targets
###########################
# LINUX (ubuntu, release)
###########################
if (BUILD_LINUX)
add_custom_target(${PROJECT_NAME}_linux_release.zip
DEPENDS ${PROJECT_NAME}.elf
COMMAND rm -rf ${CMAKE_BINARY_DIR}/release/pnes
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/pnes
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/pnes/skins
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/pnes/roms
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/pnes/titles
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/pnes/previews
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/pnes/icons
COMMAND cp -f ${CMAKE_CURRENT_BINARY_DIR}/pnes.elf ${CMAKE_BINARY_DIR}/release/pnes/pnes
COMMAND cp -f ${CMAKE_SOURCE_DIR}/cores/nestopia/NstDatabase.xml ${CMAKE_BINARY_DIR}/release/pnes/
# zip skin
COMMAND rm -rf ${CMAKE_BINARY_DIR}/release/pnes/skins/default.zip
COMMAND zip -j ${CMAKE_BINARY_DIR}/release/pnes/skins/default.zip ${CMAKE_CURRENT_SOURCE_DIR}/pnes/data/skin/*
# zip release
COMMAND rm -rf ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-${PNES_VERSION_MAJOR}.${PNES_VERSION_MINOR}_linux.zip
COMMAND cd ${CMAKE_BINARY_DIR}/release && zip -r ../${PROJECT_NAME}-${PNES_VERSION_MAJOR}.${PNES_VERSION_MINOR}_linux.zip pnes
COMMAND cd ${CMAKE_CURRENT_BINARY_DIR}
)
endif (BUILD_LINUX)

#####################
# PSP2 (vita) target
#####################
Expand Down
24 changes: 24 additions & 0 deletions psnes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,30 @@ target_compile_options(${PROJECT_NAME}.elf PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-fn
target_link_libraries(${PROJECT_NAME}.elf cross2dui ${SNES9X_LDFLAGS})
add_dependencies(${PROJECT_NAME}.elf ${PROJECT_NAME}.data)

###########################
# LINUX (ubuntu, release)
###########################
if (BUILD_LINUX)
add_custom_target(${PROJECT_NAME}_linux_release.zip
DEPENDS ${PROJECT_NAME}.elf
COMMAND rm -rf ${CMAKE_BINARY_DIR}/release/psnes
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/psnes
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/psnes/skins
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/psnes/roms
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/psnes/titles
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/psnes/previews
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/release/psnes/icons
COMMAND cp -f ${CMAKE_CURRENT_BINARY_DIR}/psnes.elf ${CMAKE_BINARY_DIR}/release/psnes/psnes
COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/psnes/data/databases/Super_Nintendo_Entertainment_System-hyperspin.xml ${CMAKE_BINARY_DIR}/release/psnes/db.xml
# zip skin
COMMAND rm -rf ${CMAKE_BINARY_DIR}/release/psnes/skins/default.zip
COMMAND zip -j ${CMAKE_BINARY_DIR}/release/psnes/skins/default.zip ${CMAKE_CURRENT_SOURCE_DIR}/psnes/data/skin/*
# zip release
COMMAND rm -rf ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-${PSNES_VERSION_MAJOR}.${PSNES_VERSION_MINOR}_linux.zip
COMMAND cd ${CMAKE_BINARY_DIR}/release && zip -r ../${PROJECT_NAME}-${PSNES_VERSION_MAJOR}.${PSNES_VERSION_MINOR}_linux.zip psnes && cd ${CMAKE_BINARY_DIR}
)
endif (BUILD_LINUX)

#####################
# PSP2 (vita) target
#####################
Expand Down

0 comments on commit d583916

Please sign in to comment.