Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 15 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
cmake_minimum_required (VERSION 3.12)
set(SUPERNOVA_CMAKE_MINVERSION 3.1)
project (sc3-plugins)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules
${CMAKE_MODULE_PATH})

find_package(SuperCollider3)
if (NOT SC_FOUND)
message(SEND_ERROR "cannot find SuperCollider3 headers. Set the variable SC_PATH.")
else()
message(STATUS "Using SC source located at ${SC_PATH}")
endif()

include("${SC_PATH}/SCVersion.txt")
project (sc3-plugins VERSION ${SC_VERSION_MAJOR}.${SC_VERSION_MINOR}.${SC_VERSION_PATCH})
Copy link
Copy Markdown
Contributor

@Spacechild1 Spacechild1 May 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right to me. On the one hand, sc3-plugins has its own version number (= the git tag), which does not necessarily matches the one of the SC repo. This can lead to situations where sc3-plugins 3.15 might present itself as 3.14 when building against SC 3.14.

I think that we should just report the "real" version, probably via a cmake_modules/version.cmake module similar to SC's SCVersion.txt. Then the message would become something like:

message(STATUS "Building sc3-plugins ${PROJECT_VERSION} against SuperCollider ${SC_VERSION}")

The question: do we mandate that the sc3-plugins matches the SC version? If yes, then we should enforce it!

Personally, I think there are situations where it can make sense to build sc3-plugins against older SC versions. For example, a user might not be able to upgrade their SC installation, but they want to compile a newer version of sc3-plugins to get some bugfixes. As long as it compiles, I don't see any issues with that. After all, sc3-plugins are in maintainance mode and won't use any new features from SC 3.15+.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess so far we didn't really track the sc3-plugins version separately from SC. So indeed, whichever version of SC you build against, this is the version reported by the plugins, at least for display and packaging purposes.

Since sc3-plugins are in maintenance mode, I don't think that's necessarily bad... ultimately it's unlikely the users need to differentiate versions of plugins themselves, but they may need to differentiate versions built against different versions of SC/plugin interface on the same machine.

The project version is also used in the cpack portion - I'm not sure who's using that, but it was similarly set to the SC version. That's why I used the implementation to just set the project version.

Do you think we should change this, particularly considering the maintenance status?

Copy link
Copy Markdown
Contributor

@Spacechild1 Spacechild1 May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that sc3-plugins should report its true version. I find the current behavior really confusing.

but they may need to differentiate versions built against different versions of SC/plugin interface on the same machine.

I don't really see why it should behave differently from "normal" third-party plugins in this regard. For example, VSTPlugin 0.6.2 does not magically turn into VSTPlugin 3.14 just because I build it against SC 3.14 :) If I need to maintain different sc3-plugins builds for different SC versions, I just need to keep them in different folders, just like with all other plugins.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this is a non-standard behavior. But do we want to change it for what's possibly one last version of sc3-plugins, assuming the package manager comes around and we split plugins into multiple independent packages?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're doing a PR anyway, I would take the chance and fix it. But that's just my opinion.

Copy link
Copy Markdown
Member Author

@dyfer dyfer May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Are you suggesting a version defined in a text file, like in SuperCollider? Or some other way? We can't only rely on a git tag, since the source needs to build from a source tarball as well.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just do the same thing as in SCVersion.txt.

message(STATUS "Building plugins for SuperCollider version: ${SC_VERSION}")

set(NOVA_SIMD_MISSING_ERROR "The nova-simd source code is missing in \
${CMAKE_CURRENT_SOURCE_DIR}/external_libraries/nova-simd.\n This probably \
Expand All @@ -22,9 +34,6 @@ if (NOT SYSTEM_STK)
endif()
endif()

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules
${CMAKE_MODULE_PATH})

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
Expand All @@ -33,13 +42,6 @@ configure_file(
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")

find_package(SuperCollider3)
if (NOT SC_FOUND)
message(SEND_ERROR "cannot find SuperCollider3 headers. Set the variable SC_PATH.")
else()
message(STATUS "Using SC source located at ${SC_PATH}")
endif()

set(NOVA_TT_MISSING_ERROR "The nova-tt source code is missing in \
${SC_PATH}/external_libraries/nova-tt.\n Make sure to point to a valid version \
of SuperCollider's source code (with the help of the SC_PATH variable).\n It's \
Expand All @@ -53,15 +55,7 @@ if (NOVA_DISK_IO)
endif()
endif()

include("${SC_PATH}/SCVersion.txt")
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}${PROJECT_VERSION_PATCH}")
message(STATUS "Building plugins for SuperCollider version: ${PROJECT_VERSION}")

if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_VERSION VERSION_LESS SUPERNOVA_CMAKE_MINVERSION)
option(SUPERNOVA "Build plugins for supernova" ON)
else()
option(SUPERNOVA "Build plugins for supernova" OFF)
endif()
option(SUPERNOVA "Build plugins for supernova" ON)

option(AY "Build with AY ugens" ON)
option(LADSPA "Build with Ladspa ugen" ON)
Expand Down Expand Up @@ -235,11 +229,6 @@ endif()
#############################################
# CPack support

set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})

if(WIN32)
set(CPACK_GENERATOR ZIP)
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
Expand Down