1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-22 10:42:29 +01:00

Fix osx build script

This commit is contained in:
Elias Steurer 2021-01-16 17:31:07 +01:00
parent 4c2cb43af7
commit 9fa317a6c5
4 changed files with 25 additions and 1 deletions

View File

@ -86,6 +86,10 @@ endif()
add_executable(${PROJECT_NAME} ${src} ${headers} ${resources} ${qml})
if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE true)
endif()
if(WIN32)
# Icon
target_sources(${PROJECT_NAME} PRIVATE ScreenPlay.rc)

View File

@ -19,6 +19,8 @@ elseif(UNIX)
set(headers_plattform src/linuxwindow.h)
endif()
set(src main.cpp src/basewindow.cpp)
set(headers src/basewindow.h)
@ -30,9 +32,15 @@ endif()
add_executable(${PROJECT_NAME} ${src} ${headers} ${src_plattform} ${headers_plattform} ${resources})
if(WIN32)
# Disable console window on Windows
# https://stackoverflow.com/questions/8249028/how-do-i-keep-my-qt-c-program-from-opening-a-console-in-windows
set_property(TARGET ${PROJECT_NAME} PROPERTY WIN32_EXECUTABLE true)
endif()
if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE true)
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Quick Qt5::Gui Qt5::Widgets Qt5::Core Qt5::WebEngine ScreenPlaySDK)

View File

@ -18,10 +18,18 @@ else()
qtquick_compiler_add_resources(resources SPWidgetResources.qrc)
endif()
add_executable(${PROJECT_NAME} ${src} ${headers} ${resources})
if(WIN32)
# Disable console window on Windows
# https://stackoverflow.com/questions/8249028/how-do-i-keep-my-qt-c-program-from-opening-a-console-in-windows
set_property(TARGET ${PROJECT_NAME} PROPERTY WIN32_EXECUTABLE true)
endif()
if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE true)
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Quick Qt5::Gui Qt5::Widgets Qt5::Core ScreenPlaySDK)

View File

@ -54,7 +54,7 @@ if platform == "win32":
os.system("install_dependencies_windows.bat")
elif platform == "darwin":
cmake_prefix_path = "~/Qt/" + qt_version + "/clang_64"
deploy_command = "macdeployqt --{type} --qmldir ../../{app}/qml {app}"
deploy_command = "{prefix_path}/bin/macdeployqt {app}.app -qmldir=../../{app}/qml "
cmake_target_triplet = "x64-osx"
print("Executing install_dependencies_linux_mac.sh")
os.system("chmod +x install_dependencies_linux_mac.sh")
@ -98,6 +98,7 @@ cmake_configure_command = """cmake ../
toolchain=cmake_toolchain_file).replace("\n", "")
print("cmake_configure_command: %s" % cmake_configure_command)
print("deploy_command: %s" % deploy_command)
process = subprocess.run(cmake_configure_command, capture_output=True,shell=True)
@ -109,16 +110,19 @@ os.chdir("bin")
os.system((deploy_command).format(
type=cmake_build_type,
prefix_path=cmake_prefix_path,
app="ScreenPlay",
executable_file_ending=executable_file_ending))
os.system((deploy_command).format(
type=cmake_build_type,
prefix_path=cmake_prefix_path,
app="ScreenPlayWidget",
executable_file_ending=executable_file_ending))
os.system((deploy_command).format(
type=cmake_build_type,
prefix_path=cmake_prefix_path,
app="ScreenPlayWallpaper",
executable_file_ending=executable_file_ending))