1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-05 10:32:28 +01:00

Fix cmake formatting script ignoring sort

This commit is contained in:
Elias Steurer 2022-03-12 14:36:03 +01:00
parent 2e40b3a3d8
commit 42bdd7682c
12 changed files with 204 additions and 145 deletions

View File

@ -1,4 +1,6 @@
# -----------------------------
# Options effecting formatting.
# -----------------------------
with section("format"):
# How wide to allow formatted cmake files
@ -6,3 +8,12 @@ with section("format"):
# How many spaces to tab for indent
tab_size = 4
# If true, the argument lists which are known to be sortable will be sorted
# lexicographicall
enable_sort = True
autosort = True
# If a positional argument group contains more than this many arguments, then
# force it to a vertical layout.
max_pargs_hwrap = 3

View File

@ -1,7 +1,11 @@
project(CMake)
set(FILES # cmake-format: sortable
CopyRecursive.cmake CreateIFWInstaller.cmake FetchContentThirdParty.cmake QtUpdateTranslations.cmake)
set(FILES
# cmake-format: sortable
CopyRecursive.cmake
CreateIFWInstaller.cmake
FetchContentThirdParty.cmake
QtUpdateTranslations.cmake)
add_custom_target(
${PROJECT_NAME}

View File

@ -7,56 +7,114 @@ set(CMAKE_AUTOMOC ON)
set(SOURCES
# cmake-format: sortable
app.cpp
src/globalvariables.cpp
src/create.cpp
src/createimportvideo.cpp
src/globalvariables.cpp
src/installedlistfilter.cpp
src/installedlistmodel.cpp
src/monitorlistmodel.cpp
src/screenplaywallpaper.cpp
src/screenplaywidget.cpp
src/settings.cpp
src/profilelistmodel.cpp
src/installedlistfilter.cpp
src/projectsettingslistmodel.cpp
src/screenplaymanager.cpp
src/screenplaywallpaper.cpp
src/screenplaywidget.cpp
src/sdkconnection.cpp
src/settings.cpp
src/util.cpp
src/create.cpp
src/wizards.cpp)
set(HEADER
# cmake-format: sortable
app.h
src/globalvariables.h
src/createimportvideo.h
src/create.h
src/createimportstates.h
src/createimportvideo.h
src/globalvariables.h
src/installedlistfilter.h
src/installedlistmodel.h
src/monitorlistmodel.h
src/screenplaywallpaper.h
src/screenplaywidget.h
src/settings.h
src/profilelistmodel.h
src/profile.h
src/installedlistfilter.h
src/profilelistmodel.h
src/projectsettingslistmodel.h
src/screenplaymanager.h
src/screenplaywallpaper.h
src/screenplaywidget.h
src/sdkconnection.h
src/settings.h
src/util.h
src/create.h
src/wizards.h)
set(QML
# cmake-format: sortable
main.qml
qml/Common/CloseIcon.qml
qml/Common/ColorPicker.qml
qml/Common/Dialog.qml
qml/Common/Dialogs/CriticalError.qml
qml/Common/Dialogs/MonitorConfiguration.qml
qml/Common/Dialogs/SteamNotAvailable.qml
qml/Common/FileSelector.qml
qml/Common/Grow.qml
qml/Common/GrowIconLink.qml
qml/Common/Headline.qml
qml/Common/HeadlineSection.qml
qml/Common/ImageSelector.qml
qml/Common/LicenseSelector.qml
qml/Common/ModalBackgroundBlur.qml
qml/Common/MouseHoverBlocker.qml
qml/Common/Popup.qml
qml/Common/RippleEffect.qml
qml/Common/Search.qml
qml/Common/Shake.qml
qml/Common/Slider.qml
qml/Common/Tag.qml
qml/Common/TagSelector.qml
qml/Common/TextField.qml
qml/Common/TrayIcon.qml
qml/Common/Util.js
qml/Community/Community.qml
qml/Community/CommunityNavItem.qml
qml/Community/XMLNewsfeed.qml
qml/Create/Create.qml
qml/Create/Wizard.qml
qml/Create/Sidebar.qml
qml/Create/StartInfo.qml
qml/Create/StartInfoLinkImage.qml
qml/Create/Wizard.qml
qml/Create/Wizards/GifWallpaper.qml
qml/Create/Wizards/HTMLWallpaper.qml
qml/Create/Wizards/HTMLWidget.qml
qml/Create/Wizards/Importh264/Importh264.qml
qml/Create/Wizards/Importh264/Importh264Convert.qml
qml/Create/Wizards/Importh264/Importh264Init.qml
qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaper.qml
qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperInit.qml
qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperResult.qml
qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperVideoImportConvert.qml
qml/Create/Wizards/ImportWebm/ImportWebm.qml
qml/Create/Wizards/ImportWebm/ImportWebmConvert.qml
qml/Create/Wizards/ImportWebm/ImportWebmInit.qml
qml/Create/Wizards/QMLWallpaper.qml
qml/Create/Wizards/QMLWidget.qml
qml/Create/Wizards/WebsiteWallpaper.qml
qml/Create/Wizards/WizardPage.qml
qml/Create/WizardsFiles/QMLWallpaperMain.qml
qml/Create/WizardsFiles/QMLWidgetMain.qml
qml/Installed/Installed.qml
qml/Installed/InstalledWelcomeScreen.qml
qml/Installed/Navigation.qml
qml/Installed/ScreenPlayItem.qml
qml/Installed/ScreenPlayItemImage.qml
qml/Installed/Sidebar.qml
qml/Installed/InstalledWelcomeScreen.qml
qml/Community/Community.qml
qml/Community/XMLNewsfeed.qml
qml/Monitors/DefaultVideoControls.qml
qml/Monitors/Monitors.qml
qml/Monitors/MonitorSelection.qml
qml/Monitors/MonitorSelectionItem.qml
qml/Monitors/MonitorsProjectSettingItem.qml
qml/Monitors/SaveNotification.qml
qml/Navigation/Navigation.qml
qml/Navigation/NavigationItem.qml
qml/Navigation/WindowNavButton.qml
qml/Navigation/WindowNavigation.qml
qml/Settings/SettingBool.qml
qml/Settings/Settings.qml
qml/Settings/SettingsButton.qml
@ -64,98 +122,40 @@ set(QML
qml/Settings/SettingsExpander.qml
qml/Settings/SettingsHeader.qml
qml/Settings/SettingsHorizontalSeperator.qml
qml/Workshop/Workshop.qml
qml/Monitors/Monitors.qml
qml/Monitors/MonitorSelection.qml
qml/Monitors/MonitorSelectionItem.qml
qml/Monitors/MonitorsProjectSettingItem.qml
qml/Navigation/Navigation.qml
qml/Navigation/NavigationItem.qml
qml/Navigation/WindowNavButton.qml
qml/Navigation/WindowNavigation.qml
qml/Monitors/DefaultVideoControls.qml
qml/Common/TagSelector.qml
qml/Common/Tag.qml
qml/Common/Popup.qml
qml/Common/Dialog.qml
qml/Common/ImageSelector.qml
qml/Common/Slider.qml
qml/Common/RippleEffect.qml
qml/Common/Shake.qml
qml/Common/Grow.qml
qml/Common/GrowIconLink.qml
qml/Common/CloseIcon.qml
qml/Common/Headline.qml
qml/Settings/SettingsPage.qml
qml/Community/CommunityNavItem.qml
qml/Workshop/ScreenPlayItem.qml
qml/Workshop/ScreenPlayItemImage.qml
qml/Workshop/Background.qml
qml/Workshop/WorkshopInstalled.qml
qml/Workshop/WorkshopItem.qml
qml/Workshop/Sidebar.qml
qml/Workshop/Forum.qml
qml/Workshop/Navigation.qml
qml/Workshop/PopupOffline.qml
qml/Workshop/ScreenPlayItem.qml
qml/Workshop/ScreenPlayItemImage.qml
qml/Workshop/Sidebar.qml
qml/Workshop/SteamProfile.qml
qml/Workshop/SteamWorkshop.qml
qml/Workshop/SteamWorkshopStartPage.qml
qml/Workshop/upload/PopupSteamWorkshopAgreement.qml
qml/Workshop/upload/UploadProject.qml
qml/Workshop/upload/UploadProjectBigItem.qml
qml/Workshop/upload/UploadProjectItem.qml
qml/Monitors/SaveNotification.qml
qml/Common/TrayIcon.qml
qml/Installed/Navigation.qml
qml/Common/Search.qml
qml/Common/MouseHoverBlocker.qml
qml/Create/Wizards/HTMLWallpaper.qml
qml/Create/Wizards/HTMLWidget.qml
qml/Create/Wizards/QMLWidget.qml
qml/Create/Wizards/QMLWallpaper.qml
qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaper.qml
qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperInit.qml
qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperResult.qml
qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperVideoImportConvert.qml
qml/Create/Sidebar.qml
qml/Create/Wizards/ImportWebm/ImportWebm.qml
qml/Create/Wizards/ImportWebm/ImportWebmConvert.qml
qml/Create/Wizards/ImportWebm/ImportWebmInit.qml
qml/Common/Dialogs/MonitorConfiguration.qml
qml/Common/Dialogs/SteamNotAvailable.qml
qml/Create/Wizards/WizardPage.qml
qml/Create/Wizards/GifWallpaper.qml
qml/Common/TextField.qml
qml/Common/HeadlineSection.qml
qml/Create/Wizards/WebsiteWallpaper.qml
qml/Common/FileSelector.qml
qml/Create/WizardsFiles/QMLWidgetMain.qml
qml/Create/WizardsFiles/QMLWallpaperMain.qml
qml/Common/LicenseSelector.qml
qml/Common/ModalBackgroundBlur.qml
qml/Common/Util.js
qml/Common/Dialogs/CriticalError.qml
qml/Common/ColorPicker.qml
qml/Create/StartInfoLinkImage.qml
qml/Workshop/SteamProfile.qml
qml/Workshop/SteamWorkshop.qml
qml/Workshop/Forum.qml
qml/Workshop/SteamWorkshopStartPage.qml
qml/Create/Wizards/Importh264/Importh264.qml
qml/Create/Wizards/Importh264/Importh264Convert.qml
qml/Create/Wizards/Importh264/Importh264Init.qml)
qml/Workshop/Workshop.qml
qml/Workshop/WorkshopInstalled.qml
qml/Workshop/WorkshopItem.qml)
set(TS_FILES
# cmake-format: sortable
translations/ScreenPlay_.ts
translations/ScreenPlay_tr_TR.ts
translations/ScreenPlay_it_IT.ts
translations/ScreenPlay_nl_NL.ts
translations/ScreenPlay_de_DE.ts
translations/ScreenPlay_pl_PL.ts
translations/ScreenPlay_zh_CN.ts
translations/ScreenPlay_pt_BR.ts
translations/ScreenPlay_es_ES.ts
translations/ScreenPlay_fr_FR.ts
translations/ScreenPlay_it_IT.ts
translations/ScreenPlay_ko_KR.ts
translations/ScreenPlay_nl_NL.ts
translations/ScreenPlay_pl_PL.ts
translations/ScreenPlay_pt_BR.ts
translations/ScreenPlay_ru_RU.ts
translations/ScreenPlay_vi_VN.ts)
translations/ScreenPlay_tr_TR.ts
translations/ScreenPlay_vi_VN.ts
translations/ScreenPlay_zh_CN.ts)
# Needed on macos
find_package(Threads REQUIRED)
@ -180,7 +180,12 @@ find_package(
qt_add_resources(RESOURCES Resources.qrc)
qt_add_big_resources(FONTS fonts.qrc)
add_library(ScreenPlayLib ${SOURCES} ${HEADER} ${RESOURCES} ${FONTS})
add_library(
ScreenPlayLib
${SOURCES}
${HEADER}
${RESOURCES}
${FONTS})
target_link_libraries(
ScreenPlayLib

View File

@ -19,4 +19,9 @@ add_library(${PROJECT_NAME} ${SOURCES} ${HEADER})
target_include_directories(${PROJECT_NAME} PUBLIC inc)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick Qt6::Gui Qt6::Network)
target_link_libraries(
${PROJECT_NAME}
PRIVATE Qt6::Core
Qt6::Quick
Qt6::Gui
Qt6::Network)

View File

@ -12,27 +12,27 @@ find_package(
# Because this is a plugin, we need this for testing and development. This can be disabled when using the plugin in your project directly.
option(tst_ScreenPlayShader "Builds TextProject" ON)
set(QML_RESOURCES # cmake-format: sortable
set(QML_RESOURCES
# cmake-format: sortable
shader/lightning.frag
shader/lightning.vert
shader/water.frag
shader/water.vert
)
shader/water.vert)
# https://doc.qt.io/qt-6/qtshadertools-build.html
qt6_add_shaders(${PROJECT_NAME} "${PROJECT_NAME}Shaders"
qt6_add_shaders(
${PROJECT_NAME}
"${PROJECT_NAME}Shaders"
PREFIX
"/shaders"
"/shader"
FILES
shader/lightning.frag
shader/lightning.vert
shader/water.frag
shader/water.vert
)
lightning.frag
lightning.vert
water.frag
water.vert)
set(QML # cmake-format: sortable
src/ShadertoyShader.qml
src/TestMain.qml)
src/ShadertoyShader.qml src/TestMain.qml)
set(QML_PLUGIN_SOURCES # cmake-format: sortable
src/shaderlibrary.cpp)

View File

@ -20,19 +20,26 @@ option(tst_ScreenPlaySysInfo "Builds TextProject" ON)
set(QML # cmake-format: sortable
src/TestMain.qml)
set(QML_PLUGIN_SOURCES # cmake-format: sortable
src/sysinfo.cpp src/cpu.cpp src/ram.cpp src/storage.cpp src/uptime.cpp src/gpu.cpp src/ipaddress.cpp)
set(QML_PLUGIN_SOURCES
# cmake-format: sortable
src/cpu.cpp
src/gpu.cpp
src/ipaddress.cpp
src/ram.cpp
src/storage.cpp
src/sysinfo.cpp
src/uptime.cpp)
set(QML_PLUGIN_HEADER
# cmake-format: sortable
src/sysinfo.h
src/cpu.h
src/ram.h
src/mathhelper.h
src/storage.h
src/uptime.h
src/gpu.h
src/ipaddress.h)
src/ipaddress.h
src/mathhelper.h
src/ram.h
src/storage.h
src/sysinfo.h
src/uptime.h)
add_library(${PROJECT_NAME} STATIC)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick infoware)

View File

@ -10,22 +10,22 @@ find_package(
REQUIRED)
set(SOURCES # cmake-format: sortable
src/util.cpp src/contenttypes.cpp inc/public/ScreenPlayUtil/httpfileserver.cpp)
inc/public/ScreenPlayUtil/httpfileserver.cpp src/contenttypes.cpp src/util.cpp)
set(HEADER
# cmake-format: sortable
inc/public/ScreenPlayUtil/util.h
inc/public/ScreenPlayUtil/httpfileserver.h
inc/public/ScreenPlayUtil/contenttypes.h
inc/public/ScreenPlayUtil/projectfile.h
inc/public/ScreenPlayUtil/AutoPropertyHelpers.h
inc/public/ScreenPlayUtil/ConstRefPropertyHelpers.h
inc/public/ScreenPlayUtil/contenttypes.h
inc/public/ScreenPlayUtil/EnumClassHelper.h
inc/public/ScreenPlayUtil/HelpersCommon.h
inc/public/ScreenPlayUtil/httpfileserver.h
inc/public/ScreenPlayUtil/ListPropertyHelper.h
inc/public/ScreenPlayUtil/projectfile.h
inc/public/ScreenPlayUtil/PropertyHelpers.h
inc/public/ScreenPlayUtil/PtrPropertyHelpers.h
inc/public/ScreenPlayUtil/SingletonHelper.h)
inc/public/ScreenPlayUtil/SingletonHelper.h
inc/public/ScreenPlayUtil/util.h)
add_library(${PROJECT_NAME} STATIC ${SOURCES} ${HEADER})

View File

@ -26,8 +26,12 @@ if(WIN32)
elseif(APPLE)
set(SOURCES # cmake-format: sortable
src/macintegration.cpp src/macwindow.cpp)
set(HEADER # cmake-format: sortable
src/macintegration.h src/macbridge.h src/macwindow.h src/MacBridge.mm)
set(HEADER
# cmake-format: sortable
src/macbridge.h
src/MacBridge.mm
src/macintegration.h
src/macwindow.h)
elseif(UNIX)
set(SOURCES # cmake-format: sortable
src/linuxwindow.cpp)
@ -38,8 +42,14 @@ endif()
set(SOURCES ${SOURCES} main.cpp src/basewindow.cpp)
set(HEADER ${HEADER} src/basewindow.h)
set(QML # cmake-format: sortable
qml/GifWallpaper.qml qml/Test.qml qml/Wallpaper.qml qml/WebsiteWallpaper.qml qml/MultimediaView.qml qml/MultimediaWebView.qml)
set(QML
# cmake-format: sortable
qml/GifWallpaper.qml
qml/MultimediaView.qml
qml/MultimediaWebView.qml
qml/Test.qml
qml/Wallpaper.qml
qml/WebsiteWallpaper.qml)
qt_add_resources(RESOURCES Resources.qrc)

View File

@ -22,7 +22,7 @@ set(QML_PLUGIN_SOURCES # cmake-format: sortable
src/screenplayweather.cpp)
set(QML_PLUGIN_HEADER # cmake-format: sortable
src/screenplayweather.h src/day.h)
src/day.h src/screenplayweather.h)
qt_add_library(${PROJECT_NAME} STATIC)
target_link_libraries(${PROJECT_NAME} PUBLIC ScreenPlayUtil)

View File

@ -28,7 +28,11 @@ find_package(
qt_add_resources(RESOURCES Resources.qrc)
qt_add_executable(${PROJECT_NAME} ${SOURCES} ${HEADER} ${RESOURCES})
qt_add_executable(
${PROJECT_NAME}
${SOURCES}
${HEADER}
${RESOURCES})
target_link_libraries(
${PROJECT_NAME}

View File

@ -12,27 +12,27 @@ find_package(
set(SOURCES
# cmake-format: sortable
src/steamapiwrapper.cpp
src/steamworkshopitem.cpp
src/workshop.cpp
src/installedlistmodel.cpp
src/steamworkshop.cpp
src/steamworkshoplistmodel.cpp
src/steamaccount.cpp
src/steamqmlimageprovider.cpp)
src/steamapiwrapper.cpp
src/steamqmlimageprovider.cpp
src/steamworkshop.cpp
src/steamworkshopitem.cpp
src/steamworkshoplistmodel.cpp
src/workshop.cpp)
set(HEADER
# cmake-format: sortable
src/installedlistmodel.h
src/steamaccount.h
src/steamapiwrapper.h
src/steamqmlimageprovider.h
src/steamworkshop.h
src/steamworkshopitem.h
src/steamworkshoplistmodel.h
src/uploadlistmodel.h
src/steamworkshopitem.h
src/workshop.h
src/workshopitem.h
src/installedlistmodel.h
src/steamworkshop.h
src/steamaccount.h
src/steamqmlimageprovider.h)
src/workshopitem.h)
set(STEAM_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/SteamSDK/redistributable_bin/")
@ -52,7 +52,13 @@ elseif(UNIX)
endif()
add_library(${PROJECT_NAME} SHARED ${SOURCES} ${HEADER})
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick ${STEAM_LIB} ScreenPlayUtil SteamSDK)
target_link_libraries(
${PROJECT_NAME}
PRIVATE Qt6::Core
Qt6::Quick
${STEAM_LIB}
ScreenPlayUtil
SteamSDK)
qt_add_qml_module(
${PROJECT_NAME}
@ -86,7 +92,14 @@ endif()
# https://github.com/qt/qtdeclarative/blob/7a7064e14f094e843e1ee832cc927e86f887621a/src/qml/Qt6QmlMacros.cmake#L2042
target_include_directories(${PROJECT_NAME} PUBLIC src/)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick ${STEAM_LIB} ScreenPlayUtil SteamSDK SteamSDKQtEnums)
target_link_libraries(
${PROJECT_NAME}
PRIVATE Qt6::Core
Qt6::Quick
${STEAM_LIB}
ScreenPlayUtil
SteamSDK
SteamSDKQtEnums)
if(${tst_ScreenPlayWorkshop})
qt_add_executable(tst_ScreenPlayWorkshop src/TestMain.cpp)

View File

@ -3,7 +3,7 @@ project(Tools LANGUAGES CXX)
file(GLOB PYTHON *.py)
set(FILES # cmake-format: sortable
Installer/package.xml Installer/installscript.qs)
Installer/installscript.qs Installer/package.xml)
add_custom_target(
${PROJECT_NAME}