From fe0ab29cf878b8e5db6b344fb34f1bebb6b950ab Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Sat, 14 Aug 2021 12:44:32 +0200 Subject: [PATCH 1/3] Change mac signing to be opt in --- Tools/build.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Tools/build.py b/Tools/build.py index 5d4c540d..f6d25dbf 100644 --- a/Tools/build.py +++ b/Tools/build.py @@ -24,11 +24,14 @@ def vs_env_dict(): # MAIN 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", + description="Build type. This is either debug or release.") +parser.add_argument('-s', action="store", dest="sign_build", + description="Enable if you want to sign the apps. This is macos only for now.") args = parser.parse_args() 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) qt_version = "5.15.2" @@ -117,7 +120,7 @@ execute(deploy_command.format( app="ScreenPlayWallpaper", 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\" \"ScreenPlayWallpaper.app/\"") execute("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --options \"runtime\" \"ScreenPlayWidget.app/\"") From 3e837e8a70a34a225a50fcc4bbd35d582b3d05d0 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Sat, 14 Aug 2021 12:46:19 +0200 Subject: [PATCH 2/3] Add missing workshop plugin path for mac --- ScreenPlay/app.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ScreenPlay/app.cpp b/ScreenPlay/app.cpp index 2cb253a7..1f7e1186 100644 --- a/ScreenPlay/app.cpp +++ b/ScreenPlay/app.cpp @@ -195,6 +195,11 @@ void App::init() } 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"))); // Must be called last to display a error message on startup by the qml engine From 28a9dd3ec62c0bca5348505f37644afa0deb393f Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Sat, 14 Aug 2021 12:59:43 +0200 Subject: [PATCH 3/3] Add explicit steam deploy version flag This simply disables the copy of the steam_appid.txt --- CMakeLists.txt | 1 + ScreenPlayWorkshop/CMakeLists.txt | 17 +++++++++++------ Tools/build.py | 5 +++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b95c9077..1275ea6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ set(CMAKE_LIBRARY_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(SCREENPLAY_STEAM_DEPLOY OFF) set(SCREENPLAY_STEAM ON) file(MAKE_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}) diff --git a/ScreenPlayWorkshop/CMakeLists.txt b/ScreenPlayWorkshop/CMakeLists.txt index 27fca109..1450dfae 100644 --- a/ScreenPlayWorkshop/CMakeLists.txt +++ b/ScreenPlayWorkshop/CMakeLists.txt @@ -40,6 +40,7 @@ add_library( set(WORKSHOP_PLUGIN_DIR ${CMAKE_BINARY_DIR}/bin/workshop) file(MAKE_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 ARCHIVE_OUTPUT_DIRECTORY ${WORKSHOP_PLUGIN_DIR}) @@ -90,14 +91,18 @@ if(APPLE) COMMENT "Copying steam library into ScreenPlay.app bundle" COMMAND ${CMAKE_COMMAND} -E copy ${steam_bin} ${workshop_install_dir}) - add_custom_command( - TARGET workshopplugin - POST_BUILD - COMMENT "Copying steam_appid.txt into ScreenPlay.app bundle" - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/steam_appid.txt ${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/) + if(NOT SCREENPLAY_STEAM_DEPLOY) + add_custom_command( + TARGET workshopplugin + POST_BUILD + 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/) + endif() else() + if(NOT SCREENPLAY_STEAM_DEPLOY) + 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(${CMAKE_CURRENT_SOURCE_DIR}/steam_appid.txt ${CMAKE_BINARY_DIR}/bin/steam_appid.txt COPYONLY) configure_file(${steam_bin} ${CMAKE_BINARY_DIR}/bin/ COPYONLY) endif() diff --git a/Tools/build.py b/Tools/build.py index f6d25dbf..b3504fb3 100644 --- a/Tools/build.py +++ b/Tools/build.py @@ -25,9 +25,9 @@ def vs_env_dict(): # MAIN parser = argparse.ArgumentParser(description='Build and Package ScreenPlay') parser.add_argument('-t', action="store", dest="build_type", - description="Build type. This is either debug or release.") + help="Build type. This is either debug or release.") parser.add_argument('-s', action="store", dest="sign_build", - description="Enable if you want to sign the apps. This is macos only for now.") + help="Enable if you want to sign the apps. This is macos only for now.") args = parser.parse_args() if not args.build_type: @@ -90,6 +90,7 @@ cmake_configure_command = """cmake ../ -DCMAKE_BUILD_TYPE={type} -DCMAKE_TOOLCHAIN_FILE={toolchain} -DVCPKG_TARGET_TRIPLET={triplet} + -DSCREENPLAY_STEAM_DEPLOY=ON -G "CodeBlocks - Ninja" -B. """.format(