2020-10-29 18:53:52 +01:00
|
|
|
project(ScreenPlayWidget LANGUAGES CXX)
|
2020-05-16 13:37:32 +02:00
|
|
|
|
2021-01-28 15:19:46 +01:00
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
2020-03-10 12:16:58 +01:00
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
2020-05-16 13:37:32 +02:00
|
|
|
|
2021-07-11 08:27:13 +02:00
|
|
|
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core)
|
2020-10-29 18:53:52 +01:00
|
|
|
set(src main.cpp src/widgetwindow.cpp)
|
2020-05-16 13:37:32 +02:00
|
|
|
|
2020-10-29 18:53:52 +01:00
|
|
|
set(headers src/widgetwindow.h)
|
2020-05-16 13:37:32 +02:00
|
|
|
|
2020-08-30 17:23:08 +02:00
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
2021-06-25 12:06:43 +02:00
|
|
|
qt_add_resources(resources SPWidgetResources.qrc)
|
2020-07-10 20:49:11 +02:00
|
|
|
else()
|
2020-10-29 18:53:52 +01:00
|
|
|
qtquick_compiler_add_resources(resources SPWidgetResources.qrc)
|
2020-06-19 18:06:09 +02:00
|
|
|
endif()
|
|
|
|
|
2020-05-16 13:40:38 +02:00
|
|
|
add_executable(${PROJECT_NAME} ${src} ${headers} ${resources})
|
2020-04-30 20:03:14 +02:00
|
|
|
|
2021-01-16 17:31:07 +01:00
|
|
|
if(WIN32)
|
2021-01-16 17:57:36 +01:00
|
|
|
# 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)
|
2021-01-16 17:31:07 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(APPLE)
|
2021-07-11 08:27:13 +02:00
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE TRUE MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
|
2021-01-16 17:31:07 +01:00
|
|
|
endif()
|
|
|
|
|
2021-07-11 08:27:13 +02:00
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE ScreenPlaySDK ScreenPlayUtil)
|
|
|
|
|
|
|
|
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
|
|
|
find_package(
|
|
|
|
Qt${QT_VERSION_MAJOR}
|
|
|
|
COMPONENTS Core
|
|
|
|
Quick
|
|
|
|
Gui
|
|
|
|
Widgets
|
|
|
|
WebSockets
|
|
|
|
Svg
|
|
|
|
WebEngineCore
|
|
|
|
WebEngineQuick
|
|
|
|
WebChannel
|
|
|
|
Positioning)
|
|
|
|
target_link_libraries(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
PRIVATE Qt${QT_VERSION_MAJOR}::Quick
|
|
|
|
Qt${QT_VERSION_MAJOR}::Gui
|
|
|
|
Qt${QT_VERSION_MAJOR}::Widgets
|
|
|
|
Qt${QT_VERSION_MAJOR}::Core
|
|
|
|
Qt${QT_VERSION_MAJOR}::WebSockets
|
|
|
|
Qt${QT_VERSION_MAJOR}::Svg
|
|
|
|
Qt6::WebEngineCore
|
|
|
|
Qt6::WebEngineQuick)
|
|
|
|
else()
|
|
|
|
find_package(
|
|
|
|
Qt${QT_VERSION_MAJOR}
|
|
|
|
COMPONENTS Core
|
|
|
|
Quick
|
|
|
|
Gui
|
|
|
|
Widgets
|
|
|
|
WebSockets
|
|
|
|
Svg
|
|
|
|
WebEngine)
|
|
|
|
target_link_libraries(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
PRIVATE Qt${QT_VERSION_MAJOR}::Quick
|
|
|
|
Qt${QT_VERSION_MAJOR}::Gui
|
|
|
|
Qt${QT_VERSION_MAJOR}::Widgets
|
|
|
|
Qt${QT_VERSION_MAJOR}::Core
|
|
|
|
Qt${QT_VERSION_MAJOR}::WebSockets
|
|
|
|
Qt${QT_VERSION_MAJOR}::Svg
|
|
|
|
Qt5::WebEngine)
|
|
|
|
endif()
|