First Commit

This commit is contained in:
Legaeli
2025-10-22 09:20:23 +02:00
commit a36f2ca925
4393 changed files with 1570219 additions and 0 deletions
@@ -0,0 +1,94 @@
# ==============================================================================
#
# This file is part of the JUCE framework.
# Copyright (c) Raw Material Software Limited
#
# JUCE is an open source framework subject to commercial or open source
# licensing.
#
# By downloading, installing, or using the JUCE framework, or combining the
# JUCE framework with any other source code, object code, content or any other
# copyrightable work, you agree to the terms of the JUCE End User Licence
# Agreement, and all incorporated terms including the JUCE Privacy Policy and
# the JUCE Website Terms of Service, as applicable, which will bind you. If you
# do not agree to the terms of these agreements, we will not license the JUCE
# framework to you, and you must discontinue the installation or download
# process and cease use of the JUCE framework.
#
# JUCE End User Licence Agreement: https://juce.com/legal/juce-8-licence/
# JUCE Privacy Policy: https://juce.com/juce-privacy-policy
# JUCE Website Terms of Service: https://juce.com/juce-website-terms-of-service/
#
# Or:
#
# You may also use this code under the terms of the AGPLv3:
# https://www.gnu.org/licenses/agpl-3.0.en.html
#
# THE JUCE FRAMEWORK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL
# WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WARRANTY OF
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.
#
# ==============================================================================
include(FindPackageHandleStandardArgs)
if(JUCE_WEBVIEW2_PACKAGE_LOCATION)
set(initial_search_dir ${JUCE_WEBVIEW2_PACKAGE_LOCATION})
else()
set(initial_search_dir "$ENV{USERPROFILE}/AppData/Local/PackageManagement/NuGet/Packages")
endif()
file(GLOB subdirs "${initial_search_dir}/*Microsoft.Web.WebView2*")
if(subdirs)
list(GET subdirs 0 search_dir)
list(LENGTH subdirs num_webview2_packages)
if(num_webview2_packages GREATER 1)
message(WARNING "Multiple WebView2 packages found in the local NuGet folder. Proceeding with ${search_dir}.")
endif()
find_path(WebView2_root_dir build/native/include/WebView2.h HINTS ${search_dir})
set(WebView2_include_dir "${WebView2_root_dir}/build/native/include")
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64")
set(WebView2_arch arm64)
else()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(WebView2_arch x64)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(WebView2_arch x86)
endif()
endif()
set(WebView2_library "${WebView2_root_dir}/build/native/${WebView2_arch}/WebView2LoaderStatic.lib")
elseif(NOT WebView2_FIND_QUIETLY)
message(WARNING
"WebView2 wasn't found in the the local NuGet folder."
"\n"
"To install NuGet and the WebView2 package containing the statically linked library, "
"open a PowerShell and issue the following commands"
"\n"
"> Register-PackageSource -provider NuGet -name nugetRepository -location https://www.nuget.org/api/v2\n"
"> Install-Package Microsoft.Web.WebView2 -Scope CurrentUser -RequiredVersion 1.0.1901.177 -Source nugetRepository\n"
"\n"
"Alternatively you can use the JUCE_WEBVIEW2_PACKAGE_LOCATION CMake variable to specify the directory "
"where this find script is looking for the *Microsoft.Web.WebView2* package directory.")
endif()
find_package_handle_standard_args(WebView2 DEFAULT_MSG WebView2_include_dir WebView2_library)
if(WebView2_FOUND)
set(WebView2_INCLUDE_DIRS ${WebView2_include_dir})
set(WebView2_LIBRARIES ${WebView2_library})
mark_as_advanced(WebView2_library WebView2_include_dir WebView2_root_dir)
if(NOT TARGET juce_webview2)
add_library(juce_webview2 INTERFACE)
add_library(juce::juce_webview2 ALIAS juce_webview2)
target_include_directories(juce_webview2 INTERFACE ${WebView2_INCLUDE_DIRS})
target_link_libraries(juce_webview2 INTERFACE ${WebView2_LIBRARIES})
endif()
endif()
@@ -0,0 +1,128 @@
# ==============================================================================
#
# This file is part of the JUCE framework.
# Copyright (c) Raw Material Software Limited
#
# JUCE is an open source framework subject to commercial or open source
# licensing.
#
# By downloading, installing, or using the JUCE framework, or combining the
# JUCE framework with any other source code, object code, content or any other
# copyrightable work, you agree to the terms of the JUCE End User Licence
# Agreement, and all incorporated terms including the JUCE Privacy Policy and
# the JUCE Website Terms of Service, as applicable, which will bind you. If you
# do not agree to the terms of these agreements, we will not license the JUCE
# framework to you, and you must discontinue the installation or download
# process and cease use of the JUCE framework.
#
# JUCE End User Licence Agreement: https://juce.com/legal/juce-8-licence/
# JUCE Privacy Policy: https://juce.com/juce-privacy-policy
# JUCE Website Terms of Service: https://juce.com/juce-website-terms-of-service/
#
# Or:
#
# You may also use this code under the terms of the AGPLv3:
# https://www.gnu.org/licenses/agpl-3.0.en.html
#
# THE JUCE FRAMEWORK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL
# WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WARRANTY OF
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.
#
# ==============================================================================
function(_juce_create_atomic_target target_name)
add_library("${target_name}" INTERFACE)
add_library("juce::${target_name}" ALIAS "${target_name}")
if(NOT ((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD")))
return()
endif()
set(test_atomic_with_is_lock_free_file_contents
[[
#include <atomic>
int main (int argc, char** argv)
{
std::atomic<long long> ll { static_cast<long long> (argc) };
ll ^= static_cast<long long> (ll.is_lock_free());
return static_cast<int> (ll);
}
]])
set(test_simple_atomic_file_contents
[[
#include <atomic>
int main (int argc, char** argv)
{
std::atomic<long long> ll { static_cast<long long> (argc) };
ll ^= 1;
return static_cast<int> (ll);
}
]])
string(RANDOM LENGTH 16 random_file_string)
set(test_file_name "${CMAKE_CURRENT_BINARY_DIR}/check_atomic_${random_file_string}.cpp")
string(RANDOM LENGTH 16 random_dir_string)
set(test_bindir "${CMAKE_CURRENT_BINARY_DIR}/check_atomic_dir_${random_dir_string}")
file(WRITE "${test_file_name}" "${test_atomic_with_is_lock_free_file_contents}")
try_compile(compile_result "${test_bindir}" "${test_file_name}"
OUTPUT_VARIABLE test_build_output_0
CXX_STANDARD 17
CXX_STANDARD_REQUIRED TRUE
CXX_EXTENSIONS FALSE)
if(NOT compile_result)
try_compile(compile_result "${test_bindir}" "${test_file_name}"
OUTPUT_VARIABLE test_build_output_1
LINK_LIBRARIES atomic
CXX_STANDARD 17
CXX_STANDARD_REQUIRED TRUE
CXX_EXTENSIONS FALSE)
if (NOT compile_result)
file(WRITE "${test_file_name}" "${test_simple_atomic_file_contents}")
try_compile(compile_result "${test_bindir}" "${test_file_name}"
OUTPUT_VARIABLE test_build_output_2
LINK_LIBRARIES atomic
CXX_STANDARD 17
CXX_STANDARD_REQUIRED TRUE
CXX_EXTENSIONS FALSE)
if (NOT compile_result)
message(FATAL_ERROR
"First build output:\n"
"${test_build_output_0}"
"\n\nSecond build output:\n"
"${test_build_output_1}"
"\n\nThird build output:\n"
"${test_build_output_2}"
"\n\nJUCE requires support for std::atomic, but this system cannot "
"successfully compile a program which uses std::atomic. "
"You may need to install a dedicated libatomic package using your "
"system's package manager.")
else()
message(WARNING
"First build output:\n"
"${test_build_output_0}"
"\n\nSecond build output:\n"
"${test_build_output_1}"
"\n\nIf you are seeing this warning it means that the libatomic library"
"on this system doesn't support is_lock_free."
"Please let the JUCE team know.")
endif()
endif()
target_link_libraries("${target_name}" INTERFACE atomic)
endif()
file(REMOVE "${test_file_name}")
file(REMOVE_RECURSE "${test_bindir}")
endfunction()
_juce_create_atomic_target(juce_atomic_wrapper)
@@ -0,0 +1,96 @@
# ==============================================================================
#
# This file is part of the JUCE library.
# Copyright (c) - Raw Material Software Limited
#
# JUCE is an open source library subject to commercial or open-source
# licensing.
#
# The code included in this file is provided under the terms of the ISC license
# http://www.isc.org/downloads/software-support-policy/isc-license. Permission
# To use, copy, modify, and/or distribute this software for any purpose with or
# without fee is hereby granted provided that the above copyright notice and
# this permission notice appear in all copies.
#
# JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
# EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
# DISCLAIMED.
#
# ==============================================================================
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/LV2_HELPER.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/VST3_HELPER.cmake")
if(NOT TARGET juce::juceaide)
add_executable(juce::juceaide IMPORTED)
set_target_properties(juce::juceaide PROPERTIES
IMPORTED_LOCATION "@PACKAGE_JUCEAIDE_PATH@")
endif()
check_required_components("@PROJECT_NAME@")
set(JUCE_MODULES_DIR "@PACKAGE_JUCE_MODULE_PATH@" CACHE INTERNAL
"The path to JUCE modules")
include("@PACKAGE_UTILS_INSTALL_DIR@/JUCEModuleSupport.cmake")
include("@PACKAGE_UTILS_INSTALL_DIR@/JUCEUtils.cmake")
set(_juce_modules
juce_analytics
juce_animation
juce_audio_basics
juce_audio_devices
juce_audio_formats
juce_audio_plugin_client
juce_audio_processors
juce_audio_utils
juce_box2d
juce_core
juce_cryptography
juce_data_structures
juce_dsp
juce_events
juce_graphics
juce_gui_basics
juce_gui_extra
juce_javascript
juce_midi_ci
juce_opengl
juce_osc
juce_product_unlocking
juce_video)
set(_targets_defined)
set(_targets_expected)
foreach(_juce_module IN LISTS _juce_modules)
list(APPEND _targets_expected ${_juce_module} juce::${_juce_modules})
if(TARGET ${_juce_module})
list(APPEND _targets_defined ${_juce_module})
endif()
if(TARGET juce::${_juce_module})
list(APPEND _targets_defined juce::${_juce_module})
endif()
endforeach()
if("${_targets_defined}" STREQUAL "${_targets_expected}")
unset(_targets_defined)
unset(_targets_expected)
return()
endif()
if(NOT "${_targets_defined}" STREQUAL "")
message(FATAL_ERROR "Some targets in this export set were already defined.")
endif()
unset(_targets_defined)
unset(_targets_expected)
foreach(_juce_module IN LISTS _juce_modules)
juce_add_module("@PACKAGE_JUCE_MODULE_PATH@/${_juce_module}" ALIAS_NAMESPACE juce)
endforeach()
unset(_juce_modules)
@@ -0,0 +1,166 @@
# ==============================================================================
#
# This file is part of the JUCE framework.
# Copyright (c) Raw Material Software Limited
#
# JUCE is an open source framework subject to commercial or open source
# licensing.
#
# By downloading, installing, or using the JUCE framework, or combining the
# JUCE framework with any other source code, object code, content or any other
# copyrightable work, you agree to the terms of the JUCE End User Licence
# Agreement, and all incorporated terms including the JUCE Privacy Policy and
# the JUCE Website Terms of Service, as applicable, which will bind you. If you
# do not agree to the terms of these agreements, we will not license the JUCE
# framework to you, and you must discontinue the installation or download
# process and cease use of the JUCE framework.
#
# JUCE End User Licence Agreement: https://juce.com/legal/juce-8-licence/
# JUCE Privacy Policy: https://juce.com/juce-privacy-policy
# JUCE Website Terms of Service: https://juce.com/juce-website-terms-of-service/
#
# Or:
#
# You may also use this code under the terms of the AGPLv3:
# https://www.gnu.org/licenses/agpl-3.0.en.html
#
# THE JUCE FRAMEWORK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL
# WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WARRANTY OF
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.
#
# ==============================================================================
add_library(juce_recommended_warning_flags INTERFACE)
add_library(juce::juce_recommended_warning_flags ALIAS juce_recommended_warning_flags)
function(_juce_get_debug_config_genex result)
get_property(debug_configs GLOBAL PROPERTY DEBUG_CONFIGURATIONS)
if(NOT debug_configs)
set(debug_configs Debug)
endif()
list(TRANSFORM debug_configs REPLACE [[^.+$]] [[$<CONFIG:\0>]])
list(JOIN debug_configs "," debug_configs)
# $<CONFIG> doesn't accept multiple configurations until CMake 3.19
set(${result} "$<OR:${debug_configs}>" PARENT_SCOPE)
endfunction()
# ==================================================================================================
if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
target_compile_options(juce_recommended_warning_flags INTERFACE "/W4")
elseif((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
target_compile_options(juce_recommended_warning_flags INTERFACE
-Wall
-Wshadow-all
-Wshorten-64-to-32
-Wstrict-aliasing
-Wuninitialized
-Wunused-parameter
-Wconversion
-Wsign-compare
-Wint-conversion
-Wconditional-uninitialized
-Wconstant-conversion
-Wsign-conversion
-Wbool-conversion
-Wextra-semi
-Wunreachable-code
-Wcast-align
-Wshift-sign-overflow
-Wmissing-prototypes
-Wnullable-to-nonnull-conversion
-Wno-ignored-qualifiers
-Wswitch-enum
-Wpedantic
-Wdeprecated
-Wfloat-equal
-Wmissing-field-initializers
$<$<OR:$<COMPILE_LANGUAGE:CXX>,$<COMPILE_LANGUAGE:OBJCXX>>:
-Wzero-as-null-pointer-constant
-Wunused-private-field
-Woverloaded-virtual
-Wreorder
-Winconsistent-missing-destructor-override>
$<$<OR:$<COMPILE_LANGUAGE:OBJC>,$<COMPILE_LANGUAGE:OBJCXX>>:
-Wunguarded-availability
-Wunguarded-availability-new>)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(juce_recommended_warning_flags INTERFACE
-Wall
-Wextra
-Wpedantic
-Wstrict-aliasing
-Wuninitialized
-Wunused-parameter
-Wsign-compare
-Wsign-conversion
-Wunreachable-code
-Wcast-align
-Wno-implicit-fallthrough
-Wno-maybe-uninitialized
-Wno-ignored-qualifiers
-Wno-multichar
-Wswitch-enum
-Wredundant-decls
-Wno-strict-overflow
-Wshadow
-Wfloat-equal
-Wmissing-field-initializers
$<$<COMPILE_LANGUAGE:CXX>:
-Woverloaded-virtual
-Wreorder
-Wzero-as-null-pointer-constant>)
endif()
# ==================================================================================================
add_library(juce_recommended_config_flags INTERFACE)
add_library(juce::juce_recommended_config_flags ALIAS juce_recommended_config_flags)
if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
_juce_get_debug_config_genex(debug_config)
target_compile_options(juce_recommended_config_flags INTERFACE
$<IF:${debug_config},/Od,/Ox> $<$<STREQUAL:"${CMAKE_CXX_COMPILER_ID}","MSVC">:/MP> /EHsc)
set(needs_debug_flag TRUE)
if(POLICY CMP0141)
set(policy_state)
cmake_policy(GET CMP0141 policy_state)
if("${policy_state}" STREQUAL "NEW")
set(needs_debug_flag FALSE)
endif()
endif()
if(needs_debug_flag)
target_compile_options(juce_recommended_config_flags INTERFACE $<${debug_config}:/Z7>)
endif()
elseif((CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
_juce_get_debug_config_genex(debug_config)
target_compile_options(juce_recommended_config_flags INTERFACE
$<${debug_config}:-g -O0>
$<$<CONFIG:Release>:-O3>)
endif()
# ==================================================================================================
add_library(juce_recommended_lto_flags INTERFACE)
add_library(juce::juce_recommended_lto_flags ALIAS juce_recommended_lto_flags)
if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
target_compile_options(juce_recommended_lto_flags INTERFACE
$<$<CONFIG:Release>:$<IF:$<STREQUAL:"${CMAKE_CXX_COMPILER_ID}","MSVC">,-GL,-flto>>)
target_link_libraries(juce_recommended_lto_flags INTERFACE
$<$<CONFIG:Release>:$<$<STREQUAL:"${CMAKE_CXX_COMPILER_ID}","MSVC">:-LTCG>>)
elseif((CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
target_compile_options(juce_recommended_lto_flags INTERFACE $<$<CONFIG:Release>:-flto>)
target_link_libraries(juce_recommended_lto_flags INTERFACE $<$<CONFIG:Release>:-flto>)
# Xcode 15.0 requires this flag to avoid a compiler bug
target_link_libraries(juce_recommended_lto_flags INTERFACE
$<$<CONFIG:Release>:$<$<STREQUAL:"${CMAKE_CXX_COMPILER_ID}","AppleClang">:-Wl,-weak_reference_mismatches,weak>>)
endif()
@@ -0,0 +1,706 @@
# ==============================================================================
#
# This file is part of the JUCE framework.
# Copyright (c) Raw Material Software Limited
#
# JUCE is an open source framework subject to commercial or open source
# licensing.
#
# By downloading, installing, or using the JUCE framework, or combining the
# JUCE framework with any other source code, object code, content or any other
# copyrightable work, you agree to the terms of the JUCE End User Licence
# Agreement, and all incorporated terms including the JUCE Privacy Policy and
# the JUCE Website Terms of Service, as applicable, which will bind you. If you
# do not agree to the terms of these agreements, we will not license the JUCE
# framework to you, and you must discontinue the installation or download
# process and cease use of the JUCE framework.
#
# JUCE End User Licence Agreement: https://juce.com/legal/juce-8-licence/
# JUCE Privacy Policy: https://juce.com/juce-privacy-policy
# JUCE Website Terms of Service: https://juce.com/juce-website-terms-of-service/
#
# Or:
#
# You may also use this code under the terms of the AGPLv3:
# https://www.gnu.org/licenses/agpl-3.0.en.html
#
# THE JUCE FRAMEWORK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL
# WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WARRANTY OF
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.
#
# ==============================================================================
# ==================================================================================================
# JUCE Modules Support Helper Functions
#
# In this file, functions intended for use by end-users have the prefix `juce_`.
# Functions beginning with an underscore should be considered private and susceptible to
# change, so don't call them directly.
#
# See the readme at `docs/CMake API.md` for more information about CMake usage,
# including documentation of the public functions in this file.
# ==================================================================================================
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.22)
if(NOT CMAKE_C_COMPILE_OBJECT)
message(FATAL_ERROR "A C compiler is required to build JUCE. Add 'C' to your project's LANGUAGES.")
endif()
# ==================================================================================================
set(JUCE_CMAKE_UTILS_DIR ${CMAKE_CURRENT_LIST_DIR}
CACHE INTERNAL "The path to the folder holding this file and other resources")
include("${JUCE_CMAKE_UTILS_DIR}/JUCEHelperTargets.cmake")
include("${JUCE_CMAKE_UTILS_DIR}/JUCECheckAtomic.cmake")
# Tries to discover the target platform architecture, which is necessary for
# naming VST3 bundle folders and including bundled libraries from modules
function(_juce_find_target_architecture result)
set(test_file "${JUCE_CMAKE_UTILS_DIR}/juce_runtime_arch_detection.cpp")
try_compile(compile_result "${CMAKE_CURRENT_BINARY_DIR}" "${test_file}"
OUTPUT_VARIABLE compile_output)
string(REGEX REPLACE ".*JUCE_ARCH ([a-zA-Z0-9_-]*).*" "\\1" match_result "${compile_output}")
set("${result}" "${match_result}" PARENT_SCOPE)
endfunction()
if((CMAKE_SYSTEM_NAME STREQUAL "Windows")
OR (CMAKE_SYSTEM_NAME STREQUAL "Linux")
OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD"))
# If you really need to override the detected arch for some reason,
# you can configure the build with -DJUCE_TARGET_ARCHITECTURE=<custom arch>
if(NOT DEFINED JUCE_TARGET_ARCHITECTURE)
_juce_find_target_architecture(target_arch)
set(JUCE_TARGET_ARCHITECTURE "${target_arch}"
CACHE INTERNAL "The target architecture, used to name internal folders in VST3 bundles, and to locate bundled libraries in modules")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if ((CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "X86" AND NOT JUCE_TARGET_ARCHITECTURE STREQUAL "i386")
OR (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64"
AND NOT (JUCE_TARGET_ARCHITECTURE STREQUAL "i386"
OR JUCE_TARGET_ARCHITECTURE STREQUAL "x86_64")))
set(windows_helpers_can_run FALSE)
else()
set(windows_helpers_can_run TRUE)
endif()
set(JUCE_WINDOWS_HELPERS_CAN_RUN ${windows_helpers_can_run}
CACHE INTERNAL "Signals whether plugin related helper utilities can run on the build machine")
endif()
endif()
# ==================================================================================================
function(_juce_add_interface_library target)
add_library(${target} INTERFACE)
target_sources(${target} INTERFACE ${ARGN})
endfunction()
# ==================================================================================================
function(_juce_add_standard_defs juce_target)
_juce_get_debug_config_genex(debug_config)
target_compile_definitions(${juce_target} INTERFACE
JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1
$<IF:${debug_config},DEBUG=1 _DEBUG=1,NDEBUG=1 _NDEBUG=1>
$<$<PLATFORM_ID:Android>:JUCE_ANDROID=1>)
endfunction()
# ==================================================================================================
macro(_juce_make_absolute path)
if(NOT IS_ABSOLUTE "${${path}}")
get_filename_component(${path} "${${path}}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
endif()
string(REGEX REPLACE "\\\\" "/" ${path} "${${path}}")
endmacro()
macro(_juce_make_absolute_and_check path)
_juce_make_absolute("${path}")
if(NOT EXISTS "${${path}}")
message(FATAL_ERROR "No file at path ${${path}}")
endif()
endmacro()
# ==================================================================================================
# This creates an imported interface library with a random name, and then adds
# the fields from a JUCE module header to the target as INTERFACE_ properties.
# We can extract properties later using `_juce_get_metadata`.
# This way, the interface library ends up behaving a bit like a dictionary,
# and we don't have to parse the module header from scratch every time we
# want to find a specific key.
function(_juce_extract_metadata_block delim_str file_with_block out_dict)
string(RANDOM LENGTH 16 random_string)
set(target_name "${random_string}_dict")
set(${out_dict} "${target_name}" PARENT_SCOPE)
add_library(${target_name} INTERFACE IMPORTED)
if(NOT EXISTS ${file_with_block})
message(FATAL_ERROR "Unable to find file ${file_with_block}")
endif()
file(STRINGS ${file_with_block} module_header_contents)
set(last_written_key)
set(append NO)
foreach(line IN LISTS module_header_contents)
if(NOT append)
if(line MATCHES "[\t ]*BEGIN_${delim_str}[\t ]*")
set(append YES)
endif()
continue()
endif()
if(append AND (line MATCHES "[\t ]*END_${delim_str}[\t ]*"))
break()
endif()
if(line MATCHES "^[\t ]*([a-zA-Z]+):")
set(last_written_key "${CMAKE_MATCH_1}")
endif()
string(REGEX REPLACE "^[\t ]*${last_written_key}:[\t ]*" "" line "${line}")
string(REGEX REPLACE "[\t ,]+" ";" line "${line}")
set_property(TARGET ${target_name} APPEND PROPERTY
"INTERFACE_JUCE_${last_written_key}" "${line}")
endforeach()
endfunction()
# Fetches properties attached to a metadata target.
function(_juce_get_metadata target key out_var)
get_target_property(content "${target}" "INTERFACE_JUCE_${key}")
if("${content}" STREQUAL "content-NOTFOUND")
set(${out_var} PARENT_SCOPE)
else()
set(${out_var} "${content}" PARENT_SCOPE)
endif()
endfunction()
# ==================================================================================================
function(_juce_should_build_module_source filename output_var)
get_filename_component(trimmed_filename "${filename}" NAME_WE)
string(TOLOWER "${trimmed_filename}" trimmed_filename_lowercase)
set(system_name_regex_for_suffix
"android\;Android"
"ios\;iOS"
"linux\;Linux|.*BSD"
"mac\;Darwin"
"osx\;Darwin"
"windows\;Windows")
set(result TRUE)
foreach(pair IN LISTS system_name_regex_for_suffix)
list(GET pair 0 suffix)
list(GET pair 1 regex)
if((trimmed_filename_lowercase MATCHES "_${suffix}$") AND NOT (CMAKE_SYSTEM_NAME MATCHES "${regex}"))
set(result FALSE)
endif()
endforeach()
set("${output_var}" "${result}" PARENT_SCOPE)
endfunction()
function(_juce_module_sources module_path output_path built_sources other_sources)
get_filename_component(module_parent_path ${module_path} DIRECTORY)
get_filename_component(module_glob ${module_path} NAME)
file(GLOB_RECURSE all_module_files
CONFIGURE_DEPENDS LIST_DIRECTORIES FALSE
RELATIVE "${module_parent_path}"
"${module_path}/*")
set(base_path "${module_glob}/${module_glob}")
set(module_cpp ${all_module_files})
list(FILTER module_cpp INCLUDE REGEX "^${base_path}[^/]*\\.(c|cc|cpp|cxx|s|asm)$")
if(APPLE)
set(module_mm ${all_module_files})
list(FILTER module_mm INCLUDE REGEX "^${base_path}[^/]*\\.mm$")
if(module_mm)
set(module_mm_replaced ${module_mm})
list(TRANSFORM module_mm_replaced REPLACE "\\.mm$" ".cpp")
list(REMOVE_ITEM module_cpp ${module_mm_replaced})
endif()
set(module_apple_files ${all_module_files})
list(FILTER module_apple_files INCLUDE REGEX "${base_path}[^/]*\\.(m|mm|metal|r|swift)$")
list(APPEND module_cpp ${module_apple_files})
endif()
set(headers ${all_module_files})
set(module_files_to_build)
foreach(filename IN LISTS module_cpp)
_juce_should_build_module_source("${filename}" should_build_file)
if(should_build_file)
list(APPEND module_files_to_build "${filename}")
endif()
endforeach()
if(NOT "${module_files_to_build}" STREQUAL "")
list(REMOVE_ITEM headers ${module_files_to_build})
endif()
foreach(source_list IN ITEMS module_files_to_build headers)
list(TRANSFORM ${source_list} PREPEND "${output_path}/")
endforeach()
set(${built_sources} ${module_files_to_build} PARENT_SCOPE)
set(${other_sources} ${headers} PARENT_SCOPE)
endfunction()
# ==================================================================================================
function(_juce_get_all_plugin_kinds out)
set(${out} AU AUv3 AAX LV2 Standalone Unity VST VST3 PARENT_SCOPE)
endfunction()
function(_juce_get_platform_plugin_kinds out)
set(result Standalone)
if(APPLE AND (CMAKE_GENERATOR STREQUAL "Xcode"))
list(APPEND result AUv3)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
list(APPEND result AU)
endif()
if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS" AND NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
list(APPEND result VST LV2)
if(NOT (CMAKE_SYSTEM_NAME MATCHES ".*BSD"))
list(APPEND result Unity VST3)
endif()
endif()
if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
AND (CMAKE_SYSTEM_NAME STREQUAL "Darwin"
OR (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND JUCE_TARGET_ARCHITECTURE STREQUAL "x86_64")))
list(APPEND result AAX)
endif()
set(${out} ${result} PARENT_SCOPE)
endfunction()
function(_juce_add_plugin_definitions target visibility)
_juce_get_all_plugin_kinds(options)
cmake_parse_arguments(JUCE_ARG "${options}" "" "" ${ARGN})
foreach(opt IN LISTS options)
set(flag_value 0)
if(JUCE_ARG_${opt})
set(flag_value 1)
endif()
target_compile_definitions(${target} ${visibility} "JucePlugin_Build_${opt}=${flag_value}")
endforeach()
endfunction()
# ==================================================================================================
# Takes a target, a link visibility, if it should be a weak link, and a variable-length list of
# framework names. On macOS, for non-weak links, this finds the requested frameworks using
# `find_library`.
function(_juce_link_frameworks target visibility)
set(options WEAK)
cmake_parse_arguments(JUCE_LINK_FRAMEWORKS "${options}" "" "" ${ARGN})
foreach(framework IN LISTS JUCE_LINK_FRAMEWORKS_UNPARSED_ARGUMENTS)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if(JUCE_LINK_FRAMEWORKS_WEAK)
set(framework_flags "-weak_framework ${framework}")
else()
find_library("juce_found_${framework}" "${framework}" REQUIRED)
set(framework_flags "${juce_found_${framework}}")
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS")
if(JUCE_LINK_FRAMEWORKS_WEAK)
set(framework_flags "-weak_framework ${framework}")
else()
set(framework_flags "-framework ${framework}")
endif()
endif()
if(NOT framework_flags STREQUAL "")
target_link_libraries("${target}" "${visibility}" "${framework_flags}")
endif()
endforeach()
endfunction()
# ==================================================================================================
function(_juce_add_plugin_wrapper_target format path out_path)
_juce_module_sources("${path}" "${out_path}" out_var headers)
set(target_name juce_audio_plugin_client_${format})
_juce_add_interface_library("${target_name}" ${out_var})
_juce_add_plugin_definitions("${target_name}" INTERFACE ${format})
_juce_add_standard_defs("${target_name}")
target_compile_features("${target_name}" INTERFACE cxx_std_17)
add_library("juce::${target_name}" ALIAS "${target_name}")
if(format STREQUAL "AUv3")
_juce_link_frameworks("${target_name}" INTERFACE AVFoundation)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
_juce_link_frameworks("${target_name}" INTERFACE AudioUnit)
endif()
elseif(format STREQUAL "AU")
target_include_directories("${target_name}" INTERFACE "${out_path}/juce_audio_plugin_client/AU")
_juce_link_frameworks("${target_name}" INTERFACE AudioUnit CoreAudioKit)
endif()
endfunction()
# ==================================================================================================
function(_juce_link_libs_from_metadata module_name dict key)
_juce_get_metadata("${dict}" "${key}" libs)
if(libs)
target_link_libraries(${module_name} INTERFACE ${libs})
endif()
endfunction()
# ==================================================================================================
function(_juce_create_pkgconfig_target name)
set(options NOLINK)
cmake_parse_arguments(JUCE_ARG "${options}" "" "" ${ARGN})
if(TARGET juce::pkgconfig_${name})
return()
endif()
find_package(PkgConfig REQUIRED)
pkg_check_modules(${name} ${JUCE_ARG_UNPARSED_ARGUMENTS})
add_library(pkgconfig_${name} INTERFACE)
add_library(juce::pkgconfig_${name} ALIAS pkgconfig_${name})
install(TARGETS pkgconfig_${name} EXPORT JUCE)
set(pairs
"INCLUDE_DIRECTORIES\;INCLUDE_DIRS"
"LINK_OPTIONS\;LDFLAGS_OTHER"
"COMPILE_OPTIONS\;CFLAGS_OTHER")
if(NOT JUCE_ARG_NOLINK)
list(APPEND pairs "LINK_LIBRARIES\;LINK_LIBRARIES")
endif()
foreach(pair IN LISTS pairs)
list(GET pair 0 key)
list(GET pair 1 value)
if(${name}_${value})
set_target_properties(pkgconfig_${name} PROPERTIES INTERFACE_${key} "${${name}_${value}}")
endif()
endforeach()
endfunction()
# ==================================================================================================
function(_juce_add_library_path target path)
if(EXISTS "${path}")
target_link_directories(${target} INTERFACE ${path})
endif()
endfunction()
function(_juce_add_module_staticlib_paths module_target module_path)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
_juce_add_library_path(${module_target} "${module_path}/libs/MacOSX")
elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS")
_juce_add_library_path(${module_target} "${module_path}/libs/iOS")
elseif((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD"))
_juce_add_library_path(${module_target} "${module_path}/libs/Linux/${JUCE_TARGET_ARCHITECTURE}")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(CMAKE_GENERATOR MATCHES "Visual Studio [0-9]+ (20[0-9]+)")
set(arch "$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,x64,Win32>")
if(NOT CMAKE_GENERATOR_PLATFORM STREQUAL "")
set(arch ${CMAKE_GENERATOR_PLATFORM})
endif()
set(runtime_lib "$<GENEX_EVAL:$<TARGET_PROPERTY:MSVC_RUNTIME_LIBRARY>>")
set(subfolder "MDd")
set(subfolder "$<IF:$<STREQUAL:${runtime_lib},MultiThreadedDebug>,MTd,${subfolder}>")
set(subfolder "$<IF:$<STREQUAL:${runtime_lib},MultiThreadedDLL>,MD,${subfolder}>")
set(subfolder "$<IF:$<STREQUAL:${runtime_lib},MultiThreaded>,MT,${subfolder}>")
target_link_directories(${module_target} INTERFACE
"${module_path}/libs/VisualStudio${CMAKE_MATCH_1}/${arch}/${subfolder}")
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
_juce_add_library_path(${module_target} "${module_path}/libs/Android/${CMAKE_ANDROID_ARCH_ABI}")
endif()
endfunction()
# ==================================================================================================
function(_juce_remove_empty_list_elements arg)
list(FILTER ${arg} EXCLUDE REGEX "^$")
set(${arg} ${${arg}} PARENT_SCOPE)
endfunction()
function(juce_add_module module_path)
set(one_value_args INSTALL_PATH ALIAS_NAMESPACE)
cmake_parse_arguments(JUCE_ARG "" "${one_value_args}" "" ${ARGN})
_juce_make_absolute(module_path)
get_filename_component(module_name ${module_path} NAME)
get_filename_component(module_parent_path ${module_path} DIRECTORY)
set(module_header_name "${module_name}.h")
if(NOT EXISTS "${module_path}/${module_header_name}")
set(module_header_name "${module_header_name}pp")
endif()
if(NOT EXISTS "${module_path}/${module_header_name}")
message(FATAL_ERROR "Could not locate module header for module '${module_path}'")
endif()
set(base_path "${module_parent_path}")
_juce_module_sources("${module_path}" "${base_path}" globbed_sources headers)
set(all_module_sources)
if(${module_name} STREQUAL "juce_audio_plugin_client")
list(REMOVE_ITEM headers
"${module_path}/LV2/juce_LV2ManifestHelper.cpp"
"${module_path}/VST3/juce_VST3ManifestHelper.mm"
"${module_path}/VST3/juce_VST3ManifestHelper.cpp")
_juce_get_platform_plugin_kinds(plugin_kinds)
foreach(kind IN LISTS plugin_kinds)
_juce_add_plugin_wrapper_target(${kind} "${module_path}" "${base_path}")
endforeach()
file(GLOB_RECURSE all_module_files
CONFIGURE_DEPENDS LIST_DIRECTORIES FALSE
RELATIVE "${module_parent_path}"
"${module_path}/*")
else()
list(APPEND all_module_sources ${globbed_sources})
endif()
_juce_add_interface_library(${module_name} ${all_module_sources})
set_property(GLOBAL APPEND PROPERTY _juce_module_names ${module_name})
set_target_properties(${module_name} PROPERTIES
INTERFACE_JUCE_MODULE_SOURCES "${globbed_sources}"
INTERFACE_JUCE_MODULE_HEADERS "${headers}"
INTERFACE_JUCE_MODULE_PATH "${base_path}")
if(JUCE_ENABLE_MODULE_SOURCE_GROUPS)
target_sources(${module_name} INTERFACE ${headers})
endif()
if(${module_name} STREQUAL "juce_core")
_juce_add_standard_defs(${module_name})
target_link_libraries(juce_core INTERFACE juce::juce_atomic_wrapper)
if(CMAKE_SYSTEM_NAME MATCHES ".*BSD")
target_link_libraries(juce_core INTERFACE execinfo)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
target_sources(juce_core INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c")
target_include_directories(juce_core INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures")
target_link_libraries(juce_core INTERFACE android log)
endif()
endif()
if(${module_name} STREQUAL "juce_audio_processors")
add_library(juce_vst3_headers INTERFACE)
target_compile_definitions(juce_vst3_headers INTERFACE "$<$<TARGET_EXISTS:juce_vst3_sdk>:JUCE_CUSTOM_VST3_SDK=1>")
target_include_directories(juce_vst3_headers INTERFACE
"$<$<TARGET_EXISTS:juce_vst3_sdk>:$<TARGET_PROPERTY:juce_vst3_sdk,INTERFACE_INCLUDE_DIRECTORIES>>"
"$<$<NOT:$<TARGET_EXISTS:juce_vst3_sdk>>:${base_path}/juce_audio_processors/format_types/VST3_SDK>")
target_link_libraries(juce_audio_processors INTERFACE juce_vst3_headers)
add_library(juce_lilv_headers INTERFACE)
set(lv2_base_path "${base_path}/juce_audio_processors/format_types/LV2_SDK")
target_include_directories(juce_lilv_headers INTERFACE
"${lv2_base_path}"
"${lv2_base_path}/lv2"
"${lv2_base_path}/serd"
"${lv2_base_path}/sord"
"${lv2_base_path}/sord/src"
"${lv2_base_path}/sratom"
"${lv2_base_path}/lilv"
"${lv2_base_path}/lilv/src")
target_link_libraries(juce_audio_processors INTERFACE juce_lilv_headers)
add_library(juce_ara_headers INTERFACE)
target_include_directories(juce_ara_headers INTERFACE
"$<$<TARGET_EXISTS:juce_ara_sdk>:$<TARGET_PROPERTY:juce_ara_sdk,INTERFACE_INCLUDE_DIRECTORIES>>")
target_link_libraries(juce_audio_processors INTERFACE juce_ara_headers)
if(JUCE_ARG_ALIAS_NAMESPACE)
add_library(${JUCE_ARG_ALIAS_NAMESPACE}::juce_vst3_headers ALIAS juce_vst3_headers)
add_library(${JUCE_ARG_ALIAS_NAMESPACE}::juce_lilv_headers ALIAS juce_lilv_headers)
add_library(${JUCE_ARG_ALIAS_NAMESPACE}::juce_ara_headers ALIAS juce_ara_headers)
endif()
endif()
target_include_directories(${module_name} INTERFACE ${base_path})
target_compile_definitions(${module_name} INTERFACE JUCE_MODULE_AVAILABLE_${module_name}=1)
if((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD"))
target_compile_definitions(${module_name} INTERFACE LINUX=1)
endif()
if((${module_name} STREQUAL "juce_audio_devices") AND (CMAKE_SYSTEM_NAME STREQUAL "Android"))
add_subdirectory("${module_path}/native/oboe")
target_link_libraries(${module_name} INTERFACE oboe)
endif()
if((${module_name} STREQUAL "juce_opengl") AND (CMAKE_SYSTEM_NAME STREQUAL "Android"))
set(platform_supports_gl3 0)
if(CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL 18)
set(platform_supports_gl3 1)
endif()
if(platform_supports_gl3)
target_compile_definitions(${module_name} INTERFACE JUCE_ANDROID_GL_ES_VERSION_3_0=1)
endif()
target_link_libraries(${module_name} INTERFACE EGL $<IF:${platform_supports_gl3},GLESv3,GLESv2>)
endif()
_juce_extract_metadata_block(JUCE_MODULE_DECLARATION "${module_path}/${module_header_name}" metadata_dict)
_juce_get_metadata("${metadata_dict}" minimumCppStandard module_cpp_standard)
if(module_cpp_standard)
target_compile_features(${module_name} INTERFACE cxx_std_${module_cpp_standard})
else()
target_compile_features(${module_name} INTERFACE cxx_std_11)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
_juce_get_metadata("${metadata_dict}" OSXFrameworks module_osxframeworks)
_juce_remove_empty_list_elements(module_osxframeworks)
foreach(module_framework IN LISTS module_osxframeworks)
_juce_link_frameworks("${module_name}" INTERFACE "${module_framework}")
endforeach()
_juce_get_metadata("${metadata_dict}" WeakOSXFrameworks module_weakosxframeworks)
_juce_remove_empty_list_elements(module_weakosxframeworks)
foreach(module_framework IN LISTS module_weakosxframeworks)
_juce_link_frameworks("${module_name}" INTERFACE WEAK "${module_framework}")
endforeach()
_juce_link_libs_from_metadata("${module_name}" "${metadata_dict}" OSXLibs)
elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS")
_juce_get_metadata("${metadata_dict}" iOSFrameworks module_iosframeworks)
_juce_remove_empty_list_elements(module_iosframeworks)
foreach(module_framework IN LISTS module_iosframeworks)
_juce_link_frameworks("${module_name}" INTERFACE "${module_framework}")
endforeach()
_juce_get_metadata("${metadata_dict}" WeakiOSFrameworks module_weakiosframeworks)
_juce_remove_empty_list_elements(module_weakiosframeworks)
foreach(module_framework IN LISTS module_weakiosframeworks)
_juce_link_frameworks("${module_name}" INTERFACE WEAK "${module_framework}")
endforeach()
_juce_link_libs_from_metadata("${module_name}" "${metadata_dict}" iOSLibs)
elseif((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD"))
_juce_get_metadata("${metadata_dict}" linuxPackages module_linuxpackages)
if(module_linuxpackages)
_juce_create_pkgconfig_target(${module_name}_LINUX_DEPS ${module_linuxpackages})
target_link_libraries(${module_name} INTERFACE juce::pkgconfig_${module_name}_LINUX_DEPS)
endif()
_juce_link_libs_from_metadata("${module_name}" "${metadata_dict}" linuxLibs)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
if(module_name MATCHES "juce_gui_basics|juce_audio_processors|juce_core|juce_graphics")
target_compile_options(${module_name} INTERFACE /bigobj)
endif()
_juce_link_libs_from_metadata("${module_name}" "${metadata_dict}" windowsLibs)
endif()
endif()
_juce_get_metadata("${metadata_dict}" dependencies module_dependencies)
target_link_libraries(${module_name} INTERFACE ${module_dependencies})
_juce_get_metadata("${metadata_dict}" searchpaths module_searchpaths)
if(NOT module_searchpaths STREQUAL "")
foreach(module_searchpath IN LISTS module_searchpaths)
target_include_directories(${module_name}
INTERFACE "${module_path}/${module_searchpath}")
endforeach()
endif()
_juce_add_module_staticlib_paths("${module_name}" "${module_path}")
if(JUCE_ARG_INSTALL_PATH)
install(DIRECTORY "${module_path}" DESTINATION "${JUCE_ARG_INSTALL_PATH}")
endif()
if(JUCE_ARG_ALIAS_NAMESPACE)
add_library(${JUCE_ARG_ALIAS_NAMESPACE}::${module_name} ALIAS ${module_name})
endif()
endfunction()
function(juce_add_modules)
set(one_value_args INSTALL_PATH ALIAS_NAMESPACE)
cmake_parse_arguments(JUCE_ARG "" "${one_value_args}" "" ${ARGN})
foreach(path IN LISTS JUCE_ARG_UNPARSED_ARGUMENTS)
juce_add_module(${path}
INSTALL_PATH "${JUCE_ARG_INSTALL_PATH}"
ALIAS_NAMESPACE "${JUCE_ARG_ALIAS_NAMESPACE}")
endforeach()
endfunction()
# When source groups are enabled, this function sets the HEADER_FILE_ONLY property on any module
# source files that should not be built. This is called automatically by the juce_add_* functions.
function(_juce_fixup_module_source_groups)
if(JUCE_ENABLE_MODULE_SOURCE_GROUPS)
get_property(all_modules GLOBAL PROPERTY _juce_module_names)
foreach(module_name IN LISTS all_modules)
get_target_property(path ${module_name} INTERFACE_JUCE_MODULE_PATH)
get_target_property(header_files ${module_name} INTERFACE_JUCE_MODULE_HEADERS)
get_target_property(source_files ${module_name} INTERFACE_JUCE_MODULE_SOURCES)
source_group(TREE ${path} PREFIX "JUCE Modules" FILES ${header_files} ${source_files})
set_source_files_properties(${header_files} PROPERTIES HEADER_FILE_ONLY TRUE)
endforeach()
endif()
endfunction()
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,5 @@
#pragma once
#ifndef JucePlugin_LV2URI
#define JucePlugin_LV2URI "${JUCE_LV2URI}"
#endif
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<scenes>
<scene sceneID="EHf-IW-A2E">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="" sceneMemberID="firstResponder"/>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" red="0" green="0" blue="0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
</objects>
</scene>
</scenes>
</document>
@@ -0,0 +1,16 @@
/*
==============================================================================
This file was auto-generated and contains the startup code for a PIP.
==============================================================================
*/
#include <JuceHeader.h>
#include "${JUCE_PIP_HEADER}"
//==============================================================================
juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter()
{
return new ${JUCE_PIP_MAIN_CLASS}();
}
@@ -0,0 +1,23 @@
/*
==============================================================================
This file was auto-generated and contains the startup code for a PIP.
==============================================================================
*/
#include <JuceHeader.h>
#include "${JUCE_PIP_HEADER}"
//==============================================================================
juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter()
{
return new ${JUCE_PIP_MAIN_CLASS}();
}
#if JucePlugin_Enable_ARA
const ARA::ARAFactory* JUCE_CALLTYPE createARAFactory()
{
return juce::ARADocumentControllerSpecialisation::createARAFactory<${JUCE_PIP_DOCUMENTCONTROLLER_CLASS}>();
}
#endif
@@ -0,0 +1,68 @@
/*
==============================================================================
This file contains the startup code for a PIP.
==============================================================================
*/
#include <JuceHeader.h>
#include "${JUCE_PIP_HEADER}"
class Application : public juce::JUCEApplication
{
public:
//==============================================================================
Application() = default;
const juce::String getApplicationName() override { return "${JUCE_PIP_NAME}"; }
const juce::String getApplicationVersion() override { return "${PROJECT_VERSION}"; }
void initialise (const juce::String&) override
{
mainWindow.reset (new MainWindow ("${JUCE_PIP_NAME}", new ${JUCE_PIP_MAIN_CLASS}, *this));
}
void shutdown() override { mainWindow = nullptr; }
private:
class MainWindow : public juce::DocumentWindow
{
public:
MainWindow (const juce::String& name, juce::Component* c, JUCEApplication& a)
: DocumentWindow (name, juce::Desktop::getInstance().getDefaultLookAndFeel()
.findColour (ResizableWindow::backgroundColourId),
juce::DocumentWindow::allButtons),
app (a)
{
setUsingNativeTitleBar (true);
setContentOwned (c, true);
#if JUCE_ANDROID || JUCE_IOS
setFullScreen (true);
#else
setResizable (true, false);
setResizeLimits (300, 250, 10000, 10000);
centreWithSize (getWidth(), getHeight());
#endif
setVisible (true);
}
void closeButtonPressed() override
{
app.systemRequestedQuit();
}
private:
JUCEApplication& app;
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow)
};
std::unique_ptr<MainWindow> mainWindow;
};
//==============================================================================
START_JUCE_APPLICATION (Application)
@@ -0,0 +1,10 @@
/*
==============================================================================
This file was auto-generated and contains the startup code for a PIP.
==============================================================================
*/
#include <JuceHeader.h>
#include "${JUCE_PIP_HEADER}"
Binary file not shown.
@@ -0,0 +1,181 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
using System.Collections.Generic;
using System.Runtime.InteropServices;
public class ${plugin_class_name}GUI : IAudioEffectPluginGUI
{
public override string Name { get { return "${plugin_name}"; } }
public override string Description { get { return "${plugin_description}"; } }
public override string Vendor { get { return "${plugin_vendor}"; } }
//==============================================================================
[DllImport("${plugin_name}")] static extern System.IntPtr getRenderCallback();
[DllImport("${plugin_name}")] static extern void unityInitialiseTexture (int id, System.IntPtr texture, int width, int height);
[DllImport("${plugin_name}")] static extern void unityMouseDown (int id, float x, float y, EventModifiers mods, int button);
[DllImport("${plugin_name}")] static extern void unityMouseDrag (int id, float x, float y, EventModifiers mods, int button);
[DllImport("${plugin_name}")] static extern void unityMouseUp (int id, float x, float y, EventModifiers mods);
[DllImport("${plugin_name}")] static extern void unityKeyEvent (int id, KeyCode code, EventModifiers mods, string name);
[DllImport("${plugin_name}")] static extern void unitySetScreenBounds (int id, float x, float y, float w, float h);
//==============================================================================
private class PluginGUIInstance
{
public PluginGUIInstance (ref IAudioEffectPlugin plugin, int id)
{
instanceID = id;
float[] arr;
plugin.GetFloatBuffer ("Editor", out arr, 1);
hasEditor = (arr[0] > 0.0f);
}
public void repaint (Rect r)
{
Vector2 newScreenPosition = GUIUtility.GUIToScreenPoint (r.position);
if (bounds != r
|| screenPosition != newScreenPosition)
{
screenPosition = newScreenPosition;
bounds = r;
unitySetScreenBounds (instanceID, screenPosition.x, screenPosition.y, bounds.width, bounds.height);
setupTexture();
}
GL.IssuePluginEvent (getRenderCallback(), instanceID);
texture.SetPixels32 (pixels);
texture.Apply();
EditorGUI.DrawPreviewTexture (bounds, texture);
}
public bool handleMouseEvent (EventType eventType)
{
Vector2 mousePos = Event.current.mousePosition;
EventModifiers mods = Event.current.modifiers;
if (! bounds.Contains (mousePos))
return false;
Vector2 relativePos = new Vector2 (mousePos.x - bounds.x, mousePos.y - bounds.y);
if (eventType == EventType.MouseDown)
{
unityMouseDown (instanceID, relativePos.x, relativePos.y, mods, Event.current.button);
GUIUtility.hotControl = GUIUtility.GetControlID (FocusType.Passive);
}
else if (eventType == EventType.MouseUp)
{
unityMouseUp (instanceID, relativePos.x, relativePos.y, mods);
GUIUtility.hotControl = 0;
}
else if (eventType == EventType.MouseDrag)
{
unityMouseDrag (instanceID, relativePos.x, relativePos.y, mods, Event.current.button);
}
Event.current.Use();
return true;
}
public void handleKeyEvent (EventType eventType)
{
if (eventType == EventType.KeyDown)
{
KeyCode code = Event.current.keyCode;
if (code == KeyCode.None)
return;
EventModifiers mods = Event.current.modifiers;
unityKeyEvent (instanceID, code, mods, code.ToString());
}
}
private void setupTexture()
{
if (pixelHandle.IsAllocated)
pixelHandle.Free();
texture = new Texture2D ((int) bounds.width, (int) bounds.height, TextureFormat.ARGB32, false);
pixels = texture.GetPixels32();
pixelHandle = GCHandle.Alloc (pixels, GCHandleType.Pinned);
unityInitialiseTexture (instanceID, pixelHandle.AddrOfPinnedObject(), texture.width, texture.height);
}
public int instanceID = -1;
public bool hasEditor;
private Vector2 screenPosition;
private Rect bounds;
private Texture2D texture;
private Color32[] pixels;
private GCHandle pixelHandle;
}
List<PluginGUIInstance> guis = new List<PluginGUIInstance>();
private PluginGUIInstance getGUIInstanceForPlugin (ref IAudioEffectPlugin plugin)
{
float[] idArray;
plugin.GetFloatBuffer ("ID", out idArray, 1);
int id = (int) idArray[0];
for (int i = 0; i < guis.Count; ++i)
{
if (guis[i].instanceID == id)
return guis[i];
}
PluginGUIInstance newInstance = new PluginGUIInstance (ref plugin, id);
guis.Add (newInstance);
return guis[guis.Count - 1];
}
//==============================================================================
public override bool OnGUI (IAudioEffectPlugin plugin)
{
PluginGUIInstance guiInstance = getGUIInstanceForPlugin (ref plugin);
if (! guiInstance.hasEditor)
return true;
float[] arr;
plugin.GetFloatBuffer ("Size", out arr, 6);
Rect r = GUILayoutUtility.GetRect (arr[0], arr[1],
new GUILayoutOption[] { GUILayout.MinWidth (arr[2]), GUILayout.MinHeight (arr[3]),
GUILayout.MaxWidth (arr[4]), GUILayout.MaxHeight (arr[5]) });
int controlID = GUIUtility.GetControlID (FocusType.Passive);
Event currentEvent = Event.current;
EventType currentEventType = currentEvent.GetTypeForControl (controlID);
if (currentEventType == EventType.Repaint)
guiInstance.repaint (r);
else if (currentEvent.isMouse)
guiInstance.handleMouseEvent (currentEventType);
else if (currentEvent.isKey)
guiInstance.handleKeyEvent (currentEventType);
return false;
}
}
#endif
@@ -0,0 +1,46 @@
# ==============================================================================
#
# This file is part of the JUCE framework.
# Copyright (c) Raw Material Software Limited
#
# JUCE is an open source framework subject to commercial or open source
# licensing.
#
# By downloading, installing, or using the JUCE framework, or combining the
# JUCE framework with any other source code, object code, content or any other
# copyrightable work, you agree to the terms of the JUCE End User Licence
# Agreement, and all incorporated terms including the JUCE Privacy Policy and
# the JUCE Website Terms of Service, as applicable, which will bind you. If you
# do not agree to the terms of these agreements, we will not license the JUCE
# framework to you, and you must discontinue the installation or download
# process and cease use of the JUCE framework.
#
# JUCE End User Licence Agreement: https://juce.com/legal/juce-8-licence/
# JUCE Privacy Policy: https://juce.com/juce-privacy-policy
# JUCE Website Terms of Service: https://juce.com/juce-website-terms-of-service/
#
# Or:
#
# You may also use this code under the terms of the AGPLv3:
# https://www.gnu.org/licenses/agpl-3.0.en.html
#
# THE JUCE FRAMEWORK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL
# WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WARRANTY OF
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.
#
# ==============================================================================
find_program(JUCE_XCRUN xcrun)
if(NOT JUCE_XCRUN)
return()
endif()
execute_process(
COMMAND "${JUCE_XCRUN}" codesign --verify "${src}"
RESULT_VARIABLE result)
if(result)
message(STATUS "Replacing invalid signature with ad-hoc signature")
execute_process(COMMAND "${JUCE_XCRUN}" codesign -f -s - "${src}")
endif()
@@ -0,0 +1,45 @@
# ==============================================================================
#
# This file is part of the JUCE framework.
# Copyright (c) Raw Material Software Limited
#
# JUCE is an open source framework subject to commercial or open source
# licensing.
#
# By downloading, installing, or using the JUCE framework, or combining the
# JUCE framework with any other source code, object code, content or any other
# copyrightable work, you agree to the terms of the JUCE End User Licence
# Agreement, and all incorporated terms including the JUCE Privacy Policy and
# the JUCE Website Terms of Service, as applicable, which will bind you. If you
# do not agree to the terms of these agreements, we will not license the JUCE
# framework to you, and you must discontinue the installation or download
# process and cease use of the JUCE framework.
#
# JUCE End User Licence Agreement: https://juce.com/legal/juce-8-licence/
# JUCE Privacy Policy: https://juce.com/juce-privacy-policy
# JUCE Website Terms of Service: https://juce.com/juce-website-terms-of-service/
#
# Or:
#
# You may also use this code under the terms of the AGPLv3:
# https://www.gnu.org/licenses/agpl-3.0.en.html
#
# THE JUCE FRAMEWORK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL
# WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WARRANTY OF
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.
#
# ==============================================================================
if(NOT EXISTS "${src}")
message(STATUS "Unable to copy ${src} as it does not exist")
return()
endif()
get_filename_component(name "${src}" NAME)
if(EXISTS "${dest}/${name}")
message(STATUS "Destination ${dest}/${name} exists, overwriting")
file(REMOVE_RECURSE "${dest}/${name}")
endif()
file(INSTALL ${src} DESTINATION ${dest} USE_SOURCE_PERMISSIONS)
@@ -0,0 +1,45 @@
/*
==============================================================================
This file is part of the JUCE framework.
Copyright (c) Raw Material Software Limited
JUCE is an open source framework subject to commercial or open source
licensing.
By downloading, installing, or using the JUCE framework, or combining the
JUCE framework with any other source code, object code, content or any other
copyrightable work, you agree to the terms of the JUCE End User Licence
Agreement, and all incorporated terms including the JUCE Privacy Policy and
the JUCE Website Terms of Service, as applicable, which will bind you. If you
do not agree to the terms of these agreements, we will not license the JUCE
framework to you, and you must discontinue the installation or download
process and cease use of the JUCE framework.
JUCE End User Licence Agreement: https://juce.com/legal/juce-8-licence/
JUCE Privacy Policy: https://juce.com/juce-privacy-policy
JUCE Website Terms of Service: https://juce.com/juce-website-terms-of-service/
Or:
You may also use this code under the terms of the AGPLv3:
https://www.gnu.org/licenses/agpl-3.0.en.html
THE JUCE FRAMEWORK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL
WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.
==============================================================================
*/
#include <dlfcn.h>
int main (int argc, const char* const* argv)
{
if (argc >= 3)
if (auto* handle = dlopen (argv[1], RTLD_LAZY))
if (auto* function = reinterpret_cast<int (*) (int, const char* const*)> (dlsym (handle, argv[2])))
return function (argc - 3, argv + 3);
return 1;
}
@@ -0,0 +1,90 @@
/*
==============================================================================
This file is part of the JUCE framework.
Copyright (c) Raw Material Software Limited
JUCE is an open source framework subject to commercial or open source
licensing.
By downloading, installing, or using the JUCE framework, or combining the
JUCE framework with any other source code, object code, content or any other
copyrightable work, you agree to the terms of the JUCE End User Licence
Agreement, and all incorporated terms including the JUCE Privacy Policy and
the JUCE Website Terms of Service, as applicable, which will bind you. If you
do not agree to the terms of these agreements, we will not license the JUCE
framework to you, and you must discontinue the installation or download
process and cease use of the JUCE framework.
JUCE End User Licence Agreement: https://juce.com/legal/juce-8-licence/
JUCE Privacy Policy: https://juce.com/juce-privacy-policy
JUCE Website Terms of Service: https://juce.com/juce-website-terms-of-service/
Or:
You may also use this code under the terms of the AGPLv3:
https://www.gnu.org/licenses/agpl-3.0.en.html
THE JUCE FRAMEWORK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL
WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.
==============================================================================
*/
#if defined(_M_ARM64EC)
#error JUCE_ARCH arm64ec
#elif defined(_M_ARM64) || defined(__aarch64__) || defined(__ARM64__)
#error JUCE_ARCH aarch64
#elif (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM == 8) || defined(__ARMv8__) || defined(__ARMv8_A__)
#error JUCE_ARCH armv8l
#elif (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM == 7) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(_ARM_ARCH_7) || defined(__CORE_CORTEXA__)
#error JUCE_ARCH armv7l
#elif (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM == 6) || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6M__)
#error JUCE_ARCH armv6l
#elif (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM == 5) || defined(__ARM_ARCH_5TEJ__)
#error JUCE_ARCH armv5l
#elif defined(__arm__) || defined(_M_ARM)
#error JUCE_ARCH arm
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
#error JUCE_ARCH i386
#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
#error JUCE_ARCH x86_64
#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
#error JUCE_ARCH ia64
#elif defined(__mips) || defined(__mips__) || defined(_M_MRX000)
#if defined(_MIPS_ARCH_MIPS64) || defined(__mips64)
#error JUCE_ARCH mips64
#else
#error JUCE_ARCH mips
#endif
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) || defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) || defined(_M_MPPC) || defined(_M_PPC)
#if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__)
#error JUCE_ARCH ppc64
#else
#error JUCE_ARCH ppc
#endif
#elif defined(__riscv)
#if __riscv_xlen == 64
#error JUCE_ARCH riscv64
#else
#error JUCE_ARCH riscv
#endif
#else
#error JUCE_ARCH unknown
#endif