1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-06 19:12:30 +01:00

Merge remote-tracking branch 'origin/master'

This commit is contained in:
Elias Steurer 2021-08-14 13:39:41 +02:00
commit a8b4f15fea
4 changed files with 24 additions and 9 deletions

View File

@ -7,6 +7,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(SCREENPLAY_STEAM_DEPLOY OFF)
set(SCREENPLAY_STEAM ON) set(SCREENPLAY_STEAM ON)
set(TESTS_ENABLED OFF) set(TESTS_ENABLED OFF)

View File

@ -195,6 +195,11 @@ void App::init()
} }
qmlRegisterSingletonInstance("ScreenPlay", 1, 0, "ScreenPlay", this); qmlRegisterSingletonInstance("ScreenPlay", 1, 0, "ScreenPlay", this);
#ifdef Q_OS_MACOS
// Needed for macos .app files
m_mainWindowEngine->addPluginPath(QGuiApplication::instance()->applicationDirPath());
#endif
m_mainWindowEngine->load(QUrl(QStringLiteral("qrc:/main.qml"))); m_mainWindowEngine->load(QUrl(QStringLiteral("qrc:/main.qml")));
// Must be called last to display a error message on startup by the qml engine // Must be called last to display a error message on startup by the qml engine

View File

@ -40,6 +40,7 @@ add_library(
set(WORKSHOP_PLUGIN_DIR ${CMAKE_BINARY_DIR}/bin/workshop) set(WORKSHOP_PLUGIN_DIR ${CMAKE_BINARY_DIR}/bin/workshop)
file(MAKE_DIRECTORY ${WORKSHOP_PLUGIN_DIR}) file(MAKE_DIRECTORY ${WORKSHOP_PLUGIN_DIR})
set_target_properties(workshopplugin PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${WORKSHOP_PLUGIN_DIR}) set_target_properties(workshopplugin PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${WORKSHOP_PLUGIN_DIR})
set_target_properties(workshopplugin PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${WORKSHOP_PLUGIN_DIR}) set_target_properties(workshopplugin PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${WORKSHOP_PLUGIN_DIR})
set_target_properties(workshopplugin PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${WORKSHOP_PLUGIN_DIR}) set_target_properties(workshopplugin PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${WORKSHOP_PLUGIN_DIR})
@ -90,14 +91,18 @@ if(APPLE)
COMMENT "Copying steam library into ScreenPlay.app bundle" COMMENT "Copying steam library into ScreenPlay.app bundle"
COMMAND ${CMAKE_COMMAND} -E copy ${steam_bin} ${workshop_install_dir}) COMMAND ${CMAKE_COMMAND} -E copy ${steam_bin} ${workshop_install_dir})
if(NOT SCREENPLAY_STEAM_DEPLOY)
add_custom_command( add_custom_command(
TARGET workshopplugin TARGET workshopplugin
POST_BUILD POST_BUILD
COMMENT "Copying steam_appid.txt into ScreenPlay.app bundle" COMMENT "Copying steam_appid.txt into ScreenPlay.app bundle. This is for development only!"
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/steam_appid.txt ${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/) COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/steam_appid.txt ${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/)
endif()
else() else()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qmldir ${WORKSHOP_PLUGIN_DIR}/qmldir COPYONLY) if(NOT SCREENPLAY_STEAM_DEPLOY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/steam_appid.txt ${CMAKE_BINARY_DIR}/bin/steam_appid.txt COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/steam_appid.txt ${CMAKE_BINARY_DIR}/bin/steam_appid.txt COPYONLY)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qmldir ${WORKSHOP_PLUGIN_DIR}/qmldir COPYONLY)
configure_file(${steam_bin} ${CMAKE_BINARY_DIR}/bin/ COPYONLY) configure_file(${steam_bin} ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
endif() endif()

View File

@ -24,11 +24,14 @@ def vs_env_dict():
# MAIN # MAIN
parser = argparse.ArgumentParser(description='Build and Package ScreenPlay') parser = argparse.ArgumentParser(description='Build and Package ScreenPlay')
parser.add_argument('-t', action="store", dest="build_type") parser.add_argument('-t', action="store", dest="build_type",
help="Build type. This is either debug or release.")
parser.add_argument('-s', action="store", dest="sign_build",
help="Enable if you want to sign the apps. This is macos only for now.")
args = parser.parse_args() args = parser.parse_args()
if not args.build_type: if not args.build_type:
print("Build type argument is missing (release,debug). Example: python build.py -t release") print("Build type argument is missing (release,debug). Example: python build.py -t release -s=True")
sys.exit(1) sys.exit(1)
qt_version = "5.15.2" qt_version = "5.15.2"
@ -87,6 +90,7 @@ cmake_configure_command = """cmake ../
-DCMAKE_BUILD_TYPE={type} -DCMAKE_BUILD_TYPE={type}
-DCMAKE_TOOLCHAIN_FILE={toolchain} -DCMAKE_TOOLCHAIN_FILE={toolchain}
-DVCPKG_TARGET_TRIPLET={triplet} -DVCPKG_TARGET_TRIPLET={triplet}
-DSCREENPLAY_STEAM_DEPLOY=ON
-G "CodeBlocks - Ninja" -G "CodeBlocks - Ninja"
-B. -B.
""".format( """.format(
@ -117,7 +121,7 @@ execute(deploy_command.format(
app="ScreenPlayWallpaper", app="ScreenPlayWallpaper",
executable_file_ending=executable_file_ending)) executable_file_ending=executable_file_ending))
if platform == "darwin": if platform == "darwin" and args.sign_build:
execute("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --options \"runtime\" \"ScreenPlay.app/\"") execute("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --options \"runtime\" \"ScreenPlay.app/\"")
execute("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --options \"runtime\" \"ScreenPlayWallpaper.app/\"") execute("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --options \"runtime\" \"ScreenPlayWallpaper.app/\"")
execute("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --options \"runtime\" \"ScreenPlayWidget.app/\"") execute("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --options \"runtime\" \"ScreenPlayWidget.app/\"")