juicysfplugin/CMakeLists.txt

129 lines
5.0 KiB
CMake
Raw Permalink Normal View History

2021-09-07 14:04:35 +08:00
cmake_minimum_required(VERSION 3.12)
project(juicysfplugin VERSION 2.3.3)
set (CMAKE_CXX_STANDARD 17)
set (EXE_NAME juicysfplugin)
set (ASSETS_NAME juicysfplugin_assets)
include(FindPkgConfig)
find_package(JUCE CONFIG REQUIRED)
pkg_search_module(fluidsynth REQUIRED fluidsynth>=2.0.0)
# or
# add_subdirectory("../JUCE" JUCE)
# juce_set_vst2_sdk_path(...) # This setup should be done before calling `juce_add_gui_app`.
# `juce_add_gui_app` adds an executable target with the name passed as the first argument
# (GuiAppExample here). This target is a normal CMake target, but has a lot of extra properties set
# up by default. This function accepts many optional arguments. Check the readme at
# `docs/CMake API.md` in the JUCE repo for the full list.
juce_add_plugin(${EXE_NAME}
# VERSION ... # Set this if the app version is different to the project version
IS_SYNTH TRUE
PLUGIN_MANUFACTURER_CODE Juce # A four-character manufacturer id with at least one upper-case character
PLUGIN_CODE D00m # A unique four-character plugin id with exactly one upper-case character
FORMATS VST3 Standalone
PRODUCT_NAME "Juicy SF" # The name of the final executable, which can differ from the target name
)
# `juce_generate_juce_header` will create a JuceHeader.h for a given target, which will be generated
# into your build tree. This should be included with `#include <JuceHeader.h>`. The include path for
# this header will be automatically added to the target. The main function of the JuceHeader is to
# include all your JUCE module headers; if you're happy to include module headers directly, you
# probably don't need to call this.
juce_generate_juce_header(${EXE_NAME})
# `target_sources` adds source files to a target. We pass the target that needs the sources as the
# first argument, then a visibility parameter for the sources which should normally be PRIVATE.
# Finally, we supply a list of source files that will be built into the target. This is a standard
# CMake command.
target_sources(${EXE_NAME}
PRIVATE
Source/FilePicker.cpp
Source/FilePicker.h
Source/FluidSynthModel.cpp
Source/FluidSynthModel.h
Source/GuiConstants.h
Source/MidiConstants.h
Source/MyColours.cpp
Source/MyColours.h
Source/Pills.cpp
Source/Pills.h
Source/PluginEditor.cpp
Source/PluginEditor.h
Source/PluginProcessor.cpp
Source/PluginProcessor.h
Source/PluginProcessor.cpp
Source/PluginProcessor.h
Source/SlidersComponent.cpp
Source/SlidersComponent.h
Source/SurjectiveMidiKeyboardComponent.cpp
Source/SurjectiveMidiKeyboardComponent.h
Source/TableComponent.cpp
Source/TableComponent.h
Source/TablesComponent.cpp
Source/TablesComponent.h
Source/Util.h
)
target_compile_definitions(${EXE_NAME}
PRIVATE
# JUCE_WEB_BROWSER and JUCE_USE_CURL would be on by default, but you might not need them.
JUCE_WEB_BROWSER=0 # If you remove this, add `NEEDS_WEB_BROWSER TRUE` to the `juce_add_gui_app` call
JUCE_USE_CURL=0 # If you remove this, add `NEEDS_CURL TRUE` to the `juce_add_gui_app` call
JUCE_APPLICATION_NAME_STRING="$<TARGET_PROPERTY:${EXE_NAME},JUCE_PRODUCT_NAME>"
JUCE_APPLICATION_VERSION_STRING="$<TARGET_PROPERTY:${EXE_NAME},JUCE_VERSION>"
JUCER_ENABLE_GPL_MODE=1
JUCE_DISPLAY_SPLASH_SCREEN=0
JUCE_VST3_CAN_REPLACE_VST2=0
)
# If your target needs extra binary assets, you can add them here. The first argument is the name of
# a new static library target that will include all the binary resources. There is an optional
# `NAMESPACE` argument that can specify the namespace of the generated binary data class. Finally,
# the SOURCES argument should be followed by a list of source files that should be built into the
# static library. These source files can be of any kind (wav data, images, fonts, icons etc.).
# Conversion to binary-data will happen when your target is built.
#juce_add_binary_data(${ASSETS_NAME}
# SOURCES
# assets/Tick.wav
# assets/translation_zh_CN.txt
#)
# blumia: reserved for Windows SDK when building with audio features.
# we don't need it right now with a very tiny modification to JUCE.
#target_include_directories(${EXE_NAME}
# PRIVATE
# "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0"
#)
#target_link_options(${EXE_NAME}
# PRIVATE
# -static
#)
target_link_libraries(${EXE_NAME}
PRIVATE
# ${ASSETS_NAME} # If we'd created a binary data target, we'd link to it here
juce::juce_audio_formats
juce::juce_audio_utils
juce::juce_gui_extra
juce::juce_opengl # to use OpenGLContext for Android
${fluidsynth_LIBRARIES}
PUBLIC
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags
juce::juce_recommended_warning_flags
)
target_link_directories(${EXE_NAME}
PRIVATE
${fluidsynth_LIBRARY_DIRS}
)