From 94d6dd6feaec8ce1b08fc2f4f21f3e8a9566e4a5 Mon Sep 17 00:00:00 2001 From: Steven Yi Date: Thu, 29 Oct 2026 14:21:37 -0400 Subject: [PATCH] fix(cmake): set PLUGIN_INSTALL_DIR as a cache entry Restore `CACHE PATH` on `PLUGIN_INSTALL_DIR` definitions in CMakeLists.txt (which was accidentally dropped when rebasing 76e5d49 in PR #10) so packagers can override the plugin install location via `-DPLUGIN_INSTALL_DIR`. Fixes #12 --- CMakeLists.txt | 14 +++++++------- README.md | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07eb007..4de3201 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,24 +173,24 @@ endif() # plugin install directories (CS_USER_PLUGIN on MacOs/Windows) if(WASM) - set(PLUGIN_INSTALL_DIR "lib") + set(PLUGIN_INSTALL_DIR "lib" CACHE PATH "Plugin install path") elseif(USE_DOUBLE) message(STATUS "Building with 64-bit floats") if(APPLE) - set(PLUGIN_INSTALL_DIR "$ENV{HOME}/Library/csound/${APIVERSION}/plugins64") + set(PLUGIN_INSTALL_DIR "$ENV{HOME}/Library/csound/${APIVERSION}/plugins64" CACHE PATH "Plugin install path") elseif(LINUX) - set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/csound/plugins64-${APIVERSION}") + set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/csound/plugins64-${APIVERSION}" CACHE PATH "Plugin install path") elseif(MSVC) - set(PLUGIN_INSTALL_DIR "$ENV{LOCALAPPDATA}/csound/${APIVERSION}/plugins64") + set(PLUGIN_INSTALL_DIR "$ENV{LOCALAPPDATA}/csound/${APIVERSION}/plugins64" CACHE PATH "Plugin install path") endif() else() message(STATUS "Building with 32-bit floats") if(APPLE) - set(PLUGIN_INSTALL_DIR "$ENV{HOME}/Library/csound/${APIVERSION}/plugins") + set(PLUGIN_INSTALL_DIR "$ENV{HOME}/Library/csound/${APIVERSION}/plugins" CACHE PATH "Plugin install path") elseif(LINUX) - set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/csound/plugins-${APIVERSION}") + set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/csound/plugins-${APIVERSION}" CACHE PATH "Plugin install path") elseif(MSVC) - set(PLUGIN_INSTALL_DIR "$ENV{LOCALAPPDATA}/csound/${APIVERSION}/plugins") + set(PLUGIN_INSTALL_DIR "$ENV{LOCALAPPDATA}/csound/${APIVERSION}/plugins" CACHE PATH "Plugin install path") endif() endif() diff --git a/README.md b/README.md index 56559b5..77b62be 100644 --- a/README.md +++ b/README.md @@ -378,6 +378,9 @@ library instalation directory (customisable) on LINUX. These are: * For doubles: `%LOCALAPPDATA%\csound\${APIVERSION}\plugins64` * For floats: `%LOCALAPPDATA%\csound\${APIVERSION}\plugins` +On all platforms, the install directory can be overridden by setting the +`PLUGIN_INSTALL_DIR` CMake cache variable (e.g. `-DPLUGIN_INSTALL_DIR=/custom/path`). + Build Instructions for Linux and MacOS ---