mirror of
https://github.com/x-tools-author/x-tools.git
synced 2025-09-15 15:28:40 +08:00
chore: update files of project
This commit is contained in:
parent
633d7dfffd
commit
6bbeb25fc5
@ -109,7 +109,13 @@ function(sak_set_target_properties target)
|
||||
${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE
|
||||
TRUE)
|
||||
if(WIN32 AND ${CMAKE_BUILD_TYPE} STREQUAL "Release")
|
||||
set_target_properties(${target} PROPERTIES WIN32_EXECUTABLE TRUE)
|
||||
set_target_properties(
|
||||
${target}
|
||||
PROPERTIES ${BUNDLE_ID_OPTION} MACOSX_BUNDLE_BUNDLE_VERSION
|
||||
${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING
|
||||
${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE
|
||||
TRUE WIN32_EXECUTABLE
|
||||
TRUE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
28
.cmake/sak_installer.cmake
Normal file
28
.cmake/sak_installer.cmake
Normal file
@ -0,0 +1,28 @@
|
||||
set(QT_IFW_VERSION "4.6")
|
||||
if(WIN32)
|
||||
set(binarycreator_temp "Tools/QtInstallerFramework/${QT_IFW_VERSION}/bin/binarycreator.exe")
|
||||
set(binarycreator ${QT_DIR}/../../../../../${binarycreator_temp})
|
||||
set(binarysuffix ".exe")
|
||||
elseif(UNIX AND NOT APPLE)
|
||||
set(binarycreator_temp "Tools/QtInstallerFramework/${QT_IFW_VERSION}/bin/binarycreator")
|
||||
set(binarycreator ${QT_DIR}/../../../../../${binarycreator_temp})
|
||||
set(binarysuffix ".run")
|
||||
endif()
|
||||
|
||||
function(sak_generate_installer_with_qt_ifw target root_dir version icon)
|
||||
string(TOLOWER ${target} target_lower)
|
||||
add_custom_target(
|
||||
${target}-Installer
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${root_dir}
|
||||
COMMAND ${CMAKE_COMMAND} -DTARGET=${target} -DROOT_DIR=${root_dir} -DVERSION=${version}
|
||||
-DICON=${icon} -P ${CMAKE_SOURCE_DIR}/.cmake/sak_script_generate_qtifw_resources.cmake
|
||||
COMMAND ${CMAKE_COMMAND} -E echo ${icon}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${icon}
|
||||
${root_dir}/packages/${target}/data/icon.ico
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
${root_dir}/packages/${target}/data
|
||||
COMMAND ${binarycreator} --offline-only -c ${root_dir}/config/config.xml -p ${root_dir}/packages
|
||||
${root_dir}/../${target_lower}-${version}-installer${binarysuffix}
|
||||
SOURCES ${RES_FILES}
|
||||
COMMENT "Start making installer(${target})...")
|
||||
endfunction()
|
||||
66
.cmake/sak_script_generate_qtifw_resources.cmake
Normal file
66
.cmake/sak_script_generate_qtifw_resources.cmake
Normal file
@ -0,0 +1,66 @@
|
||||
if(WIN32)
|
||||
set(sak_endl "\r\n")
|
||||
else()
|
||||
set(sak_endl "\n")
|
||||
endif()
|
||||
|
||||
# config.xml
|
||||
set(config_file ${ROOT_DIR}/config/config.xml)
|
||||
set(target_dir "@HomeDir@/AppData/Roaming/Qsaker")
|
||||
set(uninstaller_option " <MaintenanceToolName>Uninstaller</MaintenanceToolName>${sak_endl}")
|
||||
file(WRITE ${config_file} "<?xml version=\"1.0\" encoding=\"UTF-8\"?>${sak_endl}")
|
||||
file(APPEND ${config_file} "<Installer>${sak_endl}")
|
||||
file(APPEND ${config_file} " <Name>${TARGET}</Name>${sak_endl}")
|
||||
file(APPEND ${config_file} " <Version>${VERSION}</Version>${sak_endl}")
|
||||
file(APPEND ${config_file} " <Title>${TARGET}</Title>${sak_endl}")
|
||||
file(APPEND ${config_file} " <Publisher>Qsaker</Publisher>${sak_endl}")
|
||||
file(APPEND ${config_file} " <StartMenuDir>Qsaker/${TARGET}</StartMenuDir>${sak_endl}")
|
||||
file(APPEND ${config_file} " <TargetDir>${target_dir}/${TARGET}</TargetDir>${sak_endl}")
|
||||
file(APPEND ${config_file} " <RemoveTargetDir>false</RemoveTargetDir>${sak_endl}")
|
||||
file(APPEND ${config_file} " <WizardDefaultHeight>420</WizardDefaultHeight>${sak_endl}")
|
||||
file(APPEND ${config_file} " <WizardStyle>Classic</WizardStyle>${sak_endl}")
|
||||
file(APPEND ${config_file} ${uninstaller_option})
|
||||
file(APPEND ${config_file} "</Installer>")
|
||||
|
||||
# package.xml
|
||||
set(package_file ${ROOT_DIR}/packages/${TARGET}/meta/package.xml)
|
||||
string(TIMESTAMP PACKING_DATE %Y-%m-%d)
|
||||
file(WRITE ${package_file} "<?xml version=\"1.0\" encoding=\"UTF-8\"?>${sak_endl}")
|
||||
file(APPEND ${package_file} "<Package>${sak_endl}")
|
||||
file(APPEND ${package_file} " <DisplayName>EasyDebug</DisplayName>${sak_endl}")
|
||||
file(APPEND ${package_file} " <Description>Installer ${TARGET}</Description>${sak_endl}")
|
||||
file(APPEND ${package_file} " <Version>${VERSION}</Version>${sak_endl}")
|
||||
file(APPEND ${package_file} " <Default>true</Default>${sak_endl}")
|
||||
file(APPEND ${package_file} " <Script>installscript.js</Script>${sak_endl}")
|
||||
file(APPEND ${package_file} " <ReleaseDate>${PACKING_DATE}</ReleaseDate>${sak_endl}")
|
||||
file(APPEND ${package_file} " <ForcedInstallation>true</ForcedInstallation>${sak_endl}")
|
||||
file(APPEND ${package_file} "</Package>${sak_endl}")
|
||||
|
||||
# installscript.js
|
||||
set(script_file ${ROOT_DIR}/packages/${TARGET}/meta/installscript.js)
|
||||
file(WRITE ${script_file} "function Component() {}${sak_endl}")
|
||||
file(APPEND ${script_file} "function Component() {${sak_endl}")
|
||||
file(APPEND ${script_file} "component.createOperations();${sak_endl}")
|
||||
file(APPEND ${script_file} " if (systemInfo.productType === \"windows\") {${sak_endl}")
|
||||
file(APPEND ${script_file} " component.addOperation(\"CreateShortcut\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"@TargetDir@/${TARGET}.exe\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"@StartMenuDir@/${TARGET}.lnk\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"workingDirectory=@TargetDir@\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"iconPath=@TargetDir@/icon.ico\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"description=Open ${TARGET} Program\");${sak_endl}")
|
||||
file(APPEND ${script_file} " component.addOperation(\"CreateShortcut\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"@TargetDir@/${TARGET}.exe\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"@DesktopDir@/${TARGET}.lnk\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"workingDirectory=@TargetDir@\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"iconPath=@TargetDir@/icon.ico\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"description=Open ${TARGET} Program\");${sak_endl}")
|
||||
file(APPEND ${script_file} " component.addOperation(\"CreateShortcut\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"@TargetDir@/Uninstaller.exe\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"@StartMenuDir@/Uninstaller.lnk\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"workingDirectory=@TargetDir@\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"iconPath=%SystemRoot%/system32/SHELL32.dll\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"iconId=101\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"description=Uninstall ${TARGET} Program\",${sak_endl}")
|
||||
file(APPEND ${script_file} " \"--start-uninstaller\");${sak_endl}")
|
||||
file(APPEND ${script_file} " }${sak_endl}")
|
||||
file(APPEND ${script_file} "}${sak_endl}")
|
||||
@ -44,6 +44,7 @@ include(.cmake/sak_git.cmake)
|
||||
include(.cmake/sak_environment.cmake)
|
||||
include(.cmake/sak_deploy.cmake)
|
||||
include(.cmake/sak_font_fontawesome.cmake)
|
||||
include(.cmake/sak_installer.cmake)
|
||||
|
||||
include(.cmake/sak_3rd_glog.cmake)
|
||||
include(.cmake/sak_3rd_nodeeditor.cmake)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user