Skip to content

Commit

Permalink
Group source and header files for QtCreator IDE
Browse files Browse the repository at this point in the history
  • Loading branch information
redtide committed Oct 22, 2023
1 parent 2cfa7bb commit bfad651
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 32 deletions.
36 changes: 20 additions & 16 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
40 changes: 24 additions & 16 deletions plugins/editor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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})
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit bfad651

Please sign in to comment.