Advertisement
ShalokShalom

cmake/PluginHandling.cmake

Jul 5th, 2024 (edited)
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 4.77 KB | None | 0 0
  1. # Plugin handling for testing
  2.  
  3. # Find required programs
  4. find_program(LV2INFO_BIN lv2info)
  5. find_program(GET_LV2_BUNDLE_URI_BIN ${CMAKE_SOURCE_DIR}/tools/get_lv2_bundle_uri.sh)
  6. find_program(GET_VST_PATH_BIN ${CMAKE_SOURCE_DIR}/tools/get_vst_path.sh)
  7.  
  8. # LV2 Plugins
  9. set(EXT_LV2_PLUGINS
  10.     "ams_lfo;AMS LFO;http://github.com/blablack/ams-lv2/lfo"
  11.     "calf_monosynth;Calf Monosynth;http://calf.sourceforge.net/plugins/Monosynth"
  12.     "helm;Helm;http://tytel.org/helm"
  13.     "sherlock_atom_inspector;Sherlock Atom Inspector;http://open-music-kontrollers.ch/lv2/sherlock#atom_inspector"
  14.     "lsp_compressor_mono;LSP Compressor Mono;http://lsp-plug.in/plugins/lv2/compressor_mono"
  15.     "lsp_compressor;LSP Compressor;http://lsp-plug.in/plugins/lv2/compressor_stereo"
  16.     "lsp_sidechain_compressor;LSP Sidechain Compressor;http://lsp-plug.in/plugins/lv2/sc_compressor_stereo"
  17.     "lsp_multisampler_24_do;LSP MultiSampler x24 Direct Out;http://lsp-plug.in/plugins/lv2/multisampler_x24_do"
  18.     "carla_rack;Carla Rack;http://kxstudio.sf.net/carla/plugins/carlarack"
  19.     "no_delay_line;No Delay Line;http://gareus.org/oss/lv2/nodelay"
  20.     "mda_ambience;mda Ambience;http://drobilla.net/plugins/mda/Ambience"
  21.     "midi_cc_map;MIDI CC Map;http://gareus.org/oss/lv2/midifilter#mapcc"
  22.     "noize_maker;NoizeMak3r;http://kunz.corrupt.ch/products/tal-noisemaker"
  23.     "tal_filter;TAL Filter;urn:juce:TalFilter"
  24.     "geonkick;Geonkick;http://geontime.com/geonkick/single"
  25.     "chipwave;ChipWave;https://github.com/linuxmao-org/shiru-plugins/chipwave"
  26.     "calf_compressor;Calf Compressor;http://calf.sourceforge.net/plugins/Compressor"
  27.     "mverb;MVerb;http://distrho.sf.net/plugins/MVerb"
  28.     "sfizz;Sfizz;http://sfztools.github.io/sfizz"
  29.     "drops;Drops;http://github.com/clearly-broken-software/drops"
  30.     "test_signal;Test Signal;http://gareus.org/oss/lv2/testsignal"
  31.     "kxstudio_lfo;KXStudio LFO;http://kxstudio.sf.net/carla/plugins/lfo"
  32. )
  33.  
  34. # VST Plugins
  35. set(EXT_VST_PLUGINS
  36.     "noizemaker;TAL-NoiseMaker.so"
  37. )
  38.  
  39. # VST3 Plugins
  40. set(EXT_VST3_PLUGINS
  41.     "onetrick_simian;Punk Labs LLC OneTrick SIMIAN.vst3"
  42.     "dexed;Dexed.vst3"
  43.     "surge_xt;Surge XT.vst3"
  44. )
  45.  
  46. if(TESTS AND LV2INFO_BIN AND GET_LV2_BUNDLE_URI_BIN)
  47.     find_program(LV2LS_BIN lv2ls)
  48.     if(LV2LS_BIN)
  49.         execute_process(
  50.             COMMAND ${LV2LS_BIN}
  51.             OUTPUT_VARIABLE LV2LS_OUTPUT
  52.             OUTPUT_STRIP_TRAILING_WHITESPACE
  53.         )
  54.  
  55.         foreach(PLUGIN ${EXT_LV2_PLUGINS})
  56.             string(REPLACE ";" "," PLUGIN_INFO "${PLUGIN}")
  57.             string(REPLACE "," ";" PLUGIN_LIST ${PLUGIN_INFO})
  58.             list(GET PLUGIN_LIST 0 PLUGIN_NAME)
  59.             list(GET PLUGIN_LIST 2 PLUGIN_URI)
  60.  
  61.             if(LV2LS_OUTPUT MATCHES "${PLUGIN_URI}")
  62.                 execute_process(
  63.                     COMMAND ${GET_LV2_BUNDLE_URI_BIN} ${LV2INFO_BIN} ${PLUGIN_URI}
  64.                     OUTPUT_VARIABLE PLUGIN_BUNDLE
  65.                     OUTPUT_STRIP_TRAILING_WHITESPACE
  66.                 )
  67.                 set(HAVE_EXT_LV2_${PLUGIN_NAME} TRUE)
  68.                 set(EXT_LV2_PLUGIN_BUNDLE_${PLUGIN_NAME} ${PLUGIN_BUNDLE})
  69.             endif()
  70.         endforeach()
  71.     endif()
  72. endif()
  73.  
  74. if(TESTS AND GET_VST_PATH_BIN)
  75.     foreach(PLUGIN ${EXT_VST_PLUGINS})
  76.         string(REPLACE ";" "," PLUGIN_INFO "${PLUGIN}")
  77.         string(REPLACE "," ";" PLUGIN_LIST ${PLUGIN_INFO})
  78.         list(GET PLUGIN_LIST 0 PLUGIN_NAME)
  79.         list(GET PLUGIN_LIST 1 PLUGIN_FILENAME)
  80.  
  81.         execute_process(
  82.             COMMAND ${GET_VST_PATH_BIN} ${PLUGIN_FILENAME}
  83.             RESULT_VARIABLE VST_FOUND
  84.             OUTPUT_QUIET
  85.         )
  86.  
  87.         if(VST_FOUND EQUAL 0)
  88.             execute_process(
  89.                 COMMAND ${GET_VST_PATH_BIN} ${PLUGIN_FILENAME} ""
  90.                 OUTPUT_VARIABLE PLUGIN_PATH
  91.                 OUTPUT_STRIP_TRAILING_WHITESPACE
  92.             )
  93.             set(HAVE_EXT_VST_${PLUGIN_NAME} TRUE)
  94.             set(EXT_VST_PLUGIN_PATH_${PLUGIN_NAME} ${PLUGIN_PATH})
  95.         endif()
  96.     endforeach()
  97.  
  98.     foreach(PLUGIN ${EXT_VST3_PLUGINS})
  99.         string(REPLACE ";" "," PLUGIN_INFO "${PLUGIN}")
  100.         string(REPLACE "," ";" PLUGIN_LIST ${PLUGIN_INFO})
  101.         list(GET PLUGIN_LIST 0 PLUGIN_NAME)
  102.         list(GET PLUGIN_LIST 1 PLUGIN_FILENAME)
  103.  
  104.         execute_process(
  105.             COMMAND ${GET_VST_PATH_BIN} ${PLUGIN_FILENAME}
  106.             RESULT_VARIABLE VST3_FOUND
  107.             OUTPUT_QUIET
  108.         )
  109.  
  110.         if(VST3_FOUND EQUAL 0)
  111.             execute_process(
  112.                 COMMAND ${GET_VST_PATH_BIN} ${PLUGIN_FILENAME} "3"
  113.                 OUTPUT_VARIABLE PLUGIN_PATH
  114.                 OUTPUT_STRIP_TRAILING_WHITESPACE
  115.             )
  116.             set(HAVE_EXT_VST3_${PLUGIN_NAME} TRUE)
  117.             set(EXT_VST3_PLUGIN_PATH_${PLUGIN_NAME} ${PLUGIN_PATH})
  118.         endif()
  119.     endforeach()
  120. endif()
  121.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement