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

@ -21,7 +21,6 @@ set(VCPKG_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Common/vcpkg/installed/${VCP
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/)
find_package(Git REQUIRED)
if(WIN32)
set(date_command "CMD")
@ -35,17 +34,16 @@ elseif(UNIX)
set(date_arg "")
endif()
execute_process(COMMAND
${date_command} ${date_arg}
execute_process(
COMMAND ${date_command} ${date_arg}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE BUILD_DATE
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND
"${GIT_EXECUTABLE}" describe --always
execute_process(
COMMAND "${GIT_EXECUTABLE}" describe --always
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_COMMIT_HASH
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_VARIABLE GIT_COMMIT_HASH ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
add_compile_definitions(COMPILE_INFO="${BUILD_DATE} + ${GIT_COMMIT_HASH}")
@ -55,7 +53,6 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
endif()
add_subdirectory(ScreenPlay)
add_subdirectory(ScreenPlaySDK)
add_subdirectory(ScreenPlayShader)

View File

@ -2,18 +2,12 @@ project(ScreenPlay LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON)
find_package(
Qt5
COMPONENTS Quick
QuickCompiler
Widgets
Gui
WebEngine
LinguistTools
COMPONENTS Quick QuickCompiler Widgets Gui WebEngine LinguistTools
REQUIRED)
find_package(OpenSSL REQUIRED)
@ -21,7 +15,8 @@ if(WIN32)
find_package(sentry CONFIG REQUIRED)
endif()
set(src main.cpp
set(src
main.cpp
app.cpp
../Common/qt-google-analytics/ganalytics.cpp
src/globalvariables.cpp
@ -39,7 +34,8 @@ set(src main.cpp
src/util.cpp
src/create.cpp)
set(headers app.h
set(headers
app.h
../Common/qt-google-analytics/ganalytics.h
src/globalvariables.h
src/createimportvideo.h
@ -66,13 +62,11 @@ set(l10n
translations/ScreenPlay_fr.ts
translations/ScreenPlay_ko.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")
qt5_add_translation(qmFiles ${l10n})
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
qt5_add_resources(qml qml.qrc resources.qrc)
else()
@ -90,33 +84,20 @@ if(WIN32)
set_property(TARGET ${PROJECT_NAME} PROPERTY WIN32_EXECUTABLE true)
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_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Quick Qt5::Gui Qt5::Widgets Qt5::Core Qt5::WebEngine ScreenPlaySDK)
if(WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE sentry::sentry)
endif()
target_include_directories(${PROJECT_NAME}
PRIVATE
${QT_TELEMTRY_INCLUDE})
target_include_directories(${PROJECT_NAME} PRIVATE ${QT_TELEMTRY_INCLUDE})
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/assets/fonts)
configure_file(assets/fonts/NotoSansCJKkr-Regular.otf ${CMAKE_BINARY_DIR}/bin/assets/fonts COPYONLY)
# Copy ffmpeg. If the ffmpeg files are missing, start the
# install_dependencies_XXX for your system!
# Copy ffmpeg. If the ffmpeg files are missing, start the install_dependencies_XXX for your system!
if(WIN32)
file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/*")
@ -124,8 +105,8 @@ if(WIN32)
configure_file(${filename} ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
endforeach()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Common/vcpkg/installed/x64-windows/tools/sentry-native/crashpad_handler.exe ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Common/vcpkg/installed/x64-windows/tools/sentry-native/crashpad_handler.exe
${CMAKE_BINARY_DIR}/bin/ COPYONLY)
elseif(APPLE)
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)

View File

@ -5,28 +5,15 @@ set(CMAKE_AUTOMOC ON)
find_package(
Qt5
COMPONENTS Quick
Network
Core
COMPONENTS Quick Network Core
REQUIRED)
set(src src/screenplay-sdk_plugin.cpp
src/screenplaysdk.cpp)
set(src src/screenplay-sdk_plugin.cpp src/screenplaysdk.cpp)
set(headers
inc/screenplay-sdk_plugin.h
inc/screenplaysdk.h)
set(headers inc/screenplay-sdk_plugin.h inc/screenplaysdk.h)
add_library(${PROJECT_NAME} ${src} ${headers})
target_link_libraries(${PROJECT_NAME}
PRIVATE
Qt5::Core
Qt5::Quick
Qt5::Gui
Qt5::Network)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Quick Qt5::Gui Qt5::Network)
target_include_directories(
${PROJECT_NAME}
PUBLIC inc
)
target_include_directories(${PROJECT_NAME} PUBLIC inc)

View File

@ -1,5 +1,4 @@
project(ScreenPlayShader LANGUAGES CXX)
set(CMAKE_AUTORCC ON)
@ -7,36 +6,20 @@ set(CMAKE_AUTOMOC ON)
find_package(
Qt5
COMPONENTS Quick
Core
COMPONENTS Quick Core
REQUIRED)
set(src
screenplayshader_plugin.cpp
shaderlibrary.cpp
)
set(src screenplayshader_plugin.cpp shaderlibrary.cpp)
set(headers
screenplayshader_plugin.h
shaderlibrary.h
)
set(headers screenplayshader_plugin.h shaderlibrary.h)
set(shader shader.qrc)
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
set(URI "ScreenPlay/Shader")
@ -57,10 +40,8 @@ file(MAKE_DIRECTORY ${DESTDIR})
configure_file(qmldir ${DESTDIR} COPYONLY)
# Copies ScreenPlayShader.* into qt qml plugins folder
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:ScreenPlayShader>
${DESTDIR}/$<TARGET_FILE_NAME:ScreenPlayShader>)
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:ScreenPlayShader> ${DESTDIR}/$<TARGET_FILE_NAME:ScreenPlayShader>)

View File

@ -1,4 +1,3 @@
project(ScreenPlaySysInfo LANGUAGES CXX)
set(CMAKE_AUTORCC ON)
@ -6,30 +5,15 @@ set(CMAKE_AUTOMOC ON)
find_package(
Qt5
COMPONENTS Quick
Core
COMPONENTS Quick Core
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 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
set(URI "ScreenPlay/Sysinfo")
@ -50,10 +34,8 @@ file(MAKE_DIRECTORY ${DESTDIR})
configure_file(qmldir ${DESTDIR} COPYONLY)
# Copies ScreenPlaySysInfo.* into qt qml plugins folder
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:ScreenPlaySysInfo>
${DESTDIR}/$<TARGET_FILE_NAME:ScreenPlaySysInfo>)
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:ScreenPlaySysInfo> ${DESTDIR}/$<TARGET_FILE_NAME:ScreenPlaySysInfo>)

View File

@ -1,49 +1,26 @@
project(ScreenPlayWallpaper LANGUAGES CXX)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON)
find_package(
Qt5
COMPONENTS Quick
Widgets
Gui
WebEngine
QuickCompiler
COMPONENTS Quick Widgets Gui WebEngine QuickCompiler
REQUIRED)
if(WIN32)
set(src_plattform
src/windowsdesktopproperties.cpp
src/winwindow.cpp)
set(headers_plattform
src/windowsdesktopproperties.h
src/winwindow.h)
set(src_plattform src/windowsdesktopproperties.cpp src/winwindow.cpp)
set(headers_plattform src/windowsdesktopproperties.h src/winwindow.h)
elseif(APPLE)
set(src_plattform
src/macintegration.cpp
src/macwindow.cpp)
set(headers_plattform
src/macintegration.h
src/macbridge.h
src/macwindow.h)
set(src_plattform src/macintegration.cpp src/macwindow.cpp)
set(headers_plattform src/macintegration.h src/macbridge.h src/macwindow.h)
elseif(UNIX)
set(src_plattform
main.cpp
src/linuxwindow.cpp)
set(headers_plattform
src/linuxwindow.h)
set(src_plattform main.cpp src/linuxwindow.cpp)
set(headers_plattform src/linuxwindow.h)
endif()
set( src
main.cpp
src/basewindow.cpp)
set( headers
src/basewindow.h)
set(src main.cpp src/basewindow.cpp)
set(headers src/basewindow.h)
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(resources SPWResources.qrc)
@ -51,20 +28,10 @@ else()
qtquick_compiler_add_resources(resources SPWResources.qrc)
endif()
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}
PRIVATE
Qt5::Quick
Qt5::Gui
Qt5::Widgets
Qt5::Core
Qt5::WebEngine
ScreenPlaySDK
)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Quick Qt5::Gui Qt5::Widgets Qt5::Core Qt5::WebEngine ScreenPlaySDK)

View File

@ -1,5 +1,4 @@
project(ScreenPlayWidget LANGUAGES CXX)
set(CMAKE_AUTORCC ON)
@ -7,18 +6,12 @@ set(CMAKE_AUTOMOC ON)
find_package(
Qt5
COMPONENTS Quick
Widgets
Gui
QuickCompiler
WebEngine
COMPONENTS Quick Widgets Gui QuickCompiler WebEngine
REQUIRED)
set(src main.cpp
src/widgetwindow.cpp)
set(src main.cpp src/widgetwindow.cpp)
set(headers
src/widgetwindow.h)
set(headers src/widgetwindow.h)
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(resources SPWidgetResources.qrc)
@ -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
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)