1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Add qt quick compiler and fix windows cmd opening in release

This commit is contained in:
Elias Steurer 2020-06-19 18:06:09 +02:00
parent 5fb1ea3a96
commit a72c7ed149
3 changed files with 36 additions and 1 deletions

View File

@ -8,7 +8,7 @@ set(CMAKE_AUTOMOC ON)
find_package( find_package(
Qt5 Qt5
COMPONENTS Quick COMPONENTS Quick
QML QuickCompiler
Widgets Widgets
Gui Gui
WebEngine WebEngine
@ -58,10 +58,23 @@ set(headers app.h
src/util.h src/util.h
src/create.h) src/create.h)
set(resources Resources.qrc) set(resources Resources.qrc)
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
qtquick_compiler_add_resources(${resources})
endif()
add_executable(${PROJECT_NAME} ${src} ${headers} ${resources}) add_executable(${PROJECT_NAME} ${src} ${headers} ${resources})
# 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)
target_compile_definitions(${PROJECT_NAME} PRIVATE "GIT_VERSION=${GIT_VERSION}") target_compile_definitions(${PROJECT_NAME} PRIVATE "GIT_VERSION=${GIT_VERSION}")
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME}

View File

@ -10,6 +10,7 @@ find_package(
Widgets Widgets
Gui Gui
WebEngine WebEngine
QuickCompiler
REQUIRED) REQUIRED)
@ -43,8 +44,18 @@ set( headers
src/basewindow.h) src/basewindow.h)
set(resources SPWResources.qrc) set(resources SPWResources.qrc)
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
qtquick_compiler_add_resources(${resources})
endif()
add_executable(${PROJECT_NAME} ${src} ${headers} ${src_plattform} ${headers_plattform} ${resources}) add_executable(${PROJECT_NAME} ${src} ${headers} ${src_plattform} ${headers_plattform} ${resources})
# 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)
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME}
PRIVATE PRIVATE
Qt5::Quick Qt5::Quick

View File

@ -8,6 +8,7 @@ find_package(
COMPONENTS Quick COMPONENTS Quick
Widgets Widgets
Gui Gui
QuickCompiler
WebEngine WebEngine
REQUIRED) REQUIRED)
@ -20,8 +21,18 @@ set(headers
set(resources set(resources
SPWidgetResources.qrc) SPWidgetResources.qrc)
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
qtquick_compiler_add_resources(${resources})
endif()
add_executable(${PROJECT_NAME} ${src} ${headers} ${resources}) add_executable(${PROJECT_NAME} ${src} ${headers} ${resources})
# 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)
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME}
PRIVATE PRIVATE
Qt5::Quick Qt5::Quick