mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-05 10:32:28 +01:00
Add cpack IFW installer
Update to Qt 6.2.2
This commit is contained in:
parent
c6c3e9abbe
commit
eabe625cd9
@ -1,6 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.16.0)
|
||||
|
||||
project(ScreenPlay LANGUAGES CXX)
|
||||
project(ScreenPlay
|
||||
VERSION 0.15.0
|
||||
DESCRIPTION "Modern, Cross Plattform, Live Wallpaper, Widgets and AppDrawer!"
|
||||
HOMEPAGE_URL "https://screen-play.app/"
|
||||
LANGUAGES CXX)
|
||||
|
||||
# This sets cmake to compile all dlls into the main directory
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
@ -8,7 +12,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
option(SCREENPLAY_STEAM "For FOSS distribution so we do not bundle proprietary code." ON)
|
||||
option(TESTS_ENABLED OFF)
|
||||
option(SCREENPLAY_TESTS "Enables UI tests." OFF)
|
||||
option(SCREENPLAY_CREATE_INSTALLER "Indicates whether an installer via the Qt Installer Framework is created." OFF)
|
||||
|
||||
# Add our *.cmake diretory to the CMAKE_MODULE_PATH, so that our includes are found
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
|
||||
@ -25,7 +30,7 @@ elseif(APPLE)
|
||||
set(VCPKG_ARCH "x64-osx")
|
||||
endif()
|
||||
|
||||
if(${TESTS_ENABLED})
|
||||
if(${SCREENPLAY_TESTS})
|
||||
enable_testing()
|
||||
endif()
|
||||
|
||||
@ -73,6 +78,7 @@ add_subdirectory(ScreenPlayWallpaper)
|
||||
add_subdirectory(ScreenPlayWidget)
|
||||
add_subdirectory(ScreenPlayUtil)
|
||||
add_subdirectory(CMake)
|
||||
add_subdirectory(Tools)
|
||||
|
||||
if(${SCREENPLAY_STEAM})
|
||||
add_subdirectory(ScreenPlayWorkshop)
|
||||
@ -85,13 +91,69 @@ if(WIN32)
|
||||
add_subdirectory(ScreenPlaySysInfo)
|
||||
endif()
|
||||
|
||||
message(STATUS "[DEFINE] SOURCE_DIR = ${SOURCE_DIR}")
|
||||
message(STATUS "[DEFINE] BUILD_DATE = ${BUILD_DATE}")
|
||||
message(STATUS "[DEFINE] GIT_COMMIT_HASH = ${GIT_COMMIT_HASH}")
|
||||
message(STATUS "[OPTION] SCREENPLAY_STEAM = ${SCREENPLAY_STEAM}")
|
||||
message(STATUS "[OPTION] TESTS_ENABLED = ${TESTS_ENABLED}")
|
||||
message(STATUS "[PROJECT] CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}")
|
||||
message(STATUS "[PROJECT] VCPKG_PATH = ${VCPKG_PATH}")
|
||||
message(STATUS "[PROJECT] VCPKG_ARCH = ${VCPKG_ARCH}")
|
||||
message(STATUS "[PROJECT] CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}")
|
||||
message(STATUS "[PROJECT] VCPKG_TARGET_TRIPLET = ${VCPKG_TARGET_TRIPLET}")
|
||||
message(STATUS "[DEFINE] SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
message(STATUS "[DEFINE] BUILD_DATE = ${BUILD_DATE}")
|
||||
message(STATUS "[DEFINE] BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
|
||||
message(STATUS "[DEFINE] GIT_COMMIT_HASH = ${GIT_COMMIT_HASH}")
|
||||
message(STATUS "[OPTION] SCREENPLAY_CREATE_INSTALLER = ${SCREENPLAY_CREATE_INSTALLER}")
|
||||
message(STATUS "[OPTION] SCREENPLAY_STEAM = ${SCREENPLAY_STEAM}")
|
||||
message(STATUS "[OPTION] SCREENPLAY_TESTS = ${SCREENPLAY_TESTS}")
|
||||
message(STATUS "[PROJECT] CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}")
|
||||
message(STATUS "[PROJECT] VCPKG_PATH = ${VCPKG_PATH}")
|
||||
message(STATUS "[PROJECT] VCPKG_TARGET_TRIPLET = ${VCPKG_TARGET_TRIPLET}")
|
||||
message(STATUS "[PROJECT] CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}")
|
||||
|
||||
|
||||
if(${SCREENPLAY_CREATE_INSTALLER})
|
||||
|
||||
|
||||
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-Installer")
|
||||
set(CPACK_PACKAGE_VENDOR "Elias Steurer")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
|
||||
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
|
||||
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
|
||||
|
||||
# Ensures that contents written to the CPack configuration files is escaped properly.
|
||||
set(CPACK_VERBATIM_VARIABLES TRUE)
|
||||
|
||||
set(CPACK_GENERATOR IFW)
|
||||
|
||||
set(CPACK_IFW_PACKAGE_START_MENU_DIRECTORY "") # empty => default is install to top-level (?)
|
||||
set(CPACK_IFW_TARGET_DIRECTORY "@HomeDir@/${CMAKE_PROJECT_NAME}")
|
||||
set(CPACK_IFW_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/ScreenPlay/assets/icons/app.ico")
|
||||
set(CPACK_IFW_PACKAGE_WINDOW_ICON "${CMAKE_CURRENT_SOURCE_DIR}/ScreenPlay/assets/icons/app.ico")
|
||||
|
||||
set(CPACK_COMPONENTS_GROUPING IGNORE)
|
||||
set(CPACK_IFW_PACKAGE_GROUP ScreenPlay)
|
||||
|
||||
# Install Windows Universal CRT libs for app-local deployment
|
||||
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
|
||||
set(CPACK_IFW_PACKAGE_CONTROL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/Tools/Installer/installscript.qs")
|
||||
|
||||
set(CPACK_IFW_VERBOSE ON)
|
||||
|
||||
include(CPack)
|
||||
include(CPackIFW)
|
||||
|
||||
install(
|
||||
DIRECTORY "${CMAKE_BINARY_DIR}/bin/"
|
||||
COMPONENT ScreenPlay
|
||||
DESTINATION "/")
|
||||
|
||||
cpack_add_component(
|
||||
K3000
|
||||
DISPLAY_NAME "ScreenPlay"
|
||||
DESCRIPTION "This installs ScreenPlay.")
|
||||
|
||||
cpack_ifw_configure_component(
|
||||
ScreenPlay FORCED_INSTALLATION
|
||||
NAME "ScreenPlay"
|
||||
DESCRIPTION "Welcome to the ScreenPlay installer."
|
||||
# Gets ignored and I do not know why
|
||||
SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/Tools/Installer/installscript.qs"
|
||||
CHECKABLE FALSE)
|
||||
|
||||
endif()
|
||||
|
||||
|
13
Tools/CMakeLists.txt
Normal file
13
Tools/CMakeLists.txt
Normal file
@ -0,0 +1,13 @@
|
||||
project(Tools LANGUAGES CXX)
|
||||
|
||||
file(GLOB PYTHON *.py)
|
||||
|
||||
set(FILES
|
||||
# cmake-format: sortable
|
||||
Installer/package.xml
|
||||
Installer/installscript.qs)
|
||||
|
||||
add_custom_target(
|
||||
${PROJECT_NAME}
|
||||
SOURCES ${FILES} ${PYTHON}
|
||||
COMMENT "Dummy target to list these files in the IDE")
|
14
Tools/Installer/installscript.qs
Normal file
14
Tools/Installer/installscript.qs
Normal file
@ -0,0 +1,14 @@
|
||||
function Component()
|
||||
{
|
||||
// Install to @RootDir@ instead of @HomeDir@ on Windows
|
||||
if (installer.value("os") === "win") {
|
||||
var homeDir = installer.value("HomeDir");
|
||||
var targetDir = installer.value("TargetDir").replace(homeDir, "@RootDir@");
|
||||
installer.setValue("TargetDir", targetDir);
|
||||
}
|
||||
|
||||
// do not show component selection page
|
||||
installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
|
||||
// no startmenu entry so no need to ask where to create it
|
||||
installer.setDefaultPageVisible(QInstaller.StartMenuSelection, false);
|
||||
}
|
9
Tools/Installer/package.xml
Normal file
9
Tools/Installer/package.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Package>
|
||||
<DisplayName>Register a file extension</DisplayName>
|
||||
<Description>Register a randomly generated file extension to open with notepad.exe</Description>
|
||||
<Version>1.0.0-1</Version>
|
||||
<ReleaseDate>2020-01-01</ReleaseDate>
|
||||
<Default>true</Default>
|
||||
<Script>installscript.qs</Script>
|
||||
</Package>
|
@ -45,7 +45,7 @@ if not args.build_type:
|
||||
print("Build type argument is missing (release,debug). Example: python build.py -t release -steam=True")
|
||||
sys.exit(1)
|
||||
|
||||
qt_version = "6.2.1"
|
||||
qt_version = "6.2.2"
|
||||
steam_build = "OFF"
|
||||
if args.steam_build:
|
||||
if args.steam_build:
|
||||
@ -182,3 +182,6 @@ for filename in os.listdir(os.getcwd()):
|
||||
full_file_path = os.path.join(os.getcwd(), filename)
|
||||
print("Remove: %s" % full_file_path)
|
||||
os.remove(full_file_path)
|
||||
|
||||
os.chdir("..")
|
||||
execute("cpack")
|
Loading…
Reference in New Issue
Block a user