Merge pull request #2966 from jroweboy/qtifw_build_installer
Qtifw build installer
This commit is contained in:
commit
e1bb198eae
|
@ -303,6 +303,7 @@ get_timestamp(BUILD_DATE)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
add_subdirectory(externals)
|
add_subdirectory(externals)
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
add_subdirectory(dist/installer)
|
||||||
|
|
||||||
|
|
||||||
# Installation instructions
|
# Installation instructions
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
# To use this as a script, make sure you pass in the variables SRC_DIR BUILD_DIR and TARGET_FILE
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(PLATFORM "windows")
|
||||||
|
elseif(APPLE)
|
||||||
|
set(PLATFORM "mac")
|
||||||
|
elseif(UNIX)
|
||||||
|
set(PLATFORM "linux")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Cannot build installer for this unsupported platform")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(DIST_DIR "${BUILD_DIR}/dist")
|
||||||
|
set(ARCHIVE "${PLATFORM}.7z")
|
||||||
|
|
||||||
|
file(MAKE_DIRECTORY ${BUILD_DIR})
|
||||||
|
file(MAKE_DIRECTORY ${DIST_DIR})
|
||||||
|
file(DOWNLOAD https://github.com/citra-emu/ext-windows-bin/raw/master/qtifw/${ARCHIVE}
|
||||||
|
"${BUILD_DIR}/${ARCHIVE}" SHOW_PROGRESS)
|
||||||
|
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${BUILD_DIR}/${ARCHIVE}"
|
||||||
|
WORKING_DIRECTORY "${BUILD_DIR}/")
|
||||||
|
|
||||||
|
set(TARGET_NAME "citra-setup-${PLATFORM}")
|
||||||
|
set(CONFIG_FILE "${SRC_DIR}/config/config_${PLATFORM}.xml")
|
||||||
|
set(INSTALLER_BASE "${BUILD_DIR}/installerbase_${PLATFORM}")
|
||||||
|
set(BINARY_CREATOR "${BUILD_DIR}/binarycreator_${PLATFORM}")
|
||||||
|
set(PACKAGES_DIR "${BUILD_DIR}/packages")
|
||||||
|
file(MAKE_DIRECTORY ${PACKAGES_DIR})
|
||||||
|
|
||||||
|
if (UNIX OR APPLE)
|
||||||
|
execute_process(COMMAND chmod 744 ${BINARY_CREATOR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(COMMAND ${BINARY_CREATOR} -t ${INSTALLER_BASE} -n -c ${CONFIG_FILE} -p ${PACKAGES_DIR} ${TARGET_FILE})
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
execute_process(COMMAND chmod 744 ${TARGET_FILE}.app/Contents/MacOS/${TARGET_NAME})
|
||||||
|
endif()
|
|
@ -0,0 +1,23 @@
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(PLATFORM "windows")
|
||||||
|
elseif(APPLE)
|
||||||
|
set(PLATFORM "mac")
|
||||||
|
elseif(UNIX)
|
||||||
|
set(PLATFORM "linux")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(BUILD_DIR "${CMAKE_BINARY_DIR}/installer")
|
||||||
|
set(DIST_DIR "${BUILD_DIR}/dist")
|
||||||
|
set(TARGET_FILE "${DIST_DIR}/citra-setup-${PLATFORM}")
|
||||||
|
file(MAKE_DIRECTORY ${BUILD_DIR})
|
||||||
|
|
||||||
|
# Adds a custom target that will run the BuildInstaller.cmake file
|
||||||
|
# CMake can't just run a cmake function as a custom command, so this is a way around it.
|
||||||
|
# Calls the cmake command and runs a cmake file in "scripting" mode passing in variables with -D
|
||||||
|
add_custom_command(OUTPUT "${TARGET_FILE}"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -DSRC_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D BUILD_DIR=${BUILD_DIR} -D TARGET_FILE=${TARGET_FILE} -P ${CMAKE_SOURCE_DIR}/CMakeModules/BuildInstaller.cmake
|
||||||
|
WORKING_DIRECTORY ${BUILD_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_target(installer DEPENDS ${TARGET_FILE})
|
|
@ -0,0 +1,9 @@
|
||||||
|
Citra Qt Installer
|
||||||
|
==================
|
||||||
|
|
||||||
|
This contains the configuration files for building Citra's installer.
|
||||||
|
|
||||||
|
Installers can only be built on the platform that they are targeting.
|
||||||
|
|
||||||
|
Build the `installer` target to generate the installer, and the installer will be in
|
||||||
|
${build_dir}/installer/dist/
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Installer>
|
||||||
|
<Name>Citra</Name>
|
||||||
|
<Version>1.0.0</Version>
|
||||||
|
<Title>Citra Updater</Title>
|
||||||
|
<Publisher>Citra Team</Publisher>
|
||||||
|
<!-- e.g. /home/<user>/.citra or /opt/citra if run as root -->
|
||||||
|
<TargetDir>@HomeDir@/.citra</TargetDir>
|
||||||
|
<AdminTargetDir>/opt/citra</AdminTargetDir>
|
||||||
|
<InstallerApplicationIcon>icon</InstallerApplicationIcon>
|
||||||
|
<InstallerWindowIcon>icon.png</InstallerWindowIcon>
|
||||||
|
<RemoteRepositories>
|
||||||
|
<Repository>
|
||||||
|
<Url>https://repo.citra-emu.org</Url>
|
||||||
|
<Enabled>1</Enabled>
|
||||||
|
<DisplayName>Official Citra Repository</DisplayName>
|
||||||
|
</Repository>
|
||||||
|
</RemoteRepositories>
|
||||||
|
</Installer>
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Installer>
|
||||||
|
<Name>Citra</Name>
|
||||||
|
<Version>1.0.0</Version>
|
||||||
|
<Title>Citra Updater</Title>
|
||||||
|
<Publisher>Citra Team</Publisher>
|
||||||
|
<!-- e.g. /Applications/Citra -->
|
||||||
|
<TargetDir>@ApplicationsDir@/Citra</TargetDir>
|
||||||
|
<InstallerApplicationIcon>icon</InstallerApplicationIcon>
|
||||||
|
<InstallerWindowIcon>icon.png</InstallerWindowIcon>
|
||||||
|
<RemoteRepositories>
|
||||||
|
<Repository>
|
||||||
|
<Url>https://repo.citra-emu.org</Url>
|
||||||
|
<Enabled>1</Enabled>
|
||||||
|
<DisplayName>Official Citra Repository</DisplayName>
|
||||||
|
</Repository>
|
||||||
|
</RemoteRepositories>
|
||||||
|
</Installer>
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Installer>
|
||||||
|
<Name>Citra</Name>
|
||||||
|
<Version>1.0.0</Version>
|
||||||
|
<Title>Citra Updater</Title>
|
||||||
|
<Publisher>Citra Team</Publisher>
|
||||||
|
<StartMenuDir>Citra</StartMenuDir>
|
||||||
|
<!-- e.g. C:\home\<user>\AppData\Local\Citra -->
|
||||||
|
<TargetDir>@HomeDir@/AppData/Local/Citra</TargetDir>
|
||||||
|
<InstallerApplicationIcon>icon</InstallerApplicationIcon>
|
||||||
|
<InstallerWindowIcon>icon.png</InstallerWindowIcon>
|
||||||
|
<RemoteRepositories>
|
||||||
|
<Repository>
|
||||||
|
<Url>https://repo.citra-emu.org</Url>
|
||||||
|
<Enabled>1</Enabled>
|
||||||
|
<DisplayName>Official Citra Repository</DisplayName>
|
||||||
|
</Repository>
|
||||||
|
</RemoteRepositories>
|
||||||
|
</Installer>
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
Reference in New Issue