sfizz/plugins/editor/CMakeLists.txt

159 lines
5.2 KiB
Text
Raw Normal View History

if(SFIZZ_USE_SYSTEM_VST3SDK)
find_package(PkgConfig REQUIRED)
pkg_check_modules(VST3SDK "vst3sdk" REQUIRED)
set(VSTGUI_BASEDIR "${VST3SDK_INCLUDE_DIRS}/vstgui4")
else()
set(VSTGUI_BASEDIR "${CMAKE_CURRENT_SOURCE_DIR}/external/vstgui4")
endif()
2020-08-29 04:54:18 +02:00
include("cmake/Vstgui.cmake")
2020-08-31 05:47:37 +02:00
set(EDITOR_RESOURCES
logo.png
2021-04-04 03:38:00 +02:00
logo_orange.png
2020-09-02 12:19:26 +02:00
logo_text.png
logo_text_white.png
2021-02-27 13:37:03 +01:00
logo_text_shaded.png
2020-09-02 12:19:26 +02:00
logo_text@2x.png
logo_text_white@2x.png
2021-02-27 13:37:03 +01:00
logo_text_shaded@2x.png
background.png
background@2x.png
background_button_about.png
background_button_about@2x.png
2020-09-02 12:19:26 +02:00
icon_white.png
icon_white@2x.png
knob48.png
knob48@2x.png
Fonts/sfizz-fluentui-system-r20.ttf
2021-02-27 13:22:52 +01:00
Fonts/sfizz-fluentui-system-f20.ttf
2021-04-04 03:38:00 +02:00
Fonts/sfizz-misc-icons.ttf
Fonts/Roboto-Regular.ttf
Themes/Default/theme.xml
2021-04-27 10:15:55 +02:00
Themes/Dark/theme.xml
2023-04-11 14:23:43 +02:00
PARENT_SCOPE
)
set(UI_RESOURCES
resources/Themes/Default/theme.xml
resources/Themes/Dark/theme.xml
)
2021-04-12 06:15:17 +02:00
function(copy_editor_resources TARGET SOURCE_DIR DESTINATION_DIR)
set(_deps)
2020-09-02 12:19:26 +02:00
foreach(res ${EDITOR_RESOURCES})
get_filename_component(_dir "${res}" DIRECTORY)
file(MAKE_DIRECTORY "${DESTINATION_DIR}/${_dir}")
2021-04-12 06:15:17 +02:00
add_custom_command(
OUTPUT "${DESTINATION_DIR}/${res}"
COMMAND "${CMAKE_COMMAND}" "-E" "copy"
"${SOURCE_DIR}/${res}" "${DESTINATION_DIR}/${res}"
DEPENDS "${SOURCE_DIR}/${res}")
list(APPEND _deps "${DESTINATION_DIR}/${res}")
2020-09-02 12:19:26 +02:00
endforeach()
2021-04-12 06:15:17 +02:00
add_custom_target("${TARGET}_editor_resources" DEPENDS ${_deps})
add_dependencies("${TARGET}" "${TARGET}_editor_resources")
2020-09-02 12:19:26 +02:00
endfunction()
2021-04-04 03:38:00 +02:00
set(UI_FILES layout/main.fl layout/about.fl)
source_group("Editor UI" FILES ${UI_FILES})
2023-04-11 14:23:43 +02:00
source_group("Editor Resources" FILES ${UI_RESOURCES})
2021-04-04 03:38:00 +02:00
2020-08-29 04:54:18 +02:00
# editor
add_library(sfizz_editor STATIC EXCLUDE_FROM_ALL
src/editor/EditIds.h
src/editor/EditIds.cpp
src/editor/Editor.h
src/editor/Editor.cpp
2021-04-03 20:13:33 +02:00
src/editor/EditorLibs.h
2021-04-03 13:40:50 +02:00
src/editor/EditorLibs.cpp
2020-08-29 04:54:18 +02:00
src/editor/EditorController.h
src/editor/GUIComponents.h
src/editor/GUIComponents.cpp
2023-04-11 14:23:43 +02:00
src/editor/GUIDefs.h
src/editor/GUIDefs.cpp
src/editor/GUIHelpers.h
src/editor/GUIHelpers.cpp
2020-10-14 15:29:19 +02:00
src/editor/GUIPiano.h
src/editor/GUIPiano.cpp
2021-04-04 03:38:00 +02:00
src/editor/DlgAbout.h
src/editor/DlgAbout.cpp
src/editor/Theme.h
src/editor/Theme.cpp
2021-02-23 06:03:58 +01:00
src/editor/ColorHelpers.h
src/editor/ColorHelpers.cpp
src/editor/ImageHelpers.h
src/editor/ImageHelpers.cpp
2020-09-02 12:19:26 +02:00
src/editor/NativeHelpers.h
src/editor/NativeHelpers.cpp
src/editor/VSTGUIHelpers.h
src/editor/VSTGUIHelpers.cpp
2020-09-02 12:19:26 +02:00
src/editor/layout/main.hpp
2021-04-04 03:38:00 +02:00
src/editor/layout/about.hpp
2020-08-29 04:54:18 +02:00
src/editor/utility/vstgui_after.h
src/editor/utility/vstgui_before.h
2023-04-11 14:23:43 +02:00
${UI_FILES}
${UI_RESOURCES}
)
2020-12-14 11:48:30 +01:00
add_library(sfizz::editor ALIAS sfizz_editor)
2021-04-03 20:13:33 +02:00
target_include_directories(sfizz_editor PUBLIC "src")
target_link_libraries(sfizz_editor PUBLIC sfizz::messaging sfizz::plugins-common)
2020-12-14 08:20:01 +01:00
target_link_libraries(sfizz_editor PRIVATE sfizz::vstgui)
2021-04-04 03:38:00 +02:00
target_compile_definitions(sfizz_editor PRIVATE
"SFIZZ_VERSION=\"${CMAKE_PROJECT_VERSION}\"")
2020-09-02 12:19:26 +02:00
if(APPLE)
find_library(APPLE_APPKIT_LIBRARY "AppKit")
find_library(APPLE_CORESERVICES_LIBRARY "CoreServices")
find_library(APPLE_FOUNDATION_LIBRARY "Foundation")
target_sources(sfizz_editor PRIVATE
src/editor/NativeHelpers.mm
src/editor/VSTGUIHelpers.mm)
2020-09-02 12:19:26 +02:00
target_link_libraries(sfizz_editor PRIVATE
"${APPLE_APPKIT_LIBRARY}"
"${APPLE_CORESERVICES_LIBRARY}"
"${APPLE_FOUNDATION_LIBRARY}")
target_compile_options(sfizz_editor PRIVATE "-fobjc-arc")
endif()
# dependencies
add_library(sfizz_colorspaces INTERFACE)
add_library(sfizz::colorspaces ALIAS sfizz_colorspaces)
target_include_directories(sfizz_colorspaces INTERFACE "external/color-spaces")
2021-04-03 20:13:33 +02:00
add_library(sfizz_stb_image INTERFACE)
add_library(sfizz::stb_image ALIAS sfizz_stb_image)
target_include_directories(sfizz_stb_image INTERFACE "external/stb_image")
2020-09-02 12:19:26 +02:00
if(WIN32)
#
elseif(APPLE)
#
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(sfizz-gio "gio-2.0" REQUIRED)
target_include_directories(sfizz_editor PRIVATE ${sfizz-gio_INCLUDE_DIRS})
target_link_libraries(sfizz_editor PRIVATE ${sfizz-gio_LIBRARIES})
endif()
target_link_libraries(sfizz_editor PRIVATE sfizz::colorspaces sfizz::stb_image
sfizz::bit_array sfizz::filesystem sfizz::pugixml)
2020-09-02 12:19:26 +02:00
# 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")
target_link_libraries(layout-maker PRIVATE absl::strings)
2021-04-04 03:38:00 +02:00
foreach(_layout main about)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/editor/layout/${_layout}.hpp"
COMMAND "$<TARGET_FILE:layout-maker>"
"${CMAKE_CURRENT_SOURCE_DIR}/layout/${_layout}.fl"
> "${CMAKE_CURRENT_SOURCE_DIR}/src/editor/layout/${_layout}.hpp"
DEPENDS layout-maker "${CMAKE_CURRENT_SOURCE_DIR}/layout/${_layout}.fl")
endforeach()
2020-09-02 12:19:26 +02:00
endif()
# Git build identifier
target_link_libraries(sfizz_editor PRIVATE sfizz-git-build-id)