### CMakeLists.txt for MLT Examples Source: https://github.com/mltframework/mlt/blob/master/src/examples/CMakeLists.txt This CMake script configures the build for MLT examples. It handles finding the MLT library using either pkg-config or find_package and links the 'play' executable against it. Ensure MLT is installed and discoverable by CMake. ```cmake cmake_minimum_required(VERSION 3.14...3.31) project(MLT-examples) option(WITH_PKGCONFIG "Use pkg-config to find MLT" OFF) add_executable(play play.cpp) if(WITH_PKGCONFIG) find_package(PkgConfig REQUIRED) pkg_check_modules(mlt++ REQUIRED IMPORTED_TARGET mlt++-7) target_link_libraries(play PRIVATE PkgConfig::mlt++) else() find_package(Mlt7 REQUIRED COMPONENTS avformat sdl) target_link_libraries(play PRIVATE Mlt7::mlt++) endif() ``` -------------------------------- ### Install MLT Presets and Profiles Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Installs the 'presets' and 'profiles' directories to the MLT installation data directory. ```cmake install(DIRECTORY presets profiles DESTINATION ${MLT_INSTALL_DATA_DIR}) ``` -------------------------------- ### Install mltopenfx Library Source: https://github.com/mltframework/mlt/blob/master/src/modules/openfx/CMakeLists.txt Installs the mltopenfx library to the specified module directory. ```cmake install(TARGETS mltopenfx LIBRARY DESTINATION ${MLT_INSTALL_MODULE_DIR}) ``` -------------------------------- ### MLT Build and Installation Summary Source: https://github.com/mltframework/mlt/blob/master/README.md A consolidated sequence of commands for configuring, building, testing, and installing the MLT framework, keeping the source tree clean. ```bash mkdir build cd build cmake .. cmake --build . source ../setenv ctest --output-on-failure sudo cmake --install . ``` -------------------------------- ### Install MLT Executable Source: https://github.com/mltframework/mlt/blob/master/src/melt/CMakeLists.txt Installs the 'melt' executable to the runtime destination directory. ```cmake install(TARGETS melt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ``` -------------------------------- ### Install MLT Perl Bindings Source: https://github.com/mltframework/mlt/blob/master/src/swig/perl/CMakeLists.txt Installs the mltperl target to the specified Perl module installation directory and installs the mlt.pm file. Ensure PERL_MODULE_INSTALL_DIR is correctly set. ```cmake install(TARGETS mltperl DESTINATION ${PERL_MODULE_INSTALL_DIR}/auto/mlt) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mlt.pm DESTINATION ${PERL_MODULE_INSTALL_DIR}) ``` -------------------------------- ### Install MLT CMake Configuration Files Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Installs the generated MltConfig.cmake and MltConfigVersion.cmake files to the appropriate CMake configuration directory. ```cmake install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Mlt${MLT_VERSION_MAJOR}Config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/Mlt${MLT_VERSION_MAJOR}ConfigVersion.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Mlt${MLT_VERSION_MAJOR} ) ``` -------------------------------- ### Install MLT Framework Source: https://github.com/mltframework/mlt/blob/master/README.md Install the MLT framework using CMake. This command should be executed from within the build directory and may require root privileges. ```bash sudo cmake --install . ``` -------------------------------- ### Initialize MLT and Create Producer in Python Source: https://github.com/mltframework/mlt/blob/master/src/swig/python/python_bindings.dox Import the mlt7 library, initialize the MLT factory, create a profile, and instantiate a producer for a given media file. This is the basic setup for using MLT in Python. ```python import mlt7 as mlt mlt.Factory().init(None) profile = mlt.Profile() producer = mlt.Producer(profile, 'clip.mp4') ``` -------------------------------- ### Install OpenFX YAML Configuration Source: https://github.com/mltframework/mlt/blob/master/src/modules/openfx/CMakeLists.txt Installs the filter_openfx.yml file to the OpenFX data directory. ```cmake install(FILES filter_openfx.yml DESTINATION ${MLT_INSTALL_DATA_DIR}/openfx) ``` -------------------------------- ### Install MLT OpenCV Module Source: https://github.com/mltframework/mlt/blob/master/src/modules/opencv/CMakeLists.txt Installs the mltopencv library and its associated YAML configuration file to the specified MLT installation directories. ```cmake install(TARGETS mltopencv LIBRARY DESTINATION ${MLT_INSTALL_MODULE_DIR}) install(FILES filter_opencv_tracker.yml DESTINATION ${MLT_INSTALL_DATA_DIR}/opencv) ``` -------------------------------- ### Install MLT Rubberband Library Source: https://github.com/mltframework/mlt/blob/master/src/modules/rubberband/CMakeLists.txt Installs the MLT Rubberband library to the specified destination directory. This makes the module available for use after installation. ```cmake install(TARGETS mltrubberband LIBRARY DESTINATION ${MLT_INSTALL_MODULE_DIR}) ``` -------------------------------- ### Install rnnoise Library and Data Files Source: https://github.com/mltframework/mlt/blob/master/src/modules/rnnoise/CMakeLists.txt Installs the mltrnnoise library to the module directory and its associated YAML files to the data directory. ```cmake install(TARGETS mltrnnoise LIBRARY DESTINATION ${MLT_INSTALL_MODULE_DIR}) install(FILES filter_rnnoise.yml link_rnnoise.yml DESTINATION ${MLT_INSTALL_DATA_DIR}/rnnoise) ``` -------------------------------- ### Install MLT SOX Target and Data Files Source: https://github.com/mltframework/mlt/blob/master/src/modules/sox/CMakeLists.txt Installs the mltsox library to the module directory and installs SOX-related YAML files to the data directory. ```cmake install(TARGETS mltsox LIBRARY DESTINATION ${MLT_INSTALL_MODULE_DIR}) install(FILES filter_sox_effect.yml filter_sox.yml DESTINATION ${MLT_INSTALL_DATA_DIR}/sox) ``` -------------------------------- ### Install MLT Man Page on UNIX Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Installs the melt man page on UNIX-like systems and creates a symbolic link for the versioned man page. ```cmake if(UNIX AND NOT APPLE) install(FILES docs/melt.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 RENAME melt-${MLT_VERSION_MAJOR}.1) install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink melt-${MLT_VERSION_MAJOR}.1 melt.1 \ WORKING_DIRECTORY ${CMAKE_INSTALL_FULL_MANDIR}/man1)" ) endif() ``` -------------------------------- ### Install MLT Ruby Library Source: https://github.com/mltframework/mlt/blob/master/src/swig/ruby/CMakeLists.txt Installs the compiled MLT Ruby library to the specified destination within the Ruby vendor directory. This command is used during the installation phase of the build process. ```cmake install(TARGETS mltruby DESTINATION ${CMAKE_INSTALL_LIBDIR}/ruby/vendor_ruby) ``` -------------------------------- ### Configure MLT PHP Extension Build Source: https://github.com/mltframework/mlt/blob/master/src/swig/php/CMakeLists.txt Sets properties for source files, adds the SWIG library for the PHP extension, links necessary libraries, and configures output properties. Installs the extension if PHP_EXTENSION_DIR is defined. ```cmake set_source_files_properties(../mlt.i PROPERTIES USE_TARGET_INCLUDE_DIRECTORIES ON CPLUSPLUS ON) swig_add_library(mltphp LANGUAGE php SOURCES ../mlt.i) target_compile_options(mltphp PRIVATE ${MLT_COMPILE_OPTIONS}) target_link_libraries(mltphp PRIVATE mlt mlt++ PHP::Extension) set_target_properties(mltphp PROPERTIES OUTPUT_NAME "mlt") set_target_properties(mltphp PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/php") if(PHP_EXTENSION_DIR) string(REGEX MATCH "lib.*" PHP_EXTENSION_INSTALL_DIR ${PHP_EXTENSION_DIR}) install(TARGETS mltphp DESTINATION ${PHP_EXTENSION_INSTALL_DIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mlt.php DESTINATION ${PHP_EXTENSION_INSTALL_DIR} OPTIONAL) endif() ``` -------------------------------- ### Install MLT Vorbis Module and Data Source: https://github.com/mltframework/mlt/blob/master/src/modules/vorbis/CMakeLists.txt Installs the MLT Vorbis library to the module directory and its associated YAML file to the data directory. ```cmake install(TARGETS mltvorbis LIBRARY DESTINATION ${MLT_INSTALL_MODULE_DIR}) install(FILES producer_vorbis.yml DESTINATION ${MLT_INSTALL_DATA_DIR}/vorbis) ``` -------------------------------- ### Unix/Linux Post-Install Cleanup Source: https://github.com/mltframework/mlt/blob/master/src/melt/CMakeLists.txt On Unix-like systems (excluding macOS), removes the 'melt' executable after installation. ```cmake if(UNIX AND NOT APPLE) install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E remove melt melt-${MLT_VERSION_MAJOR} WORKING_DIRECTORY \$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR})") endif() ``` -------------------------------- ### Install Rubberband Filter Configuration Source: https://github.com/mltframework/mlt/blob/master/src/modules/rubberband/CMakeLists.txt Installs the filter configuration file for the rubberband pitch filter. This makes the filter definition available to MLT. ```cmake install(FILES filter_rbpitch.yml DESTINATION ${MLT_INSTALL_DATA_DIR}/rubberband) ``` -------------------------------- ### Install MLT Python Bindings Source: https://github.com/mltframework/mlt/blob/master/src/swig/python/CMakeLists.txt Installs the compiled MLT Python module and the generated Python script to the Python site-packages directory. This makes the MLT library available for use in Python projects. ```cmake install(TARGETS mltpython DESTINATION ${PYTHON_MODULE_INSTALL_DIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mlt.py DESTINATION ${PYTHON_MODULE_INSTALL_DIR} RENAME mlt${MLT_VERSION_MAJOR}.py ) ``` -------------------------------- ### Determine Perl Module Installation Directory Source: https://github.com/mltframework/mlt/blob/master/src/swig/perl/CMakeLists.txt Uses a regular expression to match and set the PERL_MODULE_INSTALL_DIR based on PERL_VENDORARCH. This is crucial for correct module installation. ```cmake string(REGEX MATCH "lib.*" PERL_MODULE_INSTALL_DIR ${PERL_VENDORARCH}) ``` -------------------------------- ### Unix/Linux Post-Install Rename and Symlink Source: https://github.com/mltframework/mlt/blob/master/src/melt/CMakeLists.txt On Unix-like systems (excluding macOS), renames the installed 'melt' executable to 'melt-' and creates a symlink from 'melt' to 'melt-'. ```cmake if(UNIX AND NOT APPLE) install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E rename melt melt-${MLT_VERSION_MAJOR} WORKING_DIRECTORY \$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR})") install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink melt-${MLT_VERSION_MAJOR} melt WORKING_DIRECTORY \$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR})") endif() ``` -------------------------------- ### Test MLT Tools Without Installation Source: https://github.com/mltframework/mlt/blob/master/README.md Source the setenv script and run ctest from the build directory to execute MLT tools without installing them. This command applies to the current shell only. ```bash source ../setenv ctest --output-on-failure ``` -------------------------------- ### Set MLT Subdirectory Name Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Determines the subdirectory name for MLT installation based on the operating system. It defaults to 'mlt' but changes for non-Windows and non-Apple systems. ```cmake set(MLT_SUBDIR mlt) if(NOT (WIN32 OR APPLE)) set(MLT_SUBDIR mlt-${MLT_VERSION_MAJOR}) set(MLT_SUBDIR mlt-${MLT_VERSION_MAJOR}) endif() ``` -------------------------------- ### Configure RPATH Handling in CMake Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Sets CMake variables to control how RPATH is handled during the build and installation process. This ensures libraries are found at runtime. ```cmake set(CMAKE_SKIP_BUILD_RPATH FALSE) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) if(NOT "${isSystemDir}" STREQUAL "-1") set(CMAKE_INSTALL_RPATH "") endif() ``` -------------------------------- ### Configure MLT Build with CMake Source: https://github.com/mltframework/mlt/blob/master/README.md Create a build directory, navigate into it, and run CMake to configure the build process. This command is executed from within the build directory. ```bash mkdir -p build cd build cmake .. ``` -------------------------------- ### Compile MLT with Ninja and Reduced Parallelism Source: https://github.com/mltframework/mlt/blob/master/README.md Build the MLT project using Ninja, utilizing one less CPU core than available. Recommended for systems with many cores. ```bash ninja -j $(($(nproc) - 1)) ``` -------------------------------- ### Conditional Configuration for GPL and PkgConfig::glib Source: https://github.com/mltframework/mlt/blob/master/src/modules/openfx/CMakeLists.txt Configures the mltopenfx target with specific options, includes, and libraries when GPL is enabled and PkgConfig::glib is found. Includes generating an export header. ```cmake if(GPL AND TARGET PkgConfig::glib) include(GenerateExportHeader) generate_export_header(mltopenfx) target_compile_options(mltopenfx PRIVATE ${MLT_COMPILE_OPTIONS}) target_include_directories(mltopenfx PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(mltopenfx PRIVATE mlt PkgConfig::glib ${CMAKE_DL_LIBS} Threads::Threads) target_include_directories(mltopenfx PRIVATE openfx/include) if(MSVC) target_link_libraries(mltopenfx PRIVATE dirent PThreads4W::PThreads4W) else() target_link_libraries(mltopenfx PRIVATE m) endif() if(OpenMP_C_FOUND) target_link_libraries(mltopenfx PRIVATE OpenMP::OpenMP_C) endif() endif() ``` -------------------------------- ### Configure Fast Math Options for Release Builds Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Applies fast math optimization flags for Release builds. Uses '/fp:fast' for MSVC and '-ffast-math' for GNU/Clang compilers to potentially improve performance at the cost of precision. ```cmake if(MSVC) list(APPEND MLT_COMPILE_OPTIONS "<$:/fp:fast>") elseif(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") list(APPEND MLT_COMPILE_OPTIONS "<$:-ffast-math>") endif() ``` -------------------------------- ### Enable Hardware Acceleration and Audio in Dev Container Source: https://github.com/mltframework/mlt/blob/master/README.md Modify devcontainer.json to uncomment '--ipc=host' and '--privileged' for full GPU and audio access. This requires rebuilding the container. ```json "--ipc=host", "--privileged" ``` -------------------------------- ### Check for libexif using PkgConfig Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Checks for the libexif library using PkgConfig, which is required for handling EXIF metadata in image files. This is enabled if MOD_QT6 or MOD_GDK is active. ```cmake if(MOD_QT6 OR MOD_GDK) pkg_check_modules(libexif IMPORTED_TARGET libexif) endif() ``` -------------------------------- ### Compile MLT with Ninja Source: https://github.com/mltframework/mlt/blob/master/README.md Build the MLT project using Ninja after configuration. This command is executed from within the build directory. ```bash ninja ``` -------------------------------- ### Add Basic Qt Tests Source: https://github.com/mltframework/mlt/blob/master/src/tests/CMakeLists.txt Adds several standard Qt tests to the build. These tests cover various functionalities like animation, audio, events, and more. ```cmake add_qt_test(TEST_NAME animation) add_qt_test(TEST_NAME audio) add_qt_test(TEST_NAME events) add_qt_test(TEST_NAME filter) add_qt_test(TEST_NAME frame) add_qt_test(TEST_NAME image) add_qt_test(TEST_NAME multitrack) add_qt_test(TEST_NAME playlist) add_qt_test(TEST_NAME producer) add_qt_test(TEST_NAME properties) add_qt_test(TEST_NAME repository) add_qt_test(TEST_NAME service) add_qt_test(TEST_NAME tractor) add_qt_test(TEST_NAME xml) ``` -------------------------------- ### Compile MLT with CMake and Reduced Parallelism Source: https://github.com/mltframework/mlt/blob/master/README.md Build the MLT project using CMake, utilizing one less CPU core than available. Recommended for systems with many cores. ```bash cmake --build . --parallel $(($(nproc) - 1)) ``` -------------------------------- ### Set Compile Options and Link Libraries Source: https://github.com/mltframework/mlt/blob/master/src/swig/csharp/CMakeLists.txt Configures compile options and links necessary libraries for the C# binding target. ```cmake target_compile_options(mltsharp PRIVATE ${MLT_COMPILE_OPTIONS}) ``` ```cmake target_link_libraries(mltsharp PRIVATE mlt mlt++) ``` -------------------------------- ### Run MLT with ALSA Audio Driver Source: https://github.com/mltframework/mlt/blob/master/README.md Temporarily switch the audio driver to ALSA for MLT tools by setting the SDL_AUDIODRIVER environment variable before execution. ```bash SDL_AUDIODRIVER=alsa melt video.mp4 ``` -------------------------------- ### Find Standard Libraries Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Finds essential system libraries like Threads and PkgConfig. PkgConfig is used to check for other dependencies. ```cmake find_package(Threads REQUIRED) find_package(PkgConfig REQUIRED) ``` -------------------------------- ### Configure JACK, GLib, XML, and LADSPA for JACKRACK Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Finds JACK audio connection kit, GLib, libxml2, and checks for the presence of 'ladspa.h' if MOD_JACKRACK is enabled. It also conditionally disables LV2 and VST2 support if LADSPA headers are not found. ```cmake if(MOD_JACKRACK) find_package(JACK) pkg_check_modules(glib IMPORTED_TARGET glib-2.0) pkg_check_modules(xml IMPORTED_TARGET libxml-2.0) check_include_file(ladspa.h ladspa_h_FOUND) if(NOT ladspa_h_FOUND) set(USE_LV2 OFF) set(USE_VST2 OFF) endif() list(APPEND MLT_SUPPORTED_COMPONENTS jackrack) endif() ``` -------------------------------- ### Set Target Properties Source: https://github.com/mltframework/mlt/blob/master/src/swig/lua/CMakeLists.txt Configures output name and library output directory for the target. ```cmake set_target_properties(mltlua PROPERTIES OUTPUT_NAME "mlt") ``` ```cmake set_target_properties(mltlua PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lua") ``` -------------------------------- ### Check for Lilv Library for LV2 Support Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Checks for the Lilv library (version 0) using PkgConfig if USE_LV2 is enabled. If Lilv is not found, USE_LV2 is disabled, preventing LV2 plugin support. ```cmake if(USE_LV2) pkg_check_modules(lilv IMPORTED_TARGET lilv-0) if(NOT lilv_FOUND) set(USE_LV2 OFF) endif() endif() ``` -------------------------------- ### Set Compile Options and Include Directories Source: https://github.com/mltframework/mlt/blob/master/src/modules/sox/CMakeLists.txt Applies private compile options and sets private include directories for the mltsox target. ```cmake target_compile_options(mltsox PRIVATE ${MLT_COMPILE_OPTIONS}) target_include_directories(mltsox PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) ``` -------------------------------- ### Set Compile Options and Include Directories Source: https://github.com/mltframework/mlt/blob/master/src/modules/rubberband/CMakeLists.txt Configures compile-time options and include directories for the MLT Rubberband module. Ensures necessary flags and paths are set for compilation. ```cmake target_compile_options(mltrubberband PRIVATE ${MLT_COMPILE_OPTIONS}) target_include_directories(mltrubberband PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) ``` -------------------------------- ### Find Iconv and dlopen for Windows Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Locates the Iconv library and handles the dynamic linking library (dlopen) for Windows builds, including MinGW. It ensures that cross-platform compatibility for character encoding and dynamic loading is available. ```cmake if(WIN32) find_package(Iconv REQUIRED) if(NOT CMAKE_DL_LIBS) find_package(dlfcn-win32 REQUIRED) set(CMAKE_DL_LIBS dlfcn-win32::dl) endif() if(MINGW) string(REPLACE "iconv" "pthread" MLT_PTHREAD_LIBS "${Iconv_LIBRARY}") endif() endif() ``` -------------------------------- ### Generate Java Bindings with SWIG Source: https://github.com/mltframework/mlt/blob/master/src/swig/java/CMakeLists.txt Generates Java bindings for the MLT library using SWIG. Ensure the SWIG interface file and output directory are correctly specified. ```cmake swig_add_library(mltjava LANGUAGE java OUTPUT_DIR src_swig SOURCES ../mlt.i) ``` -------------------------------- ### Link Libraries Source: https://github.com/mltframework/mlt/blob/master/src/melt/CMakeLists.txt Links the 'melt' executable with essential libraries, including MLT, Threads, and optionally SDL2. ```cmake target_link_libraries(melt PRIVATE mlt Threads::Threads) ``` -------------------------------- ### Compile MLT with CMake Source: https://github.com/mltframework/mlt/blob/master/README.md Build the MLT project using CMake after configuration. This command is executed from within the build directory. ```bash cmake --build . ``` -------------------------------- ### Configure MLT Node.js SWIG Library Source: https://github.com/mltframework/mlt/blob/master/src/swig/nodejs/CMakeLists.txt Sets properties for source files and adds a SWIG library for Node.js bindings. Ensure MLT_COMPILE_OPTIONS and NODEJS_INCLUDE_DIRS are defined in your CMake environment. ```cmake set_source_files_properties(../mlt.i PROPERTIES USE_TARGET_INCLUDE_DIRECTORIES ON CPLUSPLUS ON) swig_add_library(mltnodejs LANGUAGE javascript SOURCES ../mlt.i) target_compile_options(mltnodejs PRIVATE ${MLT_COMPILE_OPTIONS}) target_link_libraries(mltnodejs PRIVATE mlt mlt++) target_include_directories(mltnodejs PRIVATE ${NODEJS_INCLUDE_DIRS}) set_target_properties(mltnodejs PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/nodejs") ``` -------------------------------- ### Configure MLT Python Bindings Source: https://github.com/mltframework/mlt/blob/master/src/swig/python/CMakeLists.txt Sets properties for source files, adds a SWIG library for Python, configures compile options and link libraries, and sets target properties for the output. This is used to build the Python bindings for the MLT framework. ```cmake set_source_files_properties(../mlt.i PROPERTIES USE_TARGET_INCLUDE_DIRECTORIES ON CPLUSPLUS ON) swig_add_library(mltpython LANGUAGE python SOURCES ../mlt.i) target_compile_options(mltpython PRIVATE ${MLT_COMPILE_OPTIONS}) target_link_libraries(mltpython PRIVATE mlt mlt++ Python3::Module) set_target_properties(mltpython PROPERTIES PREFIX "_" OUTPUT_NAME "mlt${MLT_VERSION_MAJOR}") set_target_properties(mltpython PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/python") string(REGEX MATCH "[lL]ib.*" PYTHON_MODULE_INSTALL_DIR ${Python3_SITEARCH}) if(SWIG_VERSION VERSION_GREATER_EQUAL "4.0.0") set_property(TARGET mltpython PROPERTY SWIG_COMPILE_OPTIONS -doxygen) endif() ``` -------------------------------- ### MinGW Console Link Option Source: https://github.com/mltframework/mlt/blob/master/src/melt/CMakeLists.txt Applies the '-mconsole' link option for MinGW builds. ```cmake if(MINGW) target_link_options(melt PRIVATE -mconsole) endif() ``` -------------------------------- ### Configure MLT OpenCV Module Compile Options and Libraries Source: https://github.com/mltframework/mlt/blob/master/src/modules/opencv/CMakeLists.txt Sets compile options, include directories, and links necessary libraries for the mltopencv module. Includes conditional linking for MSVC. ```cmake target_compile_options(mltopencv PRIVATE ${MLT_COMPILE_OPTIONS}) target_include_directories(mltopencv PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(mltopencv PRIVATE mlt ${OpenCV_LIBS}) if(MSVC) target_link_libraries(mltopencv PRIVATE PThreads4W::PThreads4W) endif() ``` -------------------------------- ### Set Library Output Directory Source: https://github.com/mltframework/mlt/blob/master/src/modules/openfx/CMakeLists.txt Sets the output directory for the mltopenfx library. ```cmake set_target_properties(mltopenfx PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${MLT_MODULE_OUTPUT_DIRECTORY}") ``` -------------------------------- ### Configure MLT Vorbis Compile Options and Directories Source: https://github.com/mltframework/mlt/blob/master/src/modules/vorbis/CMakeLists.txt Sets private compile options and include directories for the MLT Vorbis module. ```cmake target_compile_options(mltvorbis PRIVATE ${MLT_COMPILE_OPTIONS}) target_include_directories(mltvorbis PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) ``` -------------------------------- ### Configure MLT Build with CMake and Ninja Source: https://github.com/mltframework/mlt/blob/master/README.md Configure the MLT build using CMake with the Ninja generator. This command is executed from within the build directory. ```bash cmake -G Ninja .. ``` -------------------------------- ### Create MLT Data Directory and Symlinks (Unix-like) Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Creates the MLT data directory and symbolic links for modules, presets, and profiles on non-Windows systems. This is used when the data output directory does not exist. ```cmake file(MAKE_DIRECTORY "${MLT_DATA_OUTPUT_DIRECTORY}") file(GLOB MOD_SUBDIRS "${CMAKE_SOURCE_DIR}/src/modules/*") foreach(MOD_SUBDIR ${MOD_SUBDIRS}) file(RELATIVE_PATH MOD_NAME "${CMAKE_SOURCE_DIR}/src/modules" ${MOD_SUBDIR}) file(CREATE_LINK "${CMAKE_SOURCE_DIR}/src/modules/${MOD_NAME}" "${MLT_DATA_OUTPUT_DIRECTORY}/${MOD_NAME}" SYMBOLIC) endforeach() file(CREATE_LINK "${CMAKE_SOURCE_DIR}/presets" "${MLT_DATA_OUTPUT_DIRECTORY}/presets" SYMBOLIC) file(CREATE_LINK "${CMAKE_SOURCE_DIR}/profiles" "${MLT_DATA_OUTPUT_DIRECTORY}/profiles" SYMBOLIC) ``` -------------------------------- ### Set Target Include Directories Source: https://github.com/mltframework/mlt/blob/master/src/swig/lua/CMakeLists.txt Adds include directories for the target library, specifically for Lua headers. ```cmake target_include_directories(mltlua PRIVATE ${LUA_INCLUDE_DIR}) ``` -------------------------------- ### Set Compile Options and Include Directories for rnnoise Source: https://github.com/mltframework/mlt/blob/master/src/modules/rnnoise/CMakeLists.txt Applies private compile options and sets private include directories for the mltrnnoise target. ```cmake target_compile_options(mltrnnoise PRIVATE ${MLT_COMPILE_OPTIONS}) target_include_directories(mltrnnoise PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) ``` -------------------------------- ### Check for Frei0r using PkgConfig Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Checks for the Frei0r plugin SDK using PkgConfig if the MOD_FREI0R module is enabled. This allows MLT to use Frei0r video effects. ```cmake if(MOD_FREI0R) pkg_check_modules(FREI0R REQUIRED frei0r) list(APPEND MLT_SUPPORTED_COMPONENTS frei0r) endif() ``` -------------------------------- ### Configure Source File Properties Source: https://github.com/mltframework/mlt/blob/master/src/swig/csharp/CMakeLists.txt Sets properties for source files, enabling specific build features like include directories and C++ compilation. ```cmake set_source_files_properties(../mlt.i PROPERTIES USE_TARGET_INCLUDE_DIRECTORIES ON CPLUSPLUS ON) ``` -------------------------------- ### Configure Package Configuration File Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Generates the MltConfig.cmake and MltConfigVersion.cmake files, essential for CMake's package management system. ```cmake include(CMakePackageConfigHelpers) configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/MltConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/Mlt${MLT_VERSION_MAJOR}Config.cmake" INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Mlt${MLT_VERSION_MAJOR} NO_CHECK_REQUIRED_COMPONENTS_MACRO ) write_basic_package_version_file( "${CMAKE_CURRENT_BINARY_DIR}/Mlt${MLT_VERSION_MAJOR}ConfigVersion.cmake" COMPATIBILITY SameMajorVersion ) ``` -------------------------------- ### MinGW Specific SDL2 Configuration Source: https://github.com/mltframework/mlt/blob/master/src/melt/CMakeLists.txt Configures MinGW-specific linking and defines 'main=SDL_main' when using SDL2. ```cmake if(MINGW) target_link_libraries(melt PRIVATE ${MLT_PTHREAD_LIBS}) target_compile_definitions(melt PRIVATE main=SDL_main) target_link_libraries(melt PRIVATE mingw32 SDL2main SDL2) endif() ``` -------------------------------- ### Add SWIG Library for MLT TCL Bindings Source: https://github.com/mltframework/mlt/blob/master/src/swig/tcl/CMakeLists.txt Generates a Tcl library using SWIG for MLT, specifying the source interface file and language. Private compile options and library linking are also configured. ```cmake swig_add_library(mlttcl LANGUAGE tcl SOURCES ../mlt.i) target_compile_options(mlttcl PRIVATE ${MLT_COMPILE_OPTIONS}) target_link_libraries(mlttcl PRIVATE mlt mlt++) target_include_directories(mlttcl PRIVATE ${TCL_INCLUDE_PATH}) ``` -------------------------------- ### Set Compile Definitions Source: https://github.com/mltframework/mlt/blob/master/src/melt/CMakeLists.txt Defines preprocessor macros for the 'melt' target, such as the MLT version. ```cmake target_compile_definitions(melt PRIVATE VERSION="${MLT_VERSION}") ``` -------------------------------- ### Add SWIG Library for C# Bindings Source: https://github.com/mltframework/mlt/blob/master/src/swig/csharp/CMakeLists.txt Adds a SWIG-generated library for C# bindings, specifying the output directory and source interface file. ```cmake swig_add_library(mltsharp LANGUAGE csharp OUTPUT_DIR src_swig SOURCES ../mlt.i) ``` -------------------------------- ### Set Compile Options Source: https://github.com/mltframework/mlt/blob/master/src/melt/CMakeLists.txt Applies specific compile options to the 'melt' target. ```cmake target_compile_options(melt PRIVATE ${MLT_COMPILE_OPTIONS}) ``` -------------------------------- ### Define mltopenfx Library Source: https://github.com/mltframework/mlt/blob/master/src/modules/openfx/CMakeLists.txt Defines the mltopenfx library with its source files. ```cmake add_library(mltopenfx MODULE factory.c mlt_openfx.c mlt_openfx.h filter_openfx.c ) ``` -------------------------------- ### Add MLT Source Subdirectory Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Includes the 'src' subdirectory, which likely contains the main source code for the MLT framework. ```cmake add_subdirectory(src) ``` -------------------------------- ### Add Static Library in CMake Source: https://github.com/mltframework/mlt/blob/master/src/msvc/CMakeLists.txt Defines a static library named 'msvccompat' using source files from the current directory. This is useful for creating reusable code modules. ```cmake add_library(msvccompat STATIC libgen.c gettimeofday.c) ``` -------------------------------- ### Find GdkPixbuf and Optional Dependencies Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Locates GdkPixbuf and optionally Pango/PangoFT2 if the MOD_GDK module is enabled. GdkPixbuf is used for image loading and manipulation within the GNOME desktop environment. ```cmake if(MOD_GDK) pkg_check_modules(GdkPixbuf REQUIRED IMPORTED_TARGET gdk-pixbuf-2.0) # Optional deps pkg_check_modules(pango IMPORTED_TARGET pango) pkg_check_modules(pangoft2 IMPORTED_TARGET pangoft2) list(APPEND MLT_SUPPORTED_COMPONENTS gdk) endif() ``` -------------------------------- ### Add Ruby Library Binding with SWIG Source: https://github.com/mltframework/mlt/blob/master/src/swig/ruby/CMakeLists.txt Generates a Ruby library binding for MLT using SWIG. Ensure the SWIG interface file (mlt.i) is correctly specified. This command is essential for integrating MLT with Ruby applications. ```cmake swig_add_library(mltruby LANGUAGE ruby SOURCES ../mlt.i) ``` -------------------------------- ### Add Qt Test with Custom Source Files Source: https://github.com/mltframework/mlt/blob/master/src/tests/CMakeLists.txt Adds a specific Qt test for the 'mod_qt_gps' module, including custom source files. This is enabled only if the MOD_QT6 option is set. ```cmake if(MOD_QT6) add_qt_test( TEST_NAME mod_qt_gps SOURCE_FILES "${CMAKE_SOURCE_DIR}/src/modules/qt/gps_parser.h" "${CMAKE_SOURCE_DIR}/src/modules/qt/gps_parser.cpp" ) endif() ``` -------------------------------- ### Find libebur128 and Add Plus Component Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Locates the libebur128 library for EBU R128 loudness calculations and adds 'plus' to supported components if MOD_PLUS is enabled. This is likely for audio loudness metering. ```cmake if(MOD_PLUS) pkg_check_modules(libebur128 IMPORTED_TARGET libebur128) list(APPEND MLT_SUPPORTED_COMPONENTS plus) endif() ``` -------------------------------- ### Find SDL2 Library Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Locates the SDL2 library, which is commonly used for multimedia applications, including input, audio, and graphics. ```cmake find_package(SDL2) ``` -------------------------------- ### Define MLT Executable Source: https://github.com/mltframework/mlt/blob/master/src/melt/CMakeLists.txt Defines the main executable target 'melt' and lists its source files. ```cmake add_executable(melt melt.c io.c io.h) ``` -------------------------------- ### Add SWIG Library Source: https://github.com/mltframework/mlt/blob/master/src/swig/lua/CMakeLists.txt Adds a SWIG-generated library for Lua bindings, specifying the interface file and language. ```cmake swig_add_library(mltlua LANGUAGE lua SOURCES ../mlt.i) ``` -------------------------------- ### Define C Standard for Compilation Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Sets the C standard to C11, ensuring it's required and extensions are enabled for the project. ```cmake set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_C_EXTENSIONS ON) ``` -------------------------------- ### Add Glaxnimate Module for Qt6 Source: https://github.com/mltframework/mlt/blob/master/src/modules/glaxnimate/CMakeLists.txt Conditionally calls the `mlt_add_glaxnimate_module` function to add the Glaxnimate module with Qt6, specifying the target name, Qt version, and data directory. ```cmake if(MOD_GLAXNIMATE_QT6) mlt_add_glaxnimate_module(mltglaxnimate-qt6 QT_VERSION 6 DATADIR glaxnimate-qt6) endif() ``` -------------------------------- ### Add Custom Build Command for C# DLL Source: https://github.com/mltframework/mlt/blob/master/src/swig/csharp/CMakeLists.txt Adds a post-build custom command to compile C# source files into a DLL using the 'mcs' compiler. ```cmake add_custom_command(TARGET mltsharp POST_BUILD COMMAND mcs -out:mlt-sharp.dll -target:library src_swig/*.cs WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) ``` -------------------------------- ### Copy MLT Data Directory and Files (Windows) Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Copies MLT data files (modules, presets, profiles) to the output directory on Windows systems. This handles symlink limitations on Windows. ```cmake file(COPY "${CMAKE_SOURCE_DIR}/src/modules" DESTINATION "${CMAKE_BINARY_DIR}/out/share" FILES_MATCHING REGEX yml|txt) file(RENAME "${CMAKE_BINARY_DIR}/out/share/modules" "${MLT_DATA_OUTPUT_DIRECTORY}") file(COPY "${CMAKE_SOURCE_DIR}/presets" DESTINATION "${MLT_DATA_OUTPUT_DIRECTORY}") file(COPY "${CMAKE_SOURCE_DIR}/profiles" DESTINATION "${MLT_DATA_OUTPUT_DIRECTORY}") ``` -------------------------------- ### Set Target Properties for C# Library Source: https://github.com/mltframework/mlt/blob/master/src/swig/csharp/CMakeLists.txt Specifies the output directory for the C# library, ensuring it's placed correctly within the build artifacts. ```cmake set_target_properties(mltsharp PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/csharp") ``` -------------------------------- ### Glob YAML files for rnnoise Source: https://github.com/mltframework/mlt/blob/master/src/modules/rnnoise/CMakeLists.txt Finds all .yml files in the current directory and adds them as sources for a custom target. ```cmake file(GLOB YML "*.yml") add_custom_target(Other_rnnoise_Files SOURCES ${YML}) ``` -------------------------------- ### Find Movit, OpenGL, and X11 for Movit Module Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Locates the Movit library, OpenGL, and X11 (on non-Apple Unix systems) if the MOD_MOVIT module is enabled. Movit is a video processing library. ```cmake if(MOD_MOVIT) pkg_check_modules(movit REQUIRED IMPORTED_TARGET movit) find_package(OpenGL REQUIRED) if(UNIX AND NOT APPLE) find_package(X11 REQUIRED) endif() list(APPEND MLT_SUPPORTED_COMPONENTS movit) endif() ``` -------------------------------- ### Find FFmpeg Components Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Locates the necessary FFmpeg libraries (AVFormat, SWScale, AVUtil, AVCodec, AVFilter, AVDevice, SWResample) if the MOD_AVFORMAT module is enabled. This is crucial for multimedia file handling and processing. ```cmake if(MOD_AVFORMAT) find_package(FFmpeg REQUIRED COMPONENTS AVFORMAT SWSCALE AVUTIL AVCODEC AVFILTER AVDEVICE SWRESAMPLE ) list(APPEND MLT_SUPPORTED_COMPONENTS avformat) endif() ``` -------------------------------- ### Set Public Include Directories in CMake Source: https://github.com/mltframework/mlt/blob/master/src/msvc/CMakeLists.txt Configures the 'msvccompat' target to include headers from the current source directory. This ensures that the library can find its necessary header files. ```cmake target_include_directories(msvccompat PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) ``` -------------------------------- ### Define C++ Standard and Requirements Source: https://github.com/mltframework/mlt/blob/master/src/modules/glaxnimate/CMakeLists.txt Sets the C++ standard to C++17 and ensures it's required for the project. Also includes the current directory for includes. ```cmake set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) ``` -------------------------------- ### Add MLT Perl Library with SWIG Source: https://github.com/mltframework/mlt/blob/master/src/swig/perl/CMakeLists.txt Generates Perl bindings for the MLT library using SWIG. This requires the MLT interface file and specifies the language as perl. ```cmake swig_add_library(mltperl LANGUAGE perl SOURCES ../mlt.i) ``` -------------------------------- ### Add Feature Information Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Registers information about various features and modules of the MLT framework, likely for build system introspection or documentation generation. ```cmake add_feature_info("GPLv2" GPL "") add_feature_info("GPLv3" GPL3 "") add_feature_info("Tests" BUILD_TESTING "") add_feature_info("Doxygen" BUILD_DOCS "") add_feature_info("Clang Format" CLANG_FORMAT "") add_feature_info("Module: avformat" MOD_AVFORMAT "") add_feature_info("Module: DeckLink" MOD_DECKLINK "") add_feature_info("Module: Frei0r" MOD_FREI0R "") add_feature_info("Module: GDK" MOD_GDK "") add_feature_info("Module: Glaxnimate (Qt6)" MOD_GLAXNIMATE_QT6 "") add_feature_info("Module: JACKRack" MOD_JACKRACK "") add_feature_info("Module: Kdenlive" MOD_KDENLIVE "") add_feature_info("Module: Movit" MOD_MOVIT "") add_feature_info("Module: NDI" MOD_NDI "") add_feature_info("Module: Normalize" MOD_NORMALIZE "") add_feature_info("Module: Oldfilm" MOD_OLDFILM "") add_feature_info("Module: OpenCV" MOD_OPENCV "") add_feature_info("Module: OpenFX" MOD_OPENFX "") add_feature_info("Module: Plus" MOD_PLUS "") add_feature_info("Module: PlusGPL" MOD_PLUSGPL "") add_feature_info("Module: Qt6" MOD_QT6 "") add_feature_info("Module: Resample" MOD_RESAMPLE "") add_feature_info("Module: RtAudio" MOD_RTAUDIO "") add_feature_info("Module: Rubberband" MOD_RUBBERBAND "") add_feature_info("Module: RNNoise" MOD_RNNOISE "") add_feature_info("Module: SDL1" MOD_SDL1 "") add_feature_info("Module: SDL2" MOD_SDL2 "") add_feature_info("Module: SoX" MOD_SOX "") add_feature_info("Module: SpatialAudio" MOD_SPATIALAUDIO "") ``` -------------------------------- ### Glob and Add Custom Target for YML Files Source: https://github.com/mltframework/mlt/blob/master/src/modules/glaxnimate/CMakeLists.txt Finds all .yml files in the current directory and adds them to a custom target named 'Other_glaxnimate_Files'. ```cmake file(GLOB YML "*.yml") add_custom_target(Other_glaxnimate_Files SOURCES ${YML} ) ``` -------------------------------- ### Define Other OpenFX Files Target Source: https://github.com/mltframework/mlt/blob/master/src/modules/openfx/CMakeLists.txt Creates a custom target for other OpenFX related files like YAML configurations. ```cmake add_custom_target(Other_openfx_Files SOURCES filter_openfx.yml ) ``` -------------------------------- ### Check for GLib for OpenFX Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Checks for the GLib library using PkgConfig if the MOD_OPENFX module is enabled. GLib is a general-purpose utility library used by many GNOME-related projects. ```cmake if(MOD_OPENFX) pkg_check_modules(glib IMPORTED_TARGET glib-2.0) endif() ``` -------------------------------- ### Check for fontconfig using PkgConfig Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Checks for the fontconfig library using PkgConfig, which is essential for font management and rendering. This is enabled if MOD_GDK or MOD_GTK is active. ```cmake if(MOD_GDK OR MOD_GTK) pkg_check_modules(fontconfig IMPORTED_TARGET fontconfig) endif() ``` -------------------------------- ### Find FFTW3 Library Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Locates the FFTW3 library, a fast Fourier transform library, if the MOD_QT6 or MOD_PLUS modules are enabled. This is required for signal processing tasks. ```cmake if(MOD_QT6 OR MOD_PLUS) find_package(FFTW3) endif() ``` -------------------------------- ### Configure MLT Java Target Options Source: https://github.com/mltframework/mlt/blob/master/src/swig/java/CMakeLists.txt Sets private compile options and links necessary libraries for the MLT Java target. Includes MLT core libraries and JNI include directories. ```cmake target_compile_options(mltjava PRIVATE ${MLT_COMPILE_OPTIONS}) ``` ```cmake target_link_libraries(mltjava PRIVATE mlt mlt++) ``` ```cmake target_include_directories(mltjava PRIVATE ${JNI_INCLUDE_DIRS}) ``` -------------------------------- ### Add Kdenlive Component Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Adds 'kdenlive' to the list of supported components if the MOD_KDENLIVE module is enabled. This likely indicates integration or support for Kdenlive project features. ```cmake if(MOD_KDENLIVE) list(APPEND MLT_SUPPORTED_COMPONENTS kdenlive) endif() ``` -------------------------------- ### Set Target Properties for rnnoise Library Output Source: https://github.com/mltframework/mlt/blob/master/src/modules/rnnoise/CMakeLists.txt Configures the output directory for the mltrnnoise library. ```cmake set_target_properties(mltrnnoise PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${MLT_MODULE_OUTPUT_DIRECTORY}") ``` -------------------------------- ### Define Qt Test Function Source: https://github.com/mltframework/mlt/blob/master/src/tests/CMakeLists.txt Defines a CMake function to add Qt-based tests. This function handles executable creation, compilation options, library linking, and test registration. ```cmake function(add_qt_test) set(options "") set(oneValueArgs TEST_NAME) set(multiValueArgs LINK_LIBRARIES INCLUDE_DIRS SOURCE_FILES) cmake_parse_argument(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) set(_testname test_${arg_TEST_NAME}) add_executable(${_testname} ${_testname}/${_testname}.cpp ${arg_SOURCE_FILES}) target_compile_options(${_testname} PRIVATE ${MLT_COMPILE_OPTIONS}) target_link_libraries(${_testname} PRIVATE Qt${QT_MAJOR_VERSION}::Core Qt${QT_MAJOR_VERSION}::Test mlt++ ${ARG_LINK_LIBRARIES} ) if(MSVC) target_link_libraries(${_testname} PRIVATE PThreads4W::PThreads4W) endif() target_include_directories(${_testname} PRIVATE ${arg_INCLUDE_DIRS}) add_test(NAME "QtTest:${arg_TEST_NAME}" COMMAND ${_testname}) if(NOT WIN32) set_tests_properties("QtTest:${arg_TEST_NAME}" PROPERTIES ENVIRONMENT "LANG=en_US") endif() endfunction() ``` -------------------------------- ### Set Compile Options and Link Libraries for MLT Ruby Source: https://github.com/mltframework/mlt/blob/master/src/swig/ruby/CMakeLists.txt Configures compile options and links necessary libraries for the MLT Ruby binding. It requires MLT_COMPILE_OPTIONS and the main mlt++ library. Ensure these are defined in your build environment. ```cmake target_compile_options(mltruby PRIVATE ${MLT_COMPILE_OPTIONS}) ``` ```cmake target_link_libraries(mltruby PRIVATE mlt++) ``` ```cmake target_include_directories(mltruby PRIVATE ${RUBY_INCLUDE_DIRS}) ``` -------------------------------- ### Set MLT Vorbis Library Output Directory Source: https://github.com/mltframework/mlt/blob/master/src/modules/vorbis/CMakeLists.txt Configures the output directory for the MLT Vorbis library. ```cmake set_target_properties(mltvorbis PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${MLT_MODULE_OUTPUT_DIRECTORY}") ``` -------------------------------- ### Set MLT OpenCV Module Properties Source: https://github.com/mltframework/mlt/blob/master/src/modules/opencv/CMakeLists.txt Configures the output directory for the mltopencv module's library. ```cmake set_target_properties(mltopencv PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${MLT_MODULE_OUTPUT_DIRECTORY}") ``` -------------------------------- ### Add PlusGPL Component Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Adds 'plusgpl' to the list of supported components if the MOD_PLUSGPL module is enabled. This likely indicates support for GPL-licensed additions or features. ```cmake if(MOD_PLUSGPL) list(APPEND MLT_SUPPORTED_COMPONENTS plusgpl) endif() ``` -------------------------------- ### Link Libraries for MLT SOX Source: https://github.com/mltframework/mlt/blob/master/src/modules/sox/CMakeLists.txt Links the mltsox target against the mlt library and the sox PkgConfig package. Also links against the 'm' library on non-MSVC systems. ```cmake target_link_libraries(mltsox PRIVATE mlt PkgConfig::sox) if(NOT MSVC) target_link_libraries(mltsox PRIVATE m) endif() ``` -------------------------------- ### Configure Clang Format Targets Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Defines custom targets for running clang-format for code formatting and checking. It filters out specific files from the formatting process. ```cmake list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*autogen") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/avformat/mmx.h") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/decklink/darwin") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/decklink/linux") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/decklink/win") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/gdk/pixops") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/jackrack/jack_rack.*") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/jackrack/lock_free_fifo.*") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/plugin_desc.*") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/plugin_mgr.*") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/plugin_settings.*") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/plugin.*") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/process.*") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/plus/ebur128") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/movit/optional_effect.h") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/opencv/filter_opencv_tracker.cpp") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/openfx/openfx") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/plusgpl/cJSON") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/plusgpl/image.*") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/plusgpl/utils.*") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/rtaudio/RtAudio.*") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/xine/attributes.h") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/xine/cpu_accel.c") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/xine/deinterlace.*") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/xine/vf_yadif_template.h") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/xine/xineutils.h") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/xine/yadif.*") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/win32") list(FILTER FORMAT_FILES EXCLUDE REGEX "/.*/msvc/libgen") add_custom_target(clang-format COMMAND ${CLANGFORMAT_EXECUTABLE} -style=file -i ${FORMAT_FILES} ) add_custom_target(clang-format-check COMMAND ${CLANGFORMAT_EXECUTABLE} --dry-run --Werror -style=file -i ${FORMAT_FILES} ) ``` -------------------------------- ### Define MLT Vorbis Library Source: https://github.com/mltframework/mlt/blob/master/src/modules/vorbis/CMakeLists.txt Defines the MLT Vorbis library with its source files. ```cmake add_library(mltvorbis MODULE factory.c producer_vorbis.c) ``` -------------------------------- ### Set Include Directories for MLT Perl Source: https://github.com/mltframework/mlt/blob/master/src/swig/perl/CMakeLists.txt Adds private include directories for the mltperl target, specifically for Perl headers. PERL_INCLUDE_PATH must be defined. ```cmake target_include_directories(mltperl PRIVATE ${PERL_INCLUDE_PATH}) ``` -------------------------------- ### Find OpenMP Package Source: https://github.com/mltframework/mlt/blob/master/src/modules/openfx/CMakeLists.txt Finds and enables the OpenMP package if available. ```cmake find_package(OpenMP) ``` -------------------------------- ### Configure CPU Features for GNU/Clang Compilers Source: https://github.com/mltframework/mlt/blob/master/CMakeLists.txt Sets CPU feature flags (MMX, SSE, SSE2, X86_32, X86_64) based on the detected system processor when using GNU or Clang compilers. It conditionally adds compiler options for MMX, SSE, and SSE2 if not using MSVC or clang-cl. ```cmake if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") if(CMAKE_SYSTEM_PROCESSOR MATCHES "i686|x86|x86_64|AMD64") set(CPU_MMX ON) set(CPU_SSE ON) set(CPU_SSE2 ON) if(NOT MSVC) # also NOT clang-cl list(APPEND MLT_COMPILE_OPTIONS "-mmmx;-msse;-msse2") endif() endif() if(CMAKE_SYSTEM_PROCESSOR MATCHES "i686" OR (WIN32 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86")) set(CPU_X86_32 ON) endif() if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64") set(CPU_X86_64 ON) endif() endif() ``` -------------------------------- ### Set MLT Node.js Target Properties Source: https://github.com/mltframework/mlt/blob/master/src/swig/nodejs/CMakeLists.txt Configures the output name and SWIG compile options for the Node.js target. The SWIG option '-node' is specific for Node.js integration. ```cmake set_target_properties(mltnodejs PROPERTIES OUTPUT_NAME "mlt" SWIG_COMPILE_OPTIONS -node ) ``` -------------------------------- ### Link MLT Rubberband Library with Dependencies Source: https://github.com/mltframework/mlt/blob/master/src/modules/rubberband/CMakeLists.txt Links the MLT Rubberband module against its required libraries, including MLT and PkgConfig::rubberband. This ensures all dependencies are resolved. ```cmake target_link_libraries(mltrubberband PRIVATE mlt PkgConfig::rubberband) ``` -------------------------------- ### Define rnnoise Library Source: https://github.com/mltframework/mlt/blob/master/src/modules/rnnoise/CMakeLists.txt Defines the rnnoise library with its source files. ```cmake add_library(mltrnnoise MODULE factory.c filter_rnnoise.c link_rnnoise.c) ```