commit a4d8eb903c1c2595ea88d556e7af9c686272c20b
parent 6fc21959b7031b1241657a54a4343a5e1be5a498
Author: Jean Pierre Cimalando <jp-dev@inbox.ru>
Date: Fri, 21 May 2021 20:50:50 +0200
cmake: make UI_TYPE default to opengl
Diffstat:
6 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/cmake/DPF-plugin.cmake b/cmake/DPF-plugin.cmake
@@ -35,7 +35,7 @@ include(CMakeParseArguments)
# `jack`, `ladspa`, `dssi`, `lv2`, `vst`
#
# `UI_TYPE` <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` <file1>...<fileN>
# list of sources which are part of the UI
+# empty indicates the plugin does not have UI
#
# `FILES_COMMON` <file1>...<fileN>
# 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -3,7 +3,6 @@
dpf_add_plugin(d_states
TARGETS jack lv2 vst
- UI_TYPE opengl
FILES_DSP
ExamplePluginStates.cpp
FILES_UI