diff --git a/cmake/DPF-plugin.cmake b/cmake/DPF-plugin.cmake index 4d1cd0a8..7425f26e 100644 --- a/cmake/DPF-plugin.cmake +++ b/cmake/DPF-plugin.cmake @@ -35,7 +35,7 @@ include(CMakeParseArguments) # `jack`, `ladspa`, `dssi`, `lv2`, `vst` # # `UI_TYPE` -# the user interface type, if any: `cairo`, `opengl` +# the user interface type: `opengl` (default), `cairo` # # `MONOLITHIC` # build LV2 as a single binary for UI and DSP @@ -45,6 +45,7 @@ include(CMakeParseArguments) # # `FILES_UI` ... # list of sources which are part of the UI +# empty indicates the plugin does not have UI # # `FILES_COMMON` ... # list of sources which are part of both DSP and UI @@ -55,16 +56,21 @@ function(dpf_add_plugin NAME) set(multiValueArgs TARGETS FILES_DSP FILES_UI) cmake_parse_arguments(_dpf_plugin "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - if(NOT _dpf_plugin_UI_TYPE) - set(_dgl_library) - elseif(_dpf_plugin_UI_TYPE STREQUAL "cairo") - dpf__add_dgl_cairo() - set(_dgl_library dgl-cairo) - elseif(_dpf_plugin_UI_TYPE STREQUAL "opengl") - dpf__add_dgl_opengl() - set(_dgl_library dgl-opengl) - else() - message(FATAL_ERROR "Unrecognized UI type for plugin: ${UI_TYPE}") + if("${_dpf_plugin_UI_TYPE}" STREQUAL "") + set(_dpf_plugin_UI_TYPE "opengl") + endif() + + set(_dgl_library) + if(_dpf_plugin_FILES_UI) + if(_dpf_plugin_UI_TYPE STREQUAL "cairo") + dpf__add_dgl_cairo() + set(_dgl_library dgl-cairo) + elseif(_dpf_plugin_UI_TYPE STREQUAL "opengl") + dpf__add_dgl_opengl() + set(_dgl_library dgl-opengl) + else() + message(FATAL_ERROR "Unrecognized UI type for plugin: ${_dpf_plugin_UI_TYPE}") + endif() endif() ### diff --git a/examples/FileHandling/CMakeLists.txt b/examples/FileHandling/CMakeLists.txt index a6b1e594..56e1be22 100644 --- a/examples/FileHandling/CMakeLists.txt +++ b/examples/FileHandling/CMakeLists.txt @@ -3,7 +3,6 @@ dpf_add_plugin(d_files TARGETS jack lv2 vst - UI_TYPE opengl FILES_DSP FileHandlingPlugin.cpp FILES_UI diff --git a/examples/Info/CMakeLists.txt b/examples/Info/CMakeLists.txt index e92a0221..1650bbe5 100644 --- a/examples/Info/CMakeLists.txt +++ b/examples/Info/CMakeLists.txt @@ -3,7 +3,6 @@ dpf_add_plugin(d_info TARGETS jack lv2 vst - UI_TYPE opengl FILES_DSP InfoExamplePlugin.cpp FILES_UI diff --git a/examples/Meters/CMakeLists.txt b/examples/Meters/CMakeLists.txt index cc2062e9..f76ee769 100644 --- a/examples/Meters/CMakeLists.txt +++ b/examples/Meters/CMakeLists.txt @@ -3,7 +3,6 @@ dpf_add_plugin(d_meters TARGETS jack dssi lv2 vst - UI_TYPE opengl FILES_DSP ExamplePluginMeters.cpp FILES_UI diff --git a/examples/Parameters/CMakeLists.txt b/examples/Parameters/CMakeLists.txt index 181c81c1..7a528bc0 100644 --- a/examples/Parameters/CMakeLists.txt +++ b/examples/Parameters/CMakeLists.txt @@ -3,7 +3,6 @@ dpf_add_plugin(d_parameters TARGETS jack ladspa dssi lv2 vst - UI_TYPE opengl FILES_DSP ExamplePluginParameters.cpp FILES_UI diff --git a/examples/States/CMakeLists.txt b/examples/States/CMakeLists.txt index 20384526..4fd22895 100644 --- a/examples/States/CMakeLists.txt +++ b/examples/States/CMakeLists.txt @@ -3,7 +3,6 @@ dpf_add_plugin(d_states TARGETS jack lv2 vst - UI_TYPE opengl FILES_DSP ExamplePluginStates.cpp FILES_UI