Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ cmake-build-debug
cmake-build-release
release-scripts
build-release
BUILDROOT/
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

74 changes: 59 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,26 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "Minimum OS X deployment version" FORCE)

project(CRYPT_SYNTH_PLUGIN VERSION 2.1.0)
project(Crypt2 VERSION 2.1.0)

add_subdirectory(JUCE)
# Enable compile commands export for IDEs
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

juce_add_plugin(Crypt2SynthPlugin
include(cmake/CPM.cmake)
CPMAddPackage("gh:/juce-framework/JUCE#8.0.11")
CPMAddPackage("gh:/free-audio/clap-juce-extensions#main")
#
# Copy plugins after build option
option(CRYPT_COPY_PLUGIN_AFTER_BUILD "Copy JUCE Plugins after built" ON)

# ==================== Add Plugin =======================
# Build LV2 only on Linux
set(JUCE_FORMATS AU VST3 Standalone)
if(UNIX AND NOT APPLE)
list(APPEND JUCE_FORMATS LV2)
endif()

juce_add_plugin(${PROJECT_NAME}
VERSION 2.1.0 # Set this if the plugin version is different to the project version
ICON_BIG ${CMAKE_CURRENT_SOURCE_DIR}/resources/crypt-icon.png # ICON_* arguments specify a path to an image file to use as an icon for the Standalone
ICON_SMALL ${CMAKE_CURRENT_SOURCE_DIR}/resources/crypt-icon.png
Expand All @@ -31,38 +46,67 @@ juce_add_plugin(Crypt2SynthPlugin
NEEDS_MIDI_OUTPUT FALSE # Does the plugin need midi output?
IS_MIDI_EFFECT FALSE # Is this plugin a MIDI effect?
EDITOR_WANTS_KEYBOARD_FOCUS FALSE # Does the editor need keyboard focus?
COPY_PLUGIN_AFTER_BUILD TRUE # Should the plugin be installed to a default location after building?
COPY_PLUGIN_AFTER_BUILD ${CRYPT_COPY_PLUGIN_AFTER_BUILD} # Should the plugin be installed to a default location after building?
PLUGIN_MANUFACTURER_CODE Vitl # A four-character manufacturer id with at least one upper-case character
PLUGIN_CODE Crp2 # A unique four-character plugin id with at least one upper-case character
DESCRIPTION "Hyper-Unison Synthesiser from Bow Church/Vitling"
VST3_CATEGORIES "Instrument Synth Stereo"
AU_MAIN_TYPE "kAudioUnitType_MusicDevice"
FORMATS VST3 AU Standalone # The formats to build. Other valid formats are: AAX Unity VST AU AUv3
FORMATS ${JUCE_FORMATS}
BUNDLE_ID "xyz.vitling.plugins.crypt2"
HARDENED_RUNTIME_ENABLED TRUE
PRODUCT_NAME "Crypt2") # The name of the final executable, which can differ from the target name
LV2URI "https://github.com/vitling/crypt"
PRODUCT_NAME ${PROJECT_NAME}) # The name of the final executable, which can differ from the target name


juce_generate_juce_header(Crypt2SynthPlugin)
# ==================== CLAP =======================
clap_juce_extensions_plugin(TARGET ${PROJECT_NAME}
CLAP_ID "xyz.vitling.plugins.crypt2"
CLAP_FEATURES instrument "virtual analog"
)

target_sources(Crypt2SynthPlugin PRIVATE
juce_generate_juce_header(${PROJECT_NAME})

target_sources(${PROJECT_NAME} PRIVATE
src/CryptPlugin.cpp)

target_compile_definitions(Crypt2SynthPlugin
target_compile_definitions(${PROJECT_NAME}
PUBLIC
JUCE_WEB_BROWSER=0
JUCE_USE_CURL=0
JUCE_VST3_CAN_REPLACE_VST2=0

# We don't have to display the splash screen since we're using JUCE
# under the GPL
JUCE_DISPLAY_SPLASH_SCREEN=0)
# JUCE_DISPLAY_SPLASH_SCREEN=0
)

juce_add_binary_data(Crypt2SynthPluginData SOURCES resources/Gothica-Book.ttf resources/bg.jpg resources/presets.xml resources/keyboard-icon.png)
set_target_properties(Crypt2SynthPluginData PROPERTIES POSITION_INDEPENDENT_CODE ON)
juce_add_binary_data(${PROJECT_NAME}Data SOURCES resources/Gothica-Book.ttf resources/bg.jpg resources/presets.xml resources/keyboard-icon.png)
set_target_properties(${PROJECT_NAME}Data PROPERTIES POSITION_INDEPENDENT_CODE ON)

target_link_libraries(Crypt2SynthPlugin PRIVATE
Crypt2SynthPluginData
target_link_libraries(${PROJECT_NAME} PRIVATE
${PROJECT_NAME}Data
juce::juce_audio_utils
juce::juce_dsp)



# ==================== Installation =======================
include(GNUInstallDirs)

# Install the standalone application
if(TARGET ${PROJECT_NAME}_Standalone)
install(TARGETS ${PROJECT_NAME}_Standalone DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

# Install the native Juce plugins
foreach(format VST3 LV2)
if(TARGET ${PROJECT_NAME}_${format})
get_target_property(output ${PROJECT_NAME}_${format} JUCE_PLUGIN_ARTEFACT_FILE)
install(DIRECTORY ${output} DESTINATION ${CMAKE_INSTALL_LIBDIR}/$<LOWER_CASE:${format}>)
endif()
endforeach()

# Install the CLAP plugin
if(TARGET ${PROJECT_NAME}_CLAP)
install(TARGETS ${PROJECT_NAME}_CLAP DESTINATION ${CMAKE_INSTALL_LIBDIR}/clap)
endif()
1 change: 0 additions & 1 deletion JUCE
Submodule JUCE deleted from 4f4301
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
NAME = Crypt2
BUILD_DIR = build
BUILD_TYPE ?= Release
SETUP_OPTIONS = -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCRYPT_COPY_PLUGIN_AFTER_BUILD=OFF
BUILD_OPTIONS = --config ${BUILD_TYPE} ${TARGET}
BUILDROOT = $(shell pwd)/BUILDROOT

all: build

clean:
@echo "Cleaning build directory : ${BUILD_DIR}"
@rm -rf ${BUILD_DIR}
.PHONY: clean

setup:
cmake -B ${BUILD_DIR} ${SETUP_OPTIONS}
.PHONY: setup

build: setup
cmake --build ${BUILD_DIR} ${BUILD_OPTIONS}
.PHONY: build

install: build
@echo "Installing ${NAME} to ${BUILDROOT}"
rm -rf ${BUILDROOT}
mkdir -p ${BUILDROOT}
cmake --install ${BUILD_DIR} --prefix ${BUILDROOT}/usr/
.PHONY: install

run-stanalone:
@echo "Running standalone"
${BUILDROOT}/usr/bin/${NAME}
.PHONY: run-stanalone
24 changes: 24 additions & 0 deletions cmake/CPM.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-License-Identifier: MIT
#
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors

set(CPM_DOWNLOAD_VERSION 0.42.0)
set(CPM_HASH_SUM "2020b4fc42dba44817983e06342e682ecfc3d2f484a581f11cc5731fbe4dce8a")

if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
else()
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
endif()

# Expand relative path. This is important if the provided path contains a tilde (~)
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)

file(DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
)

include(${CPM_DOWNLOAD_LOCATION})
Loading