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

Call format-cmake.py

This commit is contained in:
Elias Steurer 2020-10-29 18:53:52 +01:00
parent 72a5485e7f
commit 8e117cebfd
7 changed files with 128 additions and 249 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16.0 ) cmake_minimum_required(VERSION 3.16.0)
project(ScreenPlay) project(ScreenPlay)
@ -17,14 +17,13 @@ elseif(APPLE)
set(VCPKG_ARCH "x64-osx") set(VCPKG_ARCH "x64-osx")
endif() endif()
set(VCPKG_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Common/vcpkg/installed/${VCPKG_ARCH}/include/) set(VCPKG_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Common/vcpkg/installed/${VCPKG_ARCH}/include/)
set(VCPKG_TOOLS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Common/vcpkg/installed/${VCPKG_ARCH}/tools/) set(VCPKG_TOOLS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Common/vcpkg/installed/${VCPKG_ARCH}/tools/)
set(QT_TELEMTRY_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/Common/qt-google-analytics/) set(QT_TELEMTRY_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/Common/qt-google-analytics/)
find_package(Git REQUIRED) find_package(Git REQUIRED)
if(WIN32) if(WIN32)
set(date_command "CMD" ) set(date_command "CMD")
set(date_arg "/c date /t") set(date_arg "/c date /t")
elseif(APPLE) elseif(APPLE)
@ -35,27 +34,25 @@ elseif(UNIX)
set(date_arg "") set(date_arg "")
endif() endif()
execute_process(COMMAND execute_process(
${date_command} ${date_arg} COMMAND ${date_command} ${date_arg}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE BUILD_DATE OUTPUT_VARIABLE BUILD_DATE
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND execute_process(
"${GIT_EXECUTABLE}" describe --always COMMAND "${GIT_EXECUTABLE}" describe --always
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_COMMIT_HASH OUTPUT_VARIABLE GIT_COMMIT_HASH ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
add_compile_definitions(COMPILE_INFO="${BUILD_DATE} + ${GIT_COMMIT_HASH}") add_compile_definitions(COMPILE_INFO="${BUILD_DATE} + ${GIT_COMMIT_HASH}")
if(UNIX) if(UNIX)
# Fixes QWebEngine linker errors # Fixes QWebEngine linker errors
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
endif() endif()
add_subdirectory(ScreenPlay) add_subdirectory(ScreenPlay)
add_subdirectory(ScreenPlaySDK) add_subdirectory(ScreenPlaySDK)
add_subdirectory(ScreenPlayShader) add_subdirectory(ScreenPlayShader)
@ -63,5 +60,5 @@ add_subdirectory(ScreenPlayWallpaper)
add_subdirectory(ScreenPlayWidget) add_subdirectory(ScreenPlayWidget)
if(WIN32) if(WIN32)
add_subdirectory(ScreenPlaySysInfo) add_subdirectory(ScreenPlaySysInfo)
endif() endif()

View File

@ -1,62 +1,58 @@
project(ScreenPlay LANGUAGES CXX) project(ScreenPlay LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_AUTORCC ON) set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
find_package( find_package(
Qt5 Qt5
COMPONENTS Quick COMPONENTS Quick QuickCompiler Widgets Gui WebEngine LinguistTools
QuickCompiler REQUIRED)
Widgets
Gui
WebEngine
LinguistTools
REQUIRED)
find_package(OpenSSL REQUIRED) find_package(OpenSSL REQUIRED)
if(WIN32) if(WIN32)
find_package(sentry CONFIG REQUIRED) find_package(sentry CONFIG REQUIRED)
endif() endif()
set(src main.cpp set(src
app.cpp main.cpp
../Common/qt-google-analytics/ganalytics.cpp app.cpp
src/globalvariables.cpp ../Common/qt-google-analytics/ganalytics.cpp
src/createimportvideo.cpp src/globalvariables.cpp
src/installedlistmodel.cpp src/createimportvideo.cpp
src/monitorlistmodel.cpp src/installedlistmodel.cpp
src/screenplaywallpaper.cpp src/monitorlistmodel.cpp
src/screenplaywidget.cpp src/screenplaywallpaper.cpp
src/settings.cpp src/screenplaywidget.cpp
src/profilelistmodel.cpp src/settings.cpp
src/installedlistfilter.cpp src/profilelistmodel.cpp
src/projectsettingslistmodel.cpp src/installedlistfilter.cpp
src/screenplaymanager.cpp src/projectsettingslistmodel.cpp
src/sdkconnection.cpp src/screenplaymanager.cpp
src/util.cpp src/sdkconnection.cpp
src/create.cpp) src/util.cpp
src/create.cpp)
set(headers app.h set(headers
../Common/qt-google-analytics/ganalytics.h app.h
src/globalvariables.h ../Common/qt-google-analytics/ganalytics.h
src/createimportvideo.h src/globalvariables.h
src/installedlistmodel.h src/createimportvideo.h
src/monitorlistmodel.h src/installedlistmodel.h
src/screenplaywallpaper.h src/monitorlistmodel.h
src/screenplaywidget.h src/screenplaywallpaper.h
src/settings.h src/screenplaywidget.h
src/profilelistmodel.h src/settings.h
src/profile.h src/profilelistmodel.h
src/projectfile.h src/profile.h
src/installedlistfilter.h src/projectfile.h
src/projectsettingslistmodel.h src/installedlistfilter.h
src/screenplaymanager.h src/projectsettingslistmodel.h
src/sdkconnection.h src/screenplaymanager.h
src/util.h src/sdkconnection.h
src/create.h) src/util.h
src/create.h)
set(l10n set(l10n
translations/ScreenPlay_de.ts translations/ScreenPlay_de.ts
@ -66,13 +62,11 @@ set(l10n
translations/ScreenPlay_fr.ts translations/ScreenPlay_fr.ts
translations/ScreenPlay_ko.ts translations/ScreenPlay_ko.ts
translations/ScreenPlay_ru.ts translations/ScreenPlay_ru.ts
translations/ScreenPlay_vi.ts translations/ScreenPlay_vi.ts)
)
set_source_files_properties(${l10n} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/translations") set_source_files_properties(${l10n} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/translations")
qt5_add_translation(qmFiles ${l10n}) qt5_add_translation(qmFiles ${l10n})
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
qt5_add_resources(qml qml.qrc resources.qrc) qt5_add_resources(qml qml.qrc resources.qrc)
else() else()
@ -83,40 +77,27 @@ add_executable(${PROJECT_NAME} ${src} ${headers} ${resources} ${qml})
if(WIN32) if(WIN32)
# Icon # Icon
target_sources(${PROJECT_NAME} PRIVATE ScreenPlay.rc) target_sources(${PROJECT_NAME} PRIVATE ScreenPlay.rc)
# Disable console window on Windows # Disable console window on Windows
# https://stackoverflow.com/questions/8249028/how-do-i-keep-my-qt-c-program-from-opening-a-console-in-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) set_property(TARGET ${PROJECT_NAME} PROPERTY WIN32_EXECUTABLE true)
endif() endif()
target_compile_definitions(${PROJECT_NAME} PRIVATE "GIT_VERSION=${GIT_VERSION}")
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Quick Qt5::Gui Qt5::Widgets Qt5::Core Qt5::WebEngine ScreenPlaySDK)
target_compile_definitions(${PROJECT_NAME} PRIVATE "GIT_VERSION=${GIT_VERSION}")
target_link_libraries(${PROJECT_NAME}
PRIVATE
Qt5::Quick
Qt5::Gui
Qt5::Widgets
Qt5::Core
Qt5::WebEngine
ScreenPlaySDK
)
if(WIN32) if(WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE sentry::sentry) target_link_libraries(${PROJECT_NAME} PRIVATE sentry::sentry)
endif() endif()
target_include_directories(${PROJECT_NAME} target_include_directories(${PROJECT_NAME} PRIVATE ${QT_TELEMTRY_INCLUDE})
PRIVATE
${QT_TELEMTRY_INCLUDE})
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/assets/fonts) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/assets/fonts)
configure_file(assets/fonts/NotoSansCJKkr-Regular.otf ${CMAKE_BINARY_DIR}/bin/assets/fonts COPYONLY) configure_file(assets/fonts/NotoSansCJKkr-Regular.otf ${CMAKE_BINARY_DIR}/bin/assets/fonts COPYONLY)
# Copy ffmpeg. If the ffmpeg files are missing, start the # Copy ffmpeg. If the ffmpeg files are missing, start the install_dependencies_XXX for your system!
# install_dependencies_XXX for your system!
if(WIN32) if(WIN32)
file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/*") file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/*")
@ -124,8 +105,8 @@ if(WIN32)
configure_file(${filename} ${CMAKE_BINARY_DIR}/bin/ COPYONLY) configure_file(${filename} ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
endforeach() endforeach()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Common/vcpkg/installed/x64-windows/tools/sentry-native/crashpad_handler.exe
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Common/vcpkg/installed/x64-windows/tools/sentry-native/crashpad_handler.exe ${CMAKE_BINARY_DIR}/bin/ COPYONLY) ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
elseif(APPLE) elseif(APPLE)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/ffmpeg ${CMAKE_BINARY_DIR}/bin/ COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/ffmpeg ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/ffprobe ${CMAKE_BINARY_DIR}/bin/ COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/ffprobe ${CMAKE_BINARY_DIR}/bin/ COPYONLY)

View File

@ -1,32 +1,19 @@
project(ScreenPlaySDK LANGUAGES CXX) project(ScreenPlaySDK LANGUAGES CXX)
set(CMAKE_AUTORCC ON) set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
find_package( find_package(
Qt5 Qt5
COMPONENTS Quick COMPONENTS Quick Network Core
Network REQUIRED)
Core
REQUIRED)
set(src src/screenplay-sdk_plugin.cpp set(src src/screenplay-sdk_plugin.cpp src/screenplaysdk.cpp)
src/screenplaysdk.cpp)
set(headers set(headers inc/screenplay-sdk_plugin.h inc/screenplaysdk.h)
inc/screenplay-sdk_plugin.h
inc/screenplaysdk.h)
add_library(${PROJECT_NAME} ${src} ${headers}) add_library(${PROJECT_NAME} ${src} ${headers})
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Quick Qt5::Gui Qt5::Network)
PRIVATE
Qt5::Core
Qt5::Quick
Qt5::Gui
Qt5::Network)
target_include_directories( target_include_directories(${PROJECT_NAME} PUBLIC inc)
${PROJECT_NAME}
PUBLIC inc
)

View File

@ -1,49 +1,32 @@
project(ScreenPlayShader LANGUAGES CXX)
project(ScreenPlayShader LANGUAGES CXX)
set(CMAKE_AUTORCC ON) set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
find_package( find_package(
Qt5 Qt5
COMPONENTS Quick COMPONENTS Quick Core
Core REQUIRED)
REQUIRED)
set(src set(src screenplayshader_plugin.cpp shaderlibrary.cpp)
screenplayshader_plugin.cpp
shaderlibrary.cpp
)
set(headers set(headers screenplayshader_plugin.h shaderlibrary.h)
screenplayshader_plugin.h
shaderlibrary.h
)
set(shader shader.qrc) set(shader shader.qrc)
add_library(${PROJECT_NAME} SHARED ${src} ${headers} ${shader}) add_library(${PROJECT_NAME} SHARED ${src} ${headers} ${shader})
target_link_libraries(${PROJECT_NAME}
PRIVATE
Qt5::Core
Qt5::Quick
Qt5::Gui)
target_include_directories(
${PROJECT_NAME}
PUBLIC inc
)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Quick Qt5::Gui)
target_include_directories(${PROJECT_NAME} PUBLIC inc)
# QML module deployment # QML module deployment
set(URI "ScreenPlay/Shader") set(URI "ScreenPlay/Shader")
string(REPLACE "." "/" TARGETPATH ${URI}) string(REPLACE "." "/" TARGETPATH ${URI})
if (NOT DEFINED QT_QMAKE_EXECUTABLE) if(NOT DEFINED QT_QMAKE_EXECUTABLE)
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) get_target_property(QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
if (NOT QT_QMAKE_EXECUTABLE) if(NOT QT_QMAKE_EXECUTABLE)
message(FATAL_ERROR "Cannot find qmake") message(FATAL_ERROR "Cannot find qmake")
endif() endif()
endif() endif()
@ -57,10 +40,8 @@ file(MAKE_DIRECTORY ${DESTDIR})
configure_file(qmldir ${DESTDIR} COPYONLY) configure_file(qmldir ${DESTDIR} COPYONLY)
# Copies ScreenPlayShader.* into qt qml plugins folder # Copies ScreenPlayShader.* into qt qml plugins folder
add_custom_command( add_custom_command(
TARGET ${PROJECT_NAME} TARGET ${PROJECT_NAME}
POST_BUILD POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:ScreenPlayShader> COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:ScreenPlayShader> ${DESTDIR}/$<TARGET_FILE_NAME:ScreenPlayShader>)
${DESTDIR}/$<TARGET_FILE_NAME:ScreenPlayShader>)

View File

@ -1,42 +1,26 @@
project(ScreenPlaySysInfo LANGUAGES CXX)
project(ScreenPlaySysInfo LANGUAGES CXX)
set(CMAKE_AUTORCC ON) set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
find_package( find_package(
Qt5 Qt5
COMPONENTS Quick COMPONENTS Quick Core
Core REQUIRED)
REQUIRED)
set(src screenplaysysinfo_plugin.cpp sysinfo.cpp cpu.cpp ram.cpp storage.cpp)
set(headers screenplaysysinfo_plugin.h sysinfo.h cpu.h ram.h mathhelper.h storage.h)
set(src screenplaysysinfo_plugin.cpp add_library(${PROJECT_NAME} SHARED ${src} ${headers})
sysinfo.cpp
cpu.cpp
ram.cpp
storage.cpp)
set(headers screenplaysysinfo_plugin.h
sysinfo.h
cpu.h
ram.h
mathhelper.h
storage.h)
add_library(${PROJECT_NAME} SHARED ${src} ${headers})
target_link_libraries(${PROJECT_NAME}
PRIVATE
Qt5::Core
Qt5::Quick)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Quick)
# QML module deployment # QML module deployment
set(URI "ScreenPlay/Sysinfo") set(URI "ScreenPlay/Sysinfo")
string(REPLACE "." "/" TARGETPATH ${URI}) string(REPLACE "." "/" TARGETPATH ${URI})
if (NOT DEFINED QT_QMAKE_EXECUTABLE) if(NOT DEFINED QT_QMAKE_EXECUTABLE)
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) get_target_property(QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
if (NOT QT_QMAKE_EXECUTABLE) if(NOT QT_QMAKE_EXECUTABLE)
message(FATAL_ERROR "Cannot find qmake") message(FATAL_ERROR "Cannot find qmake")
endif() endif()
endif() endif()
@ -50,10 +34,8 @@ file(MAKE_DIRECTORY ${DESTDIR})
configure_file(qmldir ${DESTDIR} COPYONLY) configure_file(qmldir ${DESTDIR} COPYONLY)
# Copies ScreenPlaySysInfo.* into qt qml plugins folder # Copies ScreenPlaySysInfo.* into qt qml plugins folder
add_custom_command( add_custom_command(
TARGET ${PROJECT_NAME} TARGET ${PROJECT_NAME}
POST_BUILD POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:ScreenPlaySysInfo> COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:ScreenPlaySysInfo> ${DESTDIR}/$<TARGET_FILE_NAME:ScreenPlaySysInfo>)
${DESTDIR}/$<TARGET_FILE_NAME:ScreenPlaySysInfo>)

View File

@ -1,70 +1,37 @@
project(ScreenPlayWallpaper LANGUAGES CXX)
project(ScreenPlayWallpaper LANGUAGES CXX)
set(CMAKE_AUTORCC ON) set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
find_package( find_package(
Qt5 Qt5
COMPONENTS Quick COMPONENTS Quick Widgets Gui WebEngine QuickCompiler
Widgets REQUIRED)
Gui
WebEngine
QuickCompiler
REQUIRED)
if(WIN32) if(WIN32)
set(src_plattform set(src_plattform src/windowsdesktopproperties.cpp src/winwindow.cpp)
src/windowsdesktopproperties.cpp set(headers_plattform src/windowsdesktopproperties.h src/winwindow.h)
src/winwindow.cpp)
set(headers_plattform
src/windowsdesktopproperties.h
src/winwindow.h)
elseif(APPLE) elseif(APPLE)
set(src_plattform set(src_plattform src/macintegration.cpp src/macwindow.cpp)
src/macintegration.cpp set(headers_plattform src/macintegration.h src/macbridge.h src/macwindow.h)
src/macwindow.cpp)
set(headers_plattform
src/macintegration.h
src/macbridge.h
src/macwindow.h)
elseif(UNIX) elseif(UNIX)
set(src_plattform set(src_plattform main.cpp src/linuxwindow.cpp)
main.cpp set(headers_plattform src/linuxwindow.h)
src/linuxwindow.cpp)
set(headers_plattform
src/linuxwindow.h)
endif() endif()
set( src set(src main.cpp src/basewindow.cpp)
main.cpp set(headers src/basewindow.h)
src/basewindow.cpp)
set( headers
src/basewindow.h)
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(resources SPWResources.qrc) set(resources SPWResources.qrc)
else() else()
qtquick_compiler_add_resources(resources SPWResources.qrc ) qtquick_compiler_add_resources(resources SPWResources.qrc)
endif() 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 # Disable console window on Windows
# https://stackoverflow.com/questions/8249028/how-do-i-keep-my-qt-c-program-from-opening-a-console-in-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) set_property(TARGET ${PROJECT_NAME} PROPERTY WIN32_EXECUTABLE true)
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Quick Qt5::Gui Qt5::Widgets Qt5::Core Qt5::WebEngine ScreenPlaySDK)
PRIVATE
Qt5::Quick
Qt5::Gui
Qt5::Widgets
Qt5::Core
Qt5::WebEngine
ScreenPlaySDK
)

View File

@ -1,29 +1,22 @@
project(ScreenPlayWidget LANGUAGES CXX)
project(ScreenPlayWidget LANGUAGES CXX)
set(CMAKE_AUTORCC ON) set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
find_package( find_package(
Qt5 Qt5
COMPONENTS Quick COMPONENTS Quick Widgets Gui QuickCompiler WebEngine
Widgets REQUIRED)
Gui
QuickCompiler
WebEngine
REQUIRED)
set(src main.cpp set(src main.cpp src/widgetwindow.cpp)
src/widgetwindow.cpp)
set(headers set(headers src/widgetwindow.h)
src/widgetwindow.h)
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(resources SPWidgetResources.qrc) set(resources SPWidgetResources.qrc)
else() else()
qtquick_compiler_add_resources(resources SPWidgetResources.qrc ) qtquick_compiler_add_resources(resources SPWidgetResources.qrc)
endif() endif()
add_executable(${PROJECT_NAME} ${src} ${headers} ${resources}) add_executable(${PROJECT_NAME} ${src} ${headers} ${resources})
@ -32,13 +25,4 @@ add_executable(${PROJECT_NAME} ${src} ${headers} ${resources})
# https://stackoverflow.com/questions/8249028/how-do-i-keep-my-qt-c-program-from-opening-a-console-in-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) set_property(TARGET ${PROJECT_NAME} PROPERTY WIN32_EXECUTABLE true)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Quick Qt5::Gui Qt5::Widgets Qt5::Core ScreenPlaySDK)
target_link_libraries(${PROJECT_NAME}
PRIVATE
Qt5::Quick
Qt5::Gui
Qt5::Widgets
Qt5::Core
ScreenPlaySDK
)