Browse Source

Add MODGUI_CLASS_NAME option to cmake

Signed-off-by: falkTX <falktx@falktx.com>
undefined
falkTX 2 years ago
parent
commit
3f02c782aa
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 27 additions and 6 deletions
  1. +15
    -5
      cmake/DPF-plugin.cmake
  2. +11
    -1
      distrho/src/DistrhoPluginLV2export.cpp
  3. +1
    -0
      examples/Info/CMakeLists.txt

+ 15
- 5
cmake/DPF-plugin.cmake View File

@@ -77,9 +77,6 @@ include(CMakeParseArguments)
# `UI_TYPE` <type>
# the user interface type: `opengl` (default), `cairo`, `external`
#
# `MONOLITHIC`
# build LV2 as a single binary for UI and DSP
#
# `FILES_DSP` <file1>...<fileN>
# list of sources which are part of the DSP
#
@@ -90,10 +87,19 @@ include(CMakeParseArguments)
# `FILES_COMMON` <file1>...<fileN>
# list of sources which are part of both DSP and UI
#
# `MODGUI_CLASS_NAME`
# class name to use for modgui builds
#
# `MONOLITHIC`
# build LV2 as a single binary for UI and DSP
#
# `NO_SHARED_RESOURCES`
# do not build DPF shared resources (fonts, etc)
#
function(dpf_add_plugin NAME)
set(options MONOLITHIC NO_SHARED_RESOURCES)
set(oneValueArgs UI_TYPE)
set(multiValueArgs TARGETS FILES_DSP FILES_UI FILES_COMMON)
set(oneValueArgs MODGUI_CLASS_NAME UI_TYPE)
set(multiValueArgs FILES_COMMON FILES_DSP FILES_UI TARGETS)
cmake_parse_arguments(_dpf_plugin "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

if("${_dpf_plugin_UI_TYPE}" STREQUAL "")
@@ -131,6 +137,10 @@ function(dpf_add_plugin NAME)
target_include_directories("${NAME}" PUBLIC
"${DPF_ROOT_DIR}/distrho")

if(_dpf_plugin_MODGUI_CLASS_NAME)
target_compile_definitions("${NAME}" PUBLIC "DISTRHO_PLUGIN_MODGUI_CLASS_NAME=\"${_dpf_plugin_MODGUI_CLASS_NAME}\"")
endif()

if((NOT WIN32) AND (NOT APPLE) AND (NOT HAIKU))
target_link_libraries("${NAME}" PRIVATE "dl")
endif()


+ 11
- 1
distrho/src/DistrhoPluginLV2export.cpp View File

@@ -42,7 +42,11 @@
# include "mod-license.h"
#endif

#ifndef DISTRHO_OS_WINDOWS
#ifdef DISTRHO_OS_WINDOWS
# include <direct.h>
#else
# include <sys/stat.h>
# include <sys/types.h>
# include <unistd.h>
#endif

@@ -1264,6 +1268,12 @@ void lv2_generate_ttl(const char* const basename)
std::cout << " done!" << std::endl;
}

#ifdef DISTRHO_OS_WINDOWS
::_mkdir("modgui");
#else
::mkdir("modgui", 0755);
#endif

{
std::cout << "Writing modgui/javascript.js..."; std::cout.flush();
std::fstream jsFile("modgui/javascript.js", std::ios::out);


+ 1
- 0
examples/Info/CMakeLists.txt View File

@@ -3,6 +3,7 @@

dpf_add_plugin(d_info
TARGETS jack lv2 vst2 vst3 clap
MODGUI_CLASS_NAME distrho_examples_info
FILES_DSP
InfoExamplePlugin.cpp
FILES_UI


Loading…
Cancel
Save