### Quick Start Example for Gin Source: https://github.com/figbug/gin/blob/master/README.md Demonstrates basic Gin functionalities including asynchronous downloads, file system watching, and spline interpolation. Ensure JUCE is set up for compilation. ```cpp #include // Use the download manager gin::DownloadManager dm; dm.downloadAsync(juce::URL("https://example.com/file.zip"), [](juce::InputStream* stream) { // Process downloaded data }); // Watch a directory for changes gin::FileSystemWatcher watcher; watcher.addFolder(juce::File::getSpecialLocation( juce::File::userDocumentsDirectory)); watcher.addListener(this); // Use a spline for smooth interpolation gin::Spline spline; spline.addPoint({0.0f, 0.0f}); spline.addPoint({1.0f, 1.0f}); float interpolated = spline.get(0.5f); ``` -------------------------------- ### Butterworth Filter Setup and Processing Source: https://github.com/figbug/gin/blob/master/modules/gin_dsp/3rdparty/AudioFilter/readme.md Shows how to configure and process audio using a cascaded Butterworth filter. This example uses ButterworthCreator and FilterInstance for managing filter states and parameters. ```C++ #include "../../audiofilter/src/ButterworthCreator.h" #include "../../audiofilter/src/FilterInstance.h" static constexpr int maxOrder = 8; AudioFilter::BiquadParamCascade bqParams = AudioFilter::BiquadParamCascade(maxOrder); AudioFilter::FilterParamsCascade filterParams = AudioFilter::FilterParamsCascade(maxOrder); AudioFilter::FilterStateCascade filterStates = AudioFilter::FilterStateCascade(maxOrder); AudioFilter::ButterworthCreator bwCreator = AudioFilter::ButterworthCreator(maxOrder); void setFilter(double freq, double q, double gain, size_t order, double sampleRate) { // create biquad params bwCreator.createBandShelf(bqParams, freq, Q, gain, order, sampleRate); // Transform into SVF parameters filterParams.resize(bqParams.size()); for (size_t i = 0; i < bqParams.size(); ++i) filterParams[i].setFromBiquadParams(bqParams[i]); // match state size. filterStates.resize(bqParams.size()); // should also clear previously unused states to avoid glitches. } void process(float* out, const float* in, int numSamples) { AudioFilter::processFilterCascade(filterStates, filterParams, out, in, numSamples); } ``` -------------------------------- ### Build Gin Project Source: https://github.com/figbug/gin/blob/master/README.md Builds the Gin project and its examples using CMake. The executables will be located in the build/examples/ directory. ```bash cd Gin cmake -B build -DCMAKE_BUILD_TYPE=Release cmake --build build ``` -------------------------------- ### Install Target Libraries Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Installs the target library, specifying destinations for archives, libraries, runtime binaries, and setting file permissions. ```cmake install( TARGETS ${target} EXPORT MbedTLSTargets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) ``` -------------------------------- ### Install Package Configuration Files Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/CMakeLists.txt Installs the generated CMake package configuration files (MbedTLSConfig.cmake and MbedTLSConfigVersion.cmake) to the appropriate CMake installation directory. ```cmake install( FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/MbedTLSConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cmake/MbedTLSConfigVersion.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/MbedTLS") ``` -------------------------------- ### Basic Parametric Filter Setup and Processing Source: https://github.com/figbug/gin/blob/master/modules/gin_dsp/3rdparty/AudioFilter/readme.md Demonstrates how to set up parameters for a basic first/second order parametric filter and process audio data. Requires AudioFilter::ParametricCreator and AudioFilter::FilterInstance. ```C++ #include "../../audiofilter/src/ParametricCreator.h" #include "../../audiofilter/src/FilterInstance.h" AudioFilter::FilterParams filterParams; AudioFilter::FilterState filterState; void setFilter(double freq, double q, double gain, AudioFilter::FilterType type, double sampleRate) { // Temporary biquad params AudioFilter::BiquadParam bqParams; // Setup biquad params AudioFilter::ParametricCreator::createMZTiStage(bqParams, freq, gain, Q, type, sampleRate); // Transform into SVF parameters filterParams.setFromBiquadParams(bqParams); } void process(float* out, const float* in, int numSamples) { AudioFilter::processFilter(filterState, filterParams, out, in, numSamples); } ``` -------------------------------- ### Using make for Custom mbedTLS Configuration Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/configs/README.txt This example shows how to use `make` to apply a custom mbedTLS configuration file. It involves setting the include path and defining MBEDTLS_CONFIG_FILE. ```bash CFLAGS="-I$PWD/configs -DMBEDTLS_CONFIG_FILE=''" make ``` -------------------------------- ### Install mbed TLS Headers Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/include/CMakeLists.txt Configures the installation of mbed TLS headers based on the INSTALL_MBEDTLS_HEADERS option. It uses file globbing to find header files and installs them into specific include directories. ```cmake option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON) if(INSTALL_MBEDTLS_HEADERS) file(GLOB headers "mbedtls/*.h") file(GLOB psa_headers "psa/*.h") install(FILES ${headers} DESTINATION include/mbedtls PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) install(FILES ${psa_headers} DESTINATION include/psa PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) endif(INSTALL_MBEDTLS_HEADERS) ``` -------------------------------- ### Install Exported Targets Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/CMakeLists.txt Installs the exported mbedTLS targets file (MbedTLSTargets.cmake) to the CMake installation directory, making them available for other projects. ```cmake install( EXPORT MbedTLSTargets NAMESPACE MbedTLS:: DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/MbedTLS" FILE "MbedTLSTargets.cmake") ``` -------------------------------- ### Using cmake for Custom mbedTLS Configuration Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/configs/README.txt This example demonstrates how to apply a custom mbedTLS configuration file using `cmake`. It first removes existing cmake files, then sets the include path and defines MBEDTLS_CONFIG_CONFIG_FILE before running `cmake` and `make`. ```bash find . -iname '*cmake*' -not -name CMakeLists.txt -exec rm -rf {} + CFLAGS="-I$PWD/configs -DMBEDTLS_CONFIG_FILE=''" cmake . make ``` -------------------------------- ### Run Mbed TLS Tests with Make Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Executes the test suite for Mbed TLS. Requires Python and Perl to be installed. ```bash make check ``` -------------------------------- ### Install Python Requirements for Mbed TLS Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Installs necessary Python packages for Mbed TLS development using pip. Use 'python' instead of 'python3' if needed. Omit '--user' for system-wide installation. ```bash python3 -m pip install --user -r scripts/basic.requirements.txt ``` -------------------------------- ### Configure Target Include Directories Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Sets public and private include directories for a target, including build and install interfaces, and the library directory. ```cmake target_include_directories(${target} PUBLIC $ $ PRIVATE ${MBEDTLS_DIR}/library/ # Needed to include psa_crypto_driver_wrappers.h ${CMAKE_CURRENT_BINARY_DIR}) ``` -------------------------------- ### Using FilterInstance for Higher-Order Butterworth Filters Source: https://github.com/figbug/gin/blob/master/modules/gin_dsp/3rdparty/AudioFilter/readme.md Illustrates using AudioFilter::FilterInstance to manage higher-order Butterworth filters, including state and parameter size matching. This simplifies setup for complex filter configurations. ```C++ #include "../../audiofilter/src/ButterworthCreator.h" #include "../../audiofilter/src/FilterInstance.h" static constexpr int maxOrder = 8; AudioFilter::BiquadParamCascade bqParams = AudioFilter::BiquadParamCascade(maxOrder); AudioFilter::FilterParamsCascade filterParams = AudioFilter::FilterParamsCascade(maxOrder); AudioFilter::FilterStateCascade filterStates = AudioFilter::FilterStateCascade(maxOrder); AudioFilter::ButterworthCreator bwCreator = AudioFilter::ButterworthCreator(maxOrder); AudioFilter::FilterInstance filterInstance = AudioFilter::FilterInstance(1, maxOrder); void setFilter(double freq, double q, double gain, size_t order, AudioFilter::FilterType type, double sampleRate) { // create biquad params bwCreator.createBandShelf(bqParams, freq, Q, gain, order, sampleRate); // Transform into SVF parameters filterInstance.setParams(bqParams); } void process(float* out, const float* in, int numSamples) { // AudioFilter::FilterInstance allows to process multiple channels using the same filter parameters. // The channels are passed as channel array, e.g. float* channelData[numChannels] = { float* channel0, float* channel1 ...}; // Here only one channel is used, thus the reference and const cast. filterInstance.processBlock(&out, const_cast (&in), numSamples); } ``` -------------------------------- ### Set Installation Library Directory Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/CMakeLists.txt Sets the CMake installation directory for libraries to the value of the LIB_INSTALL_DIR variable, if it is defined. ```cmake set(CMAKE_INSTALL_LIBDIR "${LIB_INSTALL_DIR}") ``` -------------------------------- ### Enabling Dithering Source: https://github.com/figbug/gin/blob/master/modules/gin_graphics/3rdparty/avir/README.md To enable dithering, use a specialized template for CImageResizer that includes avir::CImageResizerDithererErrdINL. This example shows dithering for float types. ```cpp typedef avir :: fpclass_def< float, float, avir :: CImageResizerDithererErrdINL< float > > fpclass_dith; avir :: CImageResizer< fpclass_dith > ImageResizer( 8 ); ``` -------------------------------- ### List Available CMake Options Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Displays all available configuration options for the CMake build system. ```bash cmake -LH ``` -------------------------------- ### Link Libraries for Demo Application Source: https://github.com/figbug/gin/blob/master/examples/Demo/CMakeLists.txt Links the Demo application against various gin libraries, JUCE modules, and platform-specific libraries like curl on Linux. Includes recommended JUCE configuration flags. ```cmake target_link_libraries (Demo PRIVATE DemoAssets gin gin_3d gin_graphics gin_gui gin_webp gin_dsp gin_metadata gin_network gin_svg gin_simd juce::juce_cryptography juce::juce_data_structures juce::juce_events juce::juce_graphics juce::juce_gui_basics juce::juce_gui_extra juce::juce_core juce::juce_audio_basics $<$:curl> juce::juce_recommended_config_flags ) ``` -------------------------------- ### Basic Image Resizing Source: https://github.com/figbug/gin/blob/master/modules/gin_graphics/3rdparty/avir/README.md Include the avir header and instantiate CImageResizer. Call resizeImage with input and output buffers, dimensions, and channel count. Adjust the constructor's first argument for the image's true bit resolution. ```cpp #include "avir.h" avir :: CImageResizer<> ImageResizer( 8 ); ImageResizer.resizeImage( InBuf, 640, 480, 0, OutBuf, 1024, 768, 3, 0 ); (multi-threaded operation requires additional coding, see the documentation) ``` -------------------------------- ### Using FilterInstance for Basic Parametric Filters Source: https://github.com/figbug/gin/blob/master/modules/gin_dsp/3rdparty/AudioFilter/readme.md Demonstrates how the AudioFilter::FilterInstance class can also be used for setting up basic parametric filters. This provides a unified interface for different filter types. ```C++ void setFilter(double freq, double q, double gain, AudioFilter::FilterType type, double sampleRate) { // Temporary biquad params AudioFilter::BiquadParam bqParams; // Setup biquad params AudioFilter::ParametricCreator::createMZTiStage(bqParams, freq, gain, Q, type, sampleRate); // Transform into SVF parameters filterInstance.setParams(bqParams); } ``` -------------------------------- ### Build Mbed TLS Library with Make Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Builds the Mbed TLS library and sample programs. This is the primary command for building the library. ```bash make ``` -------------------------------- ### Override CFLAGS for Mbed TLS Build Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Overrides the default CFLAGS for Mbed TLS compilation, for example, to add specific warning options or error flags. ```bash make CFLAGS="-O2 -Werror" ``` -------------------------------- ### Write Basic Package Version File Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/CMakeLists.txt Creates the MbedTLSConfigVersion.cmake file, which specifies the version compatibility for the mbedTLS package. ```cmake write_basic_package_version_file( "cmake/MbedTLSConfigVersion.cmake" COMPATIBILITY SameMajorVersion VERSION 3.6.6) ``` -------------------------------- ### Get Filename Without Last Extension (CMake) Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/CMakeLists.txt A CMake function to extract a filename by removing its last extension. It handles cases with multiple dots in the filename. ```cmake function(get_name_without_last_ext dest_var full_name) # Split into a list on '.' (but a cmake list is just a ';'-separated string) string(REPLACE "." ";" ext_parts "${full_name}") # Remove the last item if there are more than one list(LENGTH ext_parts ext_parts_len) if (${ext_parts_len} GREATER "1") math(EXPR ext_parts_last_item "${ext_parts_len} - 1") list(REMOVE_AT ext_parts ${ext_parts_last_item}) endif() # Convert back to a string by replacing separators with '.' string(REPLACE ";" "." no_ext_name "${ext_parts}") # Copy into the desired variable set(${dest_var} ${no_ext_name} PARENT_SCOPE) endfunction(get_name_without_last_ext) ``` -------------------------------- ### Build static mbedcrypto library Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Creates the static mbedcrypto library using the provided source files and links necessary libraries. ```cmake if(USE_STATIC_MBEDTLS_LIBRARY) add_library(${mbedcrypto_static_target} STATIC ${src_crypto}) set_target_properties(${mbedcrypto_static_target} PROPERTIES OUTPUT_NAME mbedcrypto) target_link_libraries(${mbedcrypto_static_target} PUBLIC ${libs}) if(TARGET ${everest_target}) target_link_libraries(${mbedcrypto_static_target} PUBLIC ${everest_target}) endif() if(TARGET ${p256m_target}) target_link_libraries(${mbedcrypto_static_target} PUBLIC ${p256m_target}) endif() add_library(${mbedx509_static_target} STATIC ${src_x509}) set_target_properties(${mbedx509_static_target} PROPERTIES OUTPUT_NAME mbedx509) target_link_libraries(${mbedx509_static_target} PUBLIC ${libs} ${mbedcrypto_static_target}) add_library(${mbedtls_static_target} STATIC ${src_tls}) set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls) target_link_libraries(${mbedtls_static_target} PUBLIC ${libs} ${mbedx509_static_target}) if(GEN_FILES) add_dependencies(${mbedcrypto_static_target} ${MBEDTLS_TARGET_PREFIX}mbedcrypto_generated_files_target) add_dependencies(${mbedtls_static_target} ${MBEDTLS_TARGET_PREFIX}mbedtls_generated_files_target) endif() endif(USE_STATIC_MBEDTLS_LIBRARY) ``` -------------------------------- ### Add JUCE GUI Application Source: https://github.com/figbug/gin/blob/master/examples/Demo/CMakeLists.txt Defines the main GUI application target using juce_add_gui_app. Includes product details, version, company information, and icons. ```cmake juce_add_gui_app (Demo PRODUCT_NAME Demo VERSION 1.0.0 COMPANY_NAME "Rabien Software" COMPANY_WEBSITE "https://rabien.com/" BUNDLE_ID com.rabien.gin.demo ICON_BIG "${icon_path}" ICON_SMALL "${icon_path}") ``` -------------------------------- ### Define Compile-Time Preprocessor Macros Source: https://github.com/figbug/gin/blob/master/examples/Demo/CMakeLists.txt Sets several preprocessor definitions for the Demo target, controlling JUCE features like modal loops, web browser usage, and namespace settings. ```cmake target_compile_definitions (Demo PRIVATE JUCE_MODAL_LOOPS_PERMITTED=0 JUCE_WEB_BROWSER=0 JUCE_SILENCE_XCODE_15_LINKER_WARNING=1 JUCE_COREGRAPHICS_DRAW_ASYNC=1 DONT_SET_USING_JUCE_NAMESPACE=1 ) ``` -------------------------------- ### Build Mbed TLS for Windows from Unix-like Environment Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Builds Mbed TLS for a Windows target when the build environment is Unix-like, such as when cross-compiling. ```bash make WINDOWS_BUILD=1 ``` -------------------------------- ### Define Configuration File Paths Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/CMakeLists.txt Sets cache variables for MBEDTLS_CONFIG_FILE and MBEDTLS_USER_CONFIG_FILE, allowing users to specify custom configuration files. ```cmake # Make MBEDTLS_CONFIG_FILE and MBEDTLS_USER_CONFIG_FILE into PATHs set(MBEDTLS_CONFIG_FILE "" CACHE FILEPATH "Mbed TLS config file (overrides default).") set(MBEDTLS_USER_CONFIG_FILE "" CACHE FILEPATH "Mbed TLS user config file (appended to default).") ``` -------------------------------- ### Build Mbed TLS with CMake Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Recommended method for building Mbed TLS using CMake in a separate build directory. ```bash mkdir /path/to/build_dir && cd /path/to/build_dir cmake /path/to/mbedtls_source cmake --build . ``` -------------------------------- ### Link Windows specific libraries Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Appends 'ws2_32' and 'bcrypt' to the list of libraries when building on Windows. ```cmake if(WIN32) set(libs ${libs} ws2_32 bcrypt) endif(WIN32) ``` -------------------------------- ### Build shared mbedcrypto library Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Creates the shared mbedcrypto library, setting its version and linking necessary libraries. ```cmake if(USE_SHARED_MBEDTLS_LIBRARY) set(CMAKE_LIBRARY_PATH ${CMAKE_CURRENT_BINARY_DIR}) add_library(${mbedcrypto_target} SHARED ${src_crypto}) set_target_properties(${mbedcrypto_target} PROPERTIES VERSION 3.6.6 SOVERSION 16) target_link_libraries(${mbedcrypto_target} PUBLIC ${libs}) if(TARGET ${everest_target}) target_link_libraries(${mbedcrypto_target} PUBLIC ${everest_target}) endif() if(TARGET ${p256m_target}) target_link_libraries(${mbedcrypto_target} PUBLIC ${p256m_target}) endif() add_library(${mbedx509_target} SHARED ${src_x509}) ``` -------------------------------- ### Platform-Specific Compile Options (Apple) Source: https://github.com/figbug/gin/blob/master/examples/Demo/CMakeLists.txt Applies a comprehensive set of Wall and Wextra compiler warnings for Apple platforms. Includes specific flags for release configurations to treat warnings as errors. ```cmake if (APPLE) target_compile_options(Demo PRIVATE -Wall -Wstrict-aliasing -Wunused-parameter -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wbool-conversion -Wextra-semi -Wunreachable-code -Winconsistent-missing-destructor-override -Wshift-sign-overflow -Wnullable-to-nonnull-conversion -Wuninitialized -Wno-missing-field-initializers -Wno-ignored-qualifiers -Wno-missing-braces -Wno-char-subscripts -Wno-unused-private-field -fno-aligned-allocation -Wunused-private-field -Wunreachable-code -Wenum-compare -Wshadow -Wfloat-conversion -Wshadow-uncaptured-local -Wshadow-field -Wsign-compare -Wdeprecated-this-capture -Wimplicit-float-conversion -ffast-math -fno-finite-math-only -Wfloat-equal -Wpedantic -Wmissing-field-initializers -Wdeprecated -Wcast-align -Wno-implicit-int-float-conversion "$<$:-Werror>" ) endif () ``` -------------------------------- ### Add Pkgconfig Subdirectory Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/CMakeLists.txt Includes the 'pkgconfig' subdirectory in the CMake build process. ```cmake add_subdirectory(pkgconfig) ``` -------------------------------- ### Generate Mbed TLS Files on Windows Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Generates all configuration-independent files for Mbed TLS on Windows using a batch script. ```bash scripts\make_generated_files.bat ``` -------------------------------- ### Run Mbed TLS Tests with CMake Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Command to execute the test suites after building Mbed TLS with CMake. ```bash ctest ``` -------------------------------- ### Configure AppleClang archive creation and finishing Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Sets specific commands for creating and finishing archives when using AppleClang for C compilation. ```cmake if(CMAKE_C_COMPILER_ID MATCHES "AppleClang") set(CMAKE_C_ARCHIVE_CREATE " Scr ") set(CMAKE_C_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") endif() ``` -------------------------------- ### Add Gin Plugin JUCE Module Source: https://github.com/figbug/gin/blob/master/modules/CMakeLists.txt Adds the 'gin_plugin' JUCE module, which is designed for creating audio plugins using the Gin framework. ```cmake juce_add_module(gin_plugin) ``` -------------------------------- ### Add Binary Data to Project Source: https://github.com/figbug/gin/blob/master/examples/Demo/Resources/CMakeLists.txt Uses the `juce_add_binary_data` function to include various binary files (images, SVGs, audio, etc.) as resources within the project. These assets are typically used by the JUCE framework for graphical elements or audio playback. ```cmake set_property (DIRECTORY APPEND PROPERTY LABELS Assets) juce_add_binary_data (DemoAssets SOURCES 1.webp 2.webp ballon_8bit.bmp ballon.bmp Castle.jpg CMakeLists.txt icon.png IMG_1883.JPG Landscape_1.jpg Leaf.jpg mountain.jpg pencils.jpeg SVG_example_markup_grid.svg svg_test_basic.svg svg_test_gradients.svg svg_test_paths.svg svg_test_strokes.svg svg_test_opacity.svg Analog_PWM_Saw_01.wav ) ``` -------------------------------- ### Configure AppleClang archive creation and finishing for C++ Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Sets specific commands for creating and finishing archives when using AppleClang for C++ compilation. ```cmake if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") set(CMAKE_CXX_ARCHIVE_CREATE " Scr ") set(CMAKE_CXX_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") endif() ``` -------------------------------- ### Low-Ringing Performance Resizing Source: https://github.com/figbug/gin/blob/master/modules/gin_graphics/3rdparty/avir/README.md Instantiate CImageResizer with parameters for low-ringing performance by providing an avir::CImageResizerParamsLR object. ```cpp avir :: CImageResizer<> ImageResizer( 8, 0, avir :: CImageResizerParamsLR() ); ``` -------------------------------- ### Add Gin WebP JUCE Module Source: https://github.com/figbug/gin/blob/master/modules/CMakeLists.txt Adds the 'gin_webp' JUCE module, which provides support for loading and displaying WebP image formats. ```cmake juce_add_module(gin_webp) ``` -------------------------------- ### Add Gin DSP JUCE Module Source: https://github.com/figbug/gin/blob/master/modules/CMakeLists.txt Adds the 'gin_dsp' JUCE module, which includes Digital Signal Processing utilities and components for Gin. ```cmake juce_add_module(gin_dsp) ``` -------------------------------- ### JUCE Plugin Target Configuration Source: https://github.com/figbug/gin/blob/master/examples/UnitTests/CMakeLists.txt Defines the UnitTests JUCE plugin target with essential product information and format settings. Use this to set up a new JUCE plugin project. ```cmake set_property (DIRECTORY APPEND PROPERTY LABELS UnitTests) add_subdirectory (Resources) juce_add_plugin (UnitTests PRODUCT_NAME UnitTests VERSION 1.0.0 COMPANY_NAME "Rabien Software" COMPANY_WEBSITE "https://rabien.com/" BUNDLE_ID com.rabien.gin.unittests PLUGIN_MANUFACTURER_CODE Rabi PLUGIN_CODE GnUT FORMATS Standalone NEEDS_MIDI_INPUT FALSE NEEDS_MIDI_OUTPUT FALSE IS_SYNTH FALSE EDITOR_WANTS_KEYBOARD_FOCUS FALSE COPY_PLUGIN_AFTER_BUILD FALSE) ``` -------------------------------- ### Add Gin Location JUCE Module Source: https://github.com/figbug/gin/blob/master/modules/CMakeLists.txt Integrates the 'gin_location' JUCE module, providing location-aware services and functionalities. ```cmake juce_add_module(gin_location) ``` -------------------------------- ### Add Gin Controllers JUCE Module Source: https://github.com/figbug/gin/blob/master/modules/CMakeLists.txt Integrates the 'gin_controllers' JUCE module, enabling controller support and management within your application. ```cmake juce_add_module(gin_controllers) ``` -------------------------------- ### Pass-through MBEDTLS_USER_CONFIG_FILE Definition Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Adds a compile definition for MBEDTLS_USER_CONFIG_FILE if it is set, passing the user configuration file path to the compiler. ```cmake if(MBEDTLS_USER_CONFIG_FILE) target_compile_definitions(${target} PUBLIC MBEDTLS_USER_CONFIG_FILE="${MBEDTLS_USER_CONFIG_FILE}") endif() ``` -------------------------------- ### Add Gin Network JUCE Module Source: https://github.com/figbug/gin/blob/master/modules/CMakeLists.txt Integrates the 'gin_network' JUCE module, providing networking capabilities for Gin applications. ```cmake juce_add_module(gin_network) ``` -------------------------------- ### Generate Mbed TLS Files with Make Target Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Generates all configuration-independent files for Mbed TLS using a specific make target. ```bash make generated_files ``` -------------------------------- ### Add Effect Plugin Configuration Source: https://github.com/figbug/gin/blob/master/examples/Effect/CMakeLists.txt Defines the core properties and formats for the Effect audio plugin using the juce_add_plugin macro. ```cmake juce_add_plugin (Effect PRODUCT_NAME Effect VERSION 1.0.0 COMPANY_NAME "Rabien Software" COMPANY_WEBSITE "https://rabien.com/" FORMATS "VST3" "AU" "Standalone" "LV2" BUNDLE_ID com.rabien.gin.effect PLUGIN_NAME "Effect" DESCRIPTION "Effect" PLUGIN_MANUFACTURER_CODE "Soca" PLUGIN_CODE "Effc" AAX_IDENTIFIER "com.rabien.effect" AU_EXPORT_PREFIX "EffectAU" AU_MAIN_TYPE "kAudioUnitType_Effect" VST2_CATEGORY "kPlugCategEffect" VST3_CATEGORIES Fx LV2URI "https://rabien.com/effect/" COPY_PLUGIN_AFTER_BUILD FALSE ) ``` -------------------------------- ### Add Gin SIMD JUCE Module Source: https://github.com/figbug/gin/blob/master/modules/CMakeLists.txt Integrates the 'gin_simd' JUCE module, which offers Single Instruction, Multiple Data (SIMD) optimizations for performance-critical operations. ```cmake juce_add_module(gin_simd) ``` -------------------------------- ### Check for Git Submodule Initialization Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/CMakeLists.txt Checks if the 'framework/CMakeLists.txt' file exists. If not, it verifies if the project is a Git checkout and provides an error message with instructions to update submodules. Otherwise, it suggests downloading the correct archive. ```cmake if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/framework/CMakeLists.txt") if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") message(FATAL_ERROR "${CMAKE_CURRENT_SOURCE_DIR}CMakeLists.txt not found (and does appear to be a git checkout). Run `git submodule update --init` from the source tree to fetch the submodule contents.") else () message(FATAL_ERROR "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt not found (and does not appear to be a git checkout). Please ensure you have downloaded the right archive from the release page on GitHub.") endif() endif() ``` -------------------------------- ### Create Symbolic Link to Source File Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/CMakeLists.txt A CMake function to create a symbolic link from the binary directory to a file in the source directory. Handles Windows by copying files. ```cmake function(link_to_source base_name) set(link "${CMAKE_CURRENT_BINARY_DIR}/${base_name}") set(target "${CMAKE_CURRENT_SOURCE_DIR}/${base_name}") # Linking to non-existent file is not desirable. At best you will have a # dangling link, but when building in tree, this can create a symbolic link # to itself. if (EXISTS ${target} AND NOT EXISTS ${link}) if (CMAKE_HOST_UNIX) execute_process(COMMAND ln -s ${target} ${link} RESULT_VARIABLE result ERROR_VARIABLE output) if (NOT ${result} EQUAL 0) message(FATAL_ERROR "Could not create symbolic link for: ${target} --> ${output}") endif() else() if (IS_DIRECTORY ${target}) file(GLOB_RECURSE files FOLLOW_SYMLINKS LIST_DIRECTORIES false RELATIVE ${target} "${target}/*") foreach(file IN LISTS files) configure_file("${target}/${file}" "${link}/${file}" COPYONLY) endforeach(file) else() configure_file(${target} ${link} COPYONLY) endif() endif() endif() endfunction(link_to_source) ``` -------------------------------- ### Add Gin GUI JUCE Module Source: https://github.com/figbug/gin/blob/master/modules/CMakeLists.txt Adds the 'gin_gui' JUCE module, which offers components and utilities for building graphical user interfaces with Gin. ```cmake juce_add_module(gin_gui) ``` -------------------------------- ### Build Mbed TLS with Debug Symbols Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Creates a debug build of Mbed TLS by setting the DEBUG environment variable. ```bash export DEBUG=1 make ``` -------------------------------- ### Link Haiku specific libraries Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Appends 'network' to the list of libraries when building on Haiku. ```cmake if(HAIKU) set(libs ${libs} network) endif(HAIKU) ``` -------------------------------- ### Link Sources for Testing in Out-of-Source Builds Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/include/CMakeLists.txt Enables linking of mbed TLS and PSA sources when testing is enabled and the build directory is different from the source directory. This is useful for out-of-source builds. ```cmake # Make mbedtls_config.h available in an out-of-source build. ssl-opt.sh requires it. if (ENABLE_TESTING AND NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) link_to_source(mbedtls) link_to_source(psa) endif() ``` -------------------------------- ### Generate Mbed TLS Files on Unix/POSIX Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Generates all configuration-independent files for Mbed TLS on Unix-like systems using a shell script. ```bash tests/scripts/check-generated-files.sh -u ``` -------------------------------- ### Define Target Sources and Groups Source: https://github.com/figbug/gin/blob/master/examples/Demo/CMakeLists.txt Assigns the found source files to the Demo target and organizes them into a source group for better project structure in IDEs. ```cmake target_sources (Demo PRIVATE ${source_files}) source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR}/Source PREFIX Source FILES ${source_files}) ``` -------------------------------- ### Include JUCE Header Source: https://github.com/figbug/gin/blob/master/README.md Gin integrates seamlessly with JUCE. Ensure the JUCE header is included in your project to access Gin functionalities. ```cpp #include ``` -------------------------------- ### Configure MSVC static runtime option Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Sets an option to build mbedtls libraries with the MSVC /MT (static runtime) flag if enabled. ```cmake if(CMAKE_COMPILER_IS_MSVC) option(MSVC_STATIC_RUNTIME "Build the libraries with /MT compiler flag" OFF) if(MSVC_STATIC_RUNTIME) foreach(flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_CHECK) string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") endforeach(flag_var) endif() endif() ``` -------------------------------- ### Add Framework Subdirectory Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/CMakeLists.txt Includes the 'framework' subdirectory in the CMake build process. ```cmake add_subdirectory(framework) ``` -------------------------------- ### Apple Platform Compile Options Source: https://github.com/figbug/gin/blob/master/examples/UnitTests/CMakeLists.txt Applies specific compiler warnings and flags for the UnitTests target on Apple platforms. Useful for enforcing code quality and catching potential issues during development. ```cmake if (APPLE) target_compile_options(UnitTests PRIVATE -Wall -Wstrict-aliasing -Wunused-parameter -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wbool-conversion -Wextra-semi -Wunreachable-code -Winconsistent-missing-destructor-override -Wshift-sign-overflow -Wnullable-to-nonnull-conversion -Wuninitialized -Wno-missing-field-initializers -Wno-ignored-qualifiers -Wno-missing-braces -Wno-char-subscripts -Wno-unused-private-field -fno-aligned-allocation -Wunused-private-field -Wunreachable-code -Wenum-compare -Wshadow -Wfloat-conversion -Wshadow-uncaptured-local -Wshadow-field -Wsign-compare -Wdeprecated-this-capture -Wimplicit-float-conversion -ffast-math -fno-finite-math-only -Wfloat-equal -Wpedantic -Wmissing-field-initializers -Wdeprecated -Wcast-align -Wno-implicit-int-float-conversion "$<$:-Werror>" ) endif () ``` -------------------------------- ### Pass-through MBEDTLS_CONFIG_FILE Definition Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Adds a compile definition for MBEDTLS_CONFIG_FILE if it is set, passing the configuration file path to the compiler. ```cmake if(MBEDTLS_CONFIG_FILE) target_compile_definitions(${target} PUBLIC MBEDTLS_CONFIG_FILE="${MBEDTLS_CONFIG_FILE}") endif() ``` -------------------------------- ### Generate JUCE Header Source: https://github.com/figbug/gin/blob/master/examples/Demo/CMakeLists.txt Generates the necessary JUCE header file for the Demo application, which is required for JUCE projects. ```cmake juce_generate_juce_header (Demo) ``` -------------------------------- ### Set mbedx509 Target Properties Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Sets the version and SOVERSION for the mbedx509 target and links it with other libraries. ```cmake set_target_properties(${mbedx509_target} PROPERTIES VERSION 3.6.6 SOVERSION 7) target_link_libraries(${mbedx509_target} PUBLIC ${libs} ${mbedcrypto_target}) ``` -------------------------------- ### Add Gin as a Git Submodule Source: https://github.com/figbug/gin/blob/master/README.md Include Gin in your project by adding it as a Git submodule. This command should be run from your project's root directory. ```bash git submodule add https://github.com/FigBug/Gin.git modules/gin ``` -------------------------------- ### Source File Globbing and Grouping Source: https://github.com/figbug/gin/blob/master/examples/UnitTests/CMakeLists.txt Recursively finds all .cpp and .h files in the Source directory and assigns them to the UnitTests target. Organizes source files within the IDE's project tree. ```cmake file (GLOB_RECURSE source_files CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Source/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Source/*.h) target_sources (UnitTests PRIVATE ${source_files}) source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR}/Source PREFIX Source FILES ${source_files}) ``` -------------------------------- ### Build Mbed TLS Shared Libraries Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Builds shared libraries in addition to static libraries by setting the SHARED environment variable. ```bash export SHARED=1 make ``` -------------------------------- ### Add Gin SVG JUCE Module Source: https://github.com/figbug/gin/blob/master/modules/CMakeLists.txt Integrates the 'gin_svg' JUCE module, enabling Scalable Vector Graphics rendering and manipulation within Gin. ```cmake juce_add_module(gin_svg) ``` -------------------------------- ### Configure Package Configuration File Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/CMakeLists.txt Generates the mbedTLS package configuration file (MbedTLSConfig.cmake) from a template. This is used for CMake's find_package mechanism. ```cmake configure_package_config_file( "cmake/MbedTLSConfig.cmake.in" "cmake/MbedTLSConfig.cmake" INSTALL_DESTINATION "cmake") ``` -------------------------------- ### Run Mbed TLS Self-Tests Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Executes a smaller set of self-tests for Mbed TLS. Useful when the full test suite cannot be built. ```bash programs/test/selftest ``` -------------------------------- ### Adding Binary Data to CMake Project Source: https://github.com/figbug/gin/blob/master/examples/UnitTests/Resources/CMakeLists.txt Use juce_add_binary_data to embed various binary file types, such as images and audio, into your project. Ensure the DEMO_RESOURCES_DIR variable is correctly set to the path of your resource files. ```cmake set_property (DIRECTORY APPEND PROPERTY LABELS Assets) # Reference the Demo resources set(DEMO_RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../Demo/Resources") juce_add_binary_data (UnitTestAssets SOURCES ${DEMO_RESOURCES_DIR}/1.webp ${DEMO_RESOURCES_DIR}/2.webp ${DEMO_RESOURCES_DIR}/ballon_8bit.bmp ${DEMO_RESOURCES_DIR}/ballon.bmp ${DEMO_RESOURCES_DIR}/Castle.jpg ${DEMO_RESOURCES_DIR}/icon.png ${DEMO_RESOURCES_DIR}/IMG_1883.JPG ${DEMO_RESOURCES_DIR}/Landscape_1.jpg ${DEMO_RESOURCES_DIR}/Leaf.jpg ${DEMO_RESOURCES_DIR}/mountain.jpg ${DEMO_RESOURCES_DIR}/pencils.jpeg ${DEMO_RESOURCES_DIR}/SVG_example_markup_grid.svg ${DEMO_RESOURCES_DIR}/svg_test_basic.svg ${DEMO_RESOURCES_DIR}/svg_test_gradients.svg ${DEMO_RESOURCES_DIR}/svg_test_paths.svg ${DEMO_RESOURCES_DIR}/svg_test_strokes.svg ${DEMO_RESOURCES_DIR}/svg_test_opacity.svg ${DEMO_RESOURCES_DIR}/Analog_PWM_Saw_01.wav ) ``` -------------------------------- ### Add Gin Metadata JUCE Module Source: https://github.com/figbug/gin/blob/master/modules/CMakeLists.txt Adds the 'gin_metadata' JUCE module, which allows for managing and accessing metadata within the Gin framework. ```cmake juce_add_module(gin_metadata) ``` -------------------------------- ### Link Libraries for Effect Plugin Source: https://github.com/figbug/gin/blob/master/examples/Effect/CMakeLists.txt Links the Effect plugin against gin modules and JUCE libraries. Includes platform-specific linking for Linux. ```cmake target_link_libraries (Effect PRIVATE gin gin_graphics gin_gui gin_dsp gin_plugin gin_simd juce::juce_cryptography juce::juce_data_structures juce::juce_events juce::juce_graphics juce::juce_gui_basics juce::juce_gui_extra juce::juce_core juce::juce_audio_basics $<$:curl> juce::juce_recommended_config_flags ) ``` -------------------------------- ### Add Gin 3D JUCE Module Source: https://github.com/figbug/gin/blob/master/modules/CMakeLists.txt Adds the 'gin_3d' JUCE module, which provides functionalities for 3D graphics within the Gin framework. ```cmake juce_add_module(gin_3d) ``` -------------------------------- ### Check CTR_DRBG 128-bit Key Configuration Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/CMakeLists.txt Executes a Python script to check if 128-bit keys are configured for CTR_DRBG. Displays a warning if the configuration is found. ```cmake if(MBEDTLS_PYTHON_EXECUTABLE) # If 128-bit keys are configured for CTR_DRBG, display an appropriate warning execute_process(COMMAND ${MBEDTLS_PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/config.py -f ${CMAKE_CURRENT_SOURCE_DIR}/include/mbedtls/mbedtls_config.h get MBEDTLS_CTR_DRBG_USE_128_BIT_KEY RESULT_VARIABLE result) if(${result} EQUAL 0) message(WARNING ${CTR_DRBG_128_BIT_KEY_WARNING}) endif() endif() ``` -------------------------------- ### Define main target libraries Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Sets the primary list of target libraries to include mbedcrypto, mbedx509, and mbedtls. ```cmake set(target_libraries ${mbedcrypto_target} ${mbedx509_target} ${mbedtls_target}) ``` -------------------------------- ### Add Gin Graphics JUCE Module Source: https://github.com/figbug/gin/blob/master/modules/CMakeLists.txt Integrates the 'gin_graphics' JUCE module, providing enhanced graphics capabilities for Gin applications. ```cmake juce_add_module(gin_graphics) ``` -------------------------------- ### UnitTests Compile Definitions Source: https://github.com/figbug/gin/blob/master/examples/UnitTests/CMakeLists.txt Sets preprocessor definitions for the UnitTests target, enabling specific JUCE features and project configurations. Crucial for customizing plugin behavior. ```cmake target_compile_definitions (UnitTests PRIVATE JUCE_WEB_BROWSER=0 JUCE_COREGRAPHICS_DRAW_ASYNC=1 GIN_UNIT_TESTS=1 DONT_SET_USING_JUCE_NAMESPACE=1 JucePlugin_Name="UnitTests" JucePlugin_Build_Standalone=1 ) ``` -------------------------------- ### Debug Configuration Handling Source: https://github.com/figbug/gin/blob/master/examples/UnitTests/CMakeLists.txt Determines the current build configuration (debug or release) based on global CMake settings. Used to conditionally apply settings or definitions. ```cmake get_property (debug_configs GLOBAL PROPERTY DEBUG_CONFIGURATIONS) if (NOT debug_configs) set (debug_configs Debug) endif () set (config_is_debug "$,${debug_configs}>") set (config_is_release "$") ``` -------------------------------- ### Configure CMake for Shared Libraries Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Enables the build of shared Mbed TLS libraries using CMake. ```bash cmake -DUSE_SHARED_MBEDTLS_LIBRARY=On /path/to/mbedtls_source ``` -------------------------------- ### Compile Definitions for Effect Plugin Source: https://github.com/figbug/gin/blob/master/examples/Effect/CMakeLists.txt Sets preprocessor definitions for the Effect plugin, controlling various JUCE features and build behaviors. ```cmake target_compile_definitions (Effect PRIVATE JUCE_MODAL_LOOPS_PERMITTED=0 JUCE_COREGRAPHICS_DRAW_ASYNC=1 JUCE_VST3_CAN_REPLACE_VST2=0 JUCE_WEB_BROWSER=0 DONT_SET_USING_JUCE_NAMESPACE=1 JUCE_SILENCE_XCODE_15_LINKER_WARNING=1 ) ``` -------------------------------- ### Linking Libraries for UnitTests Source: https://github.com/figbug/gin/blob/master/examples/UnitTests/CMakeLists.txt Links the UnitTests target against various JUCE libraries, project-specific libraries, and platform-dependent libraries like curl on Linux. Essential for resolving dependencies. ```cmake target_link_libraries (UnitTests PRIVATE UnitTestAssets gin gin_3d gin_dsp gin_graphics gin_gui gin_metadata gin_network gin_plugin gin_svg gin_simd gin_webp juce::juce_audio_processors juce::juce_audio_utils juce::juce_cryptography juce::juce_data_structures juce::juce_events juce::juce_core juce::juce_audio_basics juce::juce_gui_basics juce::juce_gui_extra $<$:curl> juce::juce_recommended_config_flags ) ``` -------------------------------- ### Generate JUCE Header Source: https://github.com/figbug/gin/blob/master/examples/Effect/CMakeLists.txt Generates the necessary JUCE header file for the Effect plugin. ```cmake juce_generate_juce_header (Effect) ``` -------------------------------- ### Source File Recursion Source: https://github.com/figbug/gin/blob/master/examples/Effect/CMakeLists.txt Recursively finds all .cpp, .c, and .h files in the Source directory and its subdirectories for compilation. ```cmake file (GLOB_RECURSE source_files CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Source/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Source/*.c ${CMAKE_CURRENT_SOURCE_DIR}/Source/*.h) target_sources (Effect PRIVATE ${source_files}) source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR}/Source PREFIX Source FILES ${source_files}) ``` -------------------------------- ### Define Debug Configurations Source: https://github.com/figbug/gin/blob/master/examples/Effect/CMakeLists.txt Determines the current debug configurations for the project. ```cmake get_property (debug_configs GLOBAL PROPERTY DEBUG_CONFIGURATIONS) if (NOT debug_configs) set (debug_configs Debug) endif () ``` -------------------------------- ### Add Alias Target for Subdirectory Support Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Creates an ALIAS target for each library in target_libraries to support add_subdirectory. ```cmake add_library(MbedTLS::${target} ALIAS ${target}) ``` -------------------------------- ### Build Mbed TLS from Windows Shell Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Builds Mbed TLS when the build environment is a native Windows shell (e.g., using mingw32-make). Some targets may not be available. ```bash make WINDOWS=1 ``` -------------------------------- ### Set Compiler with CMake Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Specifies the C compiler to be used during the CMake configuration. This must be done during the initial CMake invocation. ```bash CC=your_cc cmake /path/to/mbedtls_source ``` -------------------------------- ### Add Library Subdirectory Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/CMakeLists.txt Includes the 'library' subdirectory in the CMake build process. ```cmake add_subdirectory(library) ``` -------------------------------- ### Skip Mbed TLS Test Build Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/README.md Skips the build process for the Mbed TLS test suite. Allows building the library without tests. ```bash make no_test ``` -------------------------------- ### Configure Image Resizer with SSE SIMD Type Source: https://github.com/figbug/gin/blob/master/modules/gin_graphics/3rdparty/avir/README.md Use this snippet to configure the avir::CImageResizer with the `fpclass_float4` SIMD type for SSE instruction set support. This is suitable for 4-channel image resizing. ```c++ #include "avir_float4_sse.h" avir :: CImageResizer< avir :: fpclass_float4 > ImageResizer( 8 ); ``` -------------------------------- ### Link trusted storage library if enabled Source: https://github.com/figbug/gin/blob/master/modules/gin_network/3rdparty/mbedtls/library/CMakeLists.txt Appends the 'trusted_storage' library to the list of libraries if LINK_WITH_TRUSTED_STORAGE is enabled. ```cmake if(LINK_WITH_TRUSTED_STORAGE) set(libs ${libs} trusted_storage) endif() ```