From bfad6519a1b6b1b4364be53d0d2d0852b1bf879e Mon Sep 17 00:00:00 2001 From: redtide Date: Sun, 22 Oct 2023 13:24:32 +0200 Subject: [PATCH] Group source and header files for QtCreator IDE --- plugins/CMakeLists.txt | 36 +++++++++++++++++-------------- plugins/editor/CMakeLists.txt | 40 +++++++++++++++++++++-------------- 2 files changed, 44 insertions(+), 32 deletions(-) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index fbfa6cc..eaf41fb 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -1,19 +1,23 @@ -add_library(plugins-common STATIC EXCLUDE_FROM_ALL - "common/plugin/RMSFollower.h" - "common/plugin/MessageUtils.h" - "common/plugin/MessageUtils.cpp" - "common/plugin/InstrumentDescription.h" - "common/plugin/InstrumentDescription.cpp" - "common/plugin/NativeHelpers.h" - "common/plugin/NativeHelpers.cpp" - "common/plugin/SfizzFileScan.h" - "common/plugin/SfizzFileScan.cpp" - "common/plugin/FileTrie.h" - "common/plugin/FileTrie.cpp" - "common/plugin/SfizzForeignPaths.h" - "common/plugin/SfizzForeignPaths.cpp" - "common/plugin/SfizzSettings.h" - "common/plugin/SfizzSettings.cpp") +set(PLUGINSCOMMON_SOURCES + common/plugin/RMSFollower.h + common/plugin/MessageUtils.h + common/plugin/MessageUtils.cpp + common/plugin/InstrumentDescription.h + common/plugin/InstrumentDescription.cpp + common/plugin/NativeHelpers.h + common/plugin/NativeHelpers.cpp + common/plugin/SfizzFileScan.h + common/plugin/SfizzFileScan.cpp + common/plugin/FileTrie.h + common/plugin/FileTrie.cpp + common/plugin/SfizzForeignPaths.h + common/plugin/SfizzForeignPaths.cpp + common/plugin/SfizzSettings.h + common/plugin/SfizzSettings.cpp +) +source_group("Sources" FILES ${PLUGINSCOMMON_SOURCES}) +add_library(plugins-common STATIC EXCLUDE_FROM_ALL ${PLUGINSCOMMON_SOURCES}) + if(APPLE) target_sources(plugins-common PRIVATE "common/plugin/SfizzForeignPaths.mm" diff --git a/plugins/editor/CMakeLists.txt b/plugins/editor/CMakeLists.txt index 1c63a6d..555658d 100644 --- a/plugins/editor/CMakeLists.txt +++ b/plugins/editor/CMakeLists.txt @@ -8,6 +8,10 @@ endif() include("cmake/Vstgui.cmake") +set(EDITOR_THEMES + resources/Themes/Default/theme.xml + resources/Themes/Dark/theme.xml +) set(EDITOR_RESOURCES logo.png logo_orange.png @@ -33,10 +37,6 @@ set(EDITOR_RESOURCES Themes/Dark/theme.xml PARENT_SCOPE ) -set(UI_RESOURCES - resources/Themes/Default/theme.xml - resources/Themes/Dark/theme.xml -) function(copy_editor_resources TARGET SOURCE_DIR DESTINATION_DIR) set(_deps) foreach(res ${EDITOR_RESOURCES}) @@ -53,12 +53,9 @@ function(copy_editor_resources TARGET SOURCE_DIR DESTINATION_DIR) add_dependencies("${TARGET}" "${TARGET}_editor_resources") endfunction() -set(UI_FILES layout/main.fl layout/about.fl) -source_group("Editor UI" FILES ${UI_FILES}) -source_group("Editor Resources" FILES ${UI_RESOURCES}) - # editor -add_library(sfizz_editor STATIC EXCLUDE_FROM_ALL +set(EDITOR_UI_FILES layout/main.fl layout/about.fl) +set(EDITOR_SOURCES src/editor/EditIds.h src/editor/EditIds.cpp src/editor/Editor.h @@ -90,10 +87,18 @@ add_library(sfizz_editor STATIC EXCLUDE_FROM_ALL src/editor/layout/about.hpp src/editor/utility/vstgui_after.h src/editor/utility/vstgui_before.h - ${UI_FILES} - ${UI_RESOURCES} +) +source_group("Sources" FILES ${EDITOR_SOURCES}) +source_group("Editor UI" FILES ${EDITOR_UI_FILES}) +source_group("Editor Themes" FILES ${EDITOR_THEMES}) + +add_library(sfizz_editor STATIC EXCLUDE_FROM_ALL + ${EDITOR_SOURCES} + ${EDITOR_THEMES} + ${EDITOR_UI_FILES} ) add_library(sfizz::editor ALIAS sfizz_editor) + target_include_directories(sfizz_editor PUBLIC "src") target_link_libraries(sfizz_editor PUBLIC sfizz::messaging sfizz::plugins-common) target_link_libraries(sfizz_editor PRIVATE sfizz::vstgui) @@ -137,11 +142,14 @@ target_link_libraries(sfizz_editor PRIVATE sfizz::colorspaces sfizz::stb_image # layout tool if(NOT CMAKE_CROSSCOMPILING) - add_executable(layout-maker - "tools/layout-maker/sources/layout.h" - "tools/layout-maker/sources/reader.cpp" - "tools/layout-maker/sources/reader.h" - "tools/layout-maker/sources/main.cpp") + set(LAYOUTMAKER_SOURCES + tools/layout-maker/sources/layout.h + tools/layout-maker/sources/reader.cpp + tools/layout-maker/sources/reader.h + tools/layout-maker/sources/main.cpp + ) + source_group("Sources" FILES ${LAYOUTMAKER_SOURCES}) + add_executable(layout-maker ${LAYOUTMAKER_SOURCES}) target_link_libraries(layout-maker PRIVATE absl::strings) foreach(_layout main about)