Separerade Windows och Mac-versionerna
This commit is contained in:
1 parent
ecc15de9bf
commit
b16e68f824
3 files changed
+181
-44
No files matched your search
+181
-44
@@ -1,31 +1,103 @@
|
||||
cmake_minimum_required(VERSION 3.22)
|
||||
project(CrilleBassStrip VERSION 1.0.0 LANGUAGES C CXX)
|
||||
|
||||
project(CrilleBassStrip
|
||||
VERSION 1.0.0
|
||||
LANGUAGES C CXX
|
||||
)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# ============================================================
|
||||
# JUCE
|
||||
# ============================================================
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
JUCE
|
||||
GIT_REPOSITORY https://github.com/juce-framework/JUCE.git
|
||||
GIT_TAG 8.0.6
|
||||
GIT_SHALLOW TRUE
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(JUCE)
|
||||
|
||||
set(VST3_INSTALL_DIR "C:/Program Files/Common Files/VST3")
|
||||
set(RELEASE_DIR "${CMAKE_SOURCE_DIR}/Release")
|
||||
set(ASIO_SDK_DIR "C:/SDK/asio" CACHE PATH "Path to the Steinberg ASIO SDK")
|
||||
|
||||
# ============================================================
|
||||
# External libraries
|
||||
# ============================================================
|
||||
|
||||
add_subdirectory(External/signalsmith-stretch)
|
||||
|
||||
|
||||
# ============================================================
|
||||
# Common paths
|
||||
# ============================================================
|
||||
|
||||
set(RELEASE_DIR "${CMAKE_SOURCE_DIR}/Release")
|
||||
|
||||
|
||||
# ============================================================
|
||||
# Platform-specific configuration
|
||||
# ============================================================
|
||||
|
||||
if(WIN32)
|
||||
|
||||
message(STATUS "Configuring Crille Bass Strip for Windows")
|
||||
|
||||
set(VST3_INSTALL_DIR
|
||||
"C:/Program Files/Common Files/VST3"
|
||||
CACHE PATH
|
||||
"Windows VST3 install directory"
|
||||
)
|
||||
|
||||
set(ASIO_SDK_DIR
|
||||
"C:/SDK/asio"
|
||||
CACHE PATH
|
||||
"Path to the Steinberg ASIO SDK"
|
||||
)
|
||||
|
||||
elseif(APPLE)
|
||||
|
||||
message(STATUS "Configuring Crille Bass Strip for macOS")
|
||||
|
||||
set(VST3_INSTALL_DIR
|
||||
"$ENV{HOME}/Library/Audio/Plug-Ins/VST3"
|
||||
CACHE PATH
|
||||
"macOS VST3 install directory"
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
# ============================================================
|
||||
# Common source files
|
||||
# ============================================================
|
||||
|
||||
set(CRILLE_COMMON_SOURCES
|
||||
Source/PluginProcessor.cpp
|
||||
Source/PluginProcessor.h
|
||||
Source/PluginEditor.cpp
|
||||
Source/PluginEditor.h
|
||||
)
|
||||
|
||||
|
||||
# ============================================================
|
||||
# VST3 plugin
|
||||
# ============================================================
|
||||
|
||||
juce_add_plugin(CrilleBassStrip
|
||||
COMPANY_NAME "Crille Audio"
|
||||
BUNDLE_ID "org.crilleaudio.crillebassstrip"
|
||||
|
||||
PLUGIN_MANUFACTURER_CODE Cril
|
||||
PLUGIN_CODE CbSt
|
||||
|
||||
FORMATS VST3
|
||||
|
||||
PRODUCT_NAME "Crille Bass Strip"
|
||||
|
||||
COPY_PLUGIN_AFTER_BUILD TRUE
|
||||
VST3_COPY_DIR "${VST3_INSTALL_DIR}"
|
||||
)
|
||||
@@ -33,23 +105,16 @@ juce_add_plugin(CrilleBassStrip
|
||||
juce_generate_juce_header(CrilleBassStrip)
|
||||
|
||||
target_sources(CrilleBassStrip PRIVATE
|
||||
Source/PluginProcessor.cpp
|
||||
Source/PluginProcessor.h
|
||||
Source/PluginEditor.cpp
|
||||
Source/PluginEditor.h
|
||||
${CRILLE_COMMON_SOURCES}
|
||||
)
|
||||
|
||||
target_compile_definitions(CrilleBassStrip PUBLIC
|
||||
JUCE_WEB_BROWSER=0
|
||||
JUCE_USE_CURL=0
|
||||
JUCE_VST3_CAN_REPLACE_VST2=0
|
||||
JUCE_ASIO=1
|
||||
)
|
||||
|
||||
target_include_directories(CrilleBassStrip PRIVATE
|
||||
"${ASIO_SDK_DIR}/common"
|
||||
"${ASIO_SDK_DIR}/host"
|
||||
"${ASIO_SDK_DIR}/host/pc"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/External/signalsmith-stretch"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/External"
|
||||
)
|
||||
@@ -57,19 +122,17 @@ target_include_directories(CrilleBassStrip PRIVATE
|
||||
target_link_libraries(CrilleBassStrip PRIVATE
|
||||
juce::juce_audio_utils
|
||||
juce::juce_dsp
|
||||
|
||||
PUBLIC
|
||||
juce::juce_recommended_config_flags
|
||||
juce::juce_recommended_lto_flags
|
||||
juce::juce_recommended_warning_flags
|
||||
)
|
||||
|
||||
add_custom_command(TARGET CrilleBassStrip_VST3 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${RELEASE_DIR}/Windows/VST3"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"$<TARGET_FILE_DIR:CrilleBassStrip_VST3>/../.."
|
||||
"${RELEASE_DIR}/Windows/VST3/Crille Bass Strip.vst3"
|
||||
COMMENT "Copying Windows VST3 to Release"
|
||||
)
|
||||
|
||||
# ============================================================
|
||||
# Standalone application
|
||||
# ============================================================
|
||||
|
||||
juce_add_gui_app(CrilleBassStripApp
|
||||
PRODUCT_NAME "Crille Bass Strip"
|
||||
@@ -82,49 +145,123 @@ juce_generate_juce_header(CrilleBassStripApp)
|
||||
target_sources(CrilleBassStripApp PRIVATE
|
||||
Source/StandaloneMain.cpp
|
||||
Source/StandaloneMain.h
|
||||
Source/PluginProcessor.cpp
|
||||
Source/PluginProcessor.h
|
||||
Source/PluginEditor.cpp
|
||||
Source/PluginEditor.h
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
target_sources(CrilleBassStripApp PRIVATE
|
||||
Assets/CrilleBassStrip.rc
|
||||
)
|
||||
endif()
|
||||
${CRILLE_COMMON_SOURCES}
|
||||
)
|
||||
|
||||
target_compile_definitions(CrilleBassStripApp PRIVATE
|
||||
JUCE_WEB_BROWSER=0
|
||||
JUCE_USE_CURL=0
|
||||
JUCE_ASIO=1
|
||||
)
|
||||
|
||||
target_include_directories(CrilleBassStripApp PRIVATE
|
||||
"${ASIO_SDK_DIR}/common"
|
||||
"${ASIO_SDK_DIR}/host"
|
||||
"${ASIO_SDK_DIR}/host/pc"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/External/signalsmith-stretch"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/External"
|
||||
)
|
||||
|
||||
target_include_directories(CrilleBassStrip PRIVATE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/External/signalsmith-stretch"
|
||||
)
|
||||
|
||||
target_link_libraries(CrilleBassStripApp PRIVATE
|
||||
juce::juce_audio_utils
|
||||
juce::juce_dsp
|
||||
|
||||
PUBLIC
|
||||
juce::juce_recommended_config_flags
|
||||
juce::juce_recommended_lto_flags
|
||||
juce::juce_recommended_warning_flags
|
||||
)
|
||||
|
||||
add_custom_command(TARGET CrilleBassStripApp POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${RELEASE_DIR}/Windows/Standalone"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"$<TARGET_FILE:CrilleBassStripApp>"
|
||||
"${RELEASE_DIR}/Windows/Standalone/Crille Bass Strip.exe"
|
||||
COMMENT "Copying Windows standalone app to Release"
|
||||
)
|
||||
|
||||
# ============================================================
|
||||
# Windows-specific configuration
|
||||
# ============================================================
|
||||
|
||||
if(WIN32)
|
||||
|
||||
# ASIO is only used on Windows
|
||||
target_compile_definitions(CrilleBassStripApp PRIVATE
|
||||
JUCE_ASIO=1
|
||||
)
|
||||
|
||||
target_include_directories(CrilleBassStripApp PRIVATE
|
||||
"${ASIO_SDK_DIR}/common"
|
||||
"${ASIO_SDK_DIR}/host"
|
||||
"${ASIO_SDK_DIR}/host/pc"
|
||||
)
|
||||
|
||||
# Windows executable icon
|
||||
target_sources(CrilleBassStripApp PRIVATE
|
||||
Assets/CrilleBassStrip.rc
|
||||
)
|
||||
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Copy VST3 to Release/Windows
|
||||
# --------------------------------------------------------
|
||||
|
||||
add_custom_command(TARGET CrilleBassStrip_VST3 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
"${RELEASE_DIR}/Windows/VST3"
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"$<TARGET_FILE_DIR:CrilleBassStrip_VST3>/../.."
|
||||
"${RELEASE_DIR}/Windows/VST3/Crille Bass Strip.vst3"
|
||||
|
||||
COMMENT "Copying Windows VST3 to Release"
|
||||
)
|
||||
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Copy standalone EXE to Release/Windows
|
||||
# --------------------------------------------------------
|
||||
|
||||
add_custom_command(TARGET CrilleBassStripApp POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
"${RELEASE_DIR}/Windows/Standalone"
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"$<TARGET_FILE:CrilleBassStripApp>"
|
||||
"${RELEASE_DIR}/Windows/Standalone/Crille Bass Strip.exe"
|
||||
|
||||
COMMENT "Copying Windows standalone app to Release"
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
# ============================================================
|
||||
# macOS-specific configuration
|
||||
# ============================================================
|
||||
|
||||
if(APPLE)
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Copy VST3 to Release/macOS
|
||||
# --------------------------------------------------------
|
||||
|
||||
add_custom_command(TARGET CrilleBassStrip_VST3 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
"${RELEASE_DIR}/macOS/VST3"
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"$<TARGET_BUNDLE_DIR:CrilleBassStrip_VST3>"
|
||||
"${RELEASE_DIR}/macOS/VST3/Crille Bass Strip.vst3"
|
||||
|
||||
COMMENT "Copying macOS VST3 to Release"
|
||||
)
|
||||
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Copy standalone app to Release/macOS
|
||||
# --------------------------------------------------------
|
||||
|
||||
add_custom_command(TARGET CrilleBassStripApp POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
"${RELEASE_DIR}/macOS/Standalone"
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"$<TARGET_BUNDLE_DIR:CrilleBassStripApp>"
|
||||
"${RELEASE_DIR}/macOS/Standalone/Crille Bass Strip.app"
|
||||
|
||||
COMMENT "Copying macOS standalone app to Release"
|
||||
)
|
||||
|
||||
endif()
|
||||
Binary file not shown.
BIN
Binary file not shown.
Reference in new issue
Block a user