<commit_before>cmake_minimum_required(VERSION 3.24)

project(OBSInfoWriter VERSION 1.0.0)
add_library(${CMAKE_PROJECT_NAME} MODULE)

# Replace `Your Name Here` with the name (yours or your organization's) you want to see as the
# author of the plugin (in the plugin's metadata itself and in the installers)
set(PLUGIN_AUTHOR "<NAME>")

# Replace `com.example.obs-plugin-template` with a unique Bundle ID for macOS releases (used both in
# the installer and when submitting the installer for notarization)
set(MACOS_BUNDLEID "com.example.${CMAKE_PROJECT_NAME}")

# Replace `<EMAIL>` with the maintainer email address you want to put in Linux packages
set(LINUX_MAINTAINER_EMAIL "<EMAIL>")

# Download dependencies
set(FETCHCONTENT_TRY_FIND_PACKAGE_MODE ALWAYS)

include(FetchContent)
FetchContent_Declare(
  Crosscables
  OVERRIDE_FIND_PACKAGE
  GIT_REPOSITORY https://github.com/partouf/Crosscables.git
  GIT_TAG master
)

# Add your custom source files here - header files are optional and only required for visibility
# e.g. in Xcode or Visual Studio
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
  OutputFormat/OutputFormat.SRT.cpp
  OutputFormat/OutputFormat.CSV.cpp
  OutputFormat/OutputFormat.EDL.cpp
  OutputFormat/OutputFormat.Default.cpp
  InfoWriter.cpp
  InfoWriterSettings.cpp
  OBSStudioInfoWriter.cpp)

# Import libobs as main plugin dependency
find_package(libobs REQUIRED)
include(cmake/ObsPluginHelpers.cmake)

find_package(obs-frontend-api REQUIRED)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::obs-frontend-api)

target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_17)

target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/_deps/crosscables-src)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Groundfloor)
find_package(Crosscables REQUIRED)

# /!\ TAKE NOTE: No need to edit things past this point /!\

# --- Platform-independent build settings ---
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)

target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::libobs)

# --- End of section ---

# --- Windows-specific build settings and tasks ---
if(OS_WINDOWS)
  configure_file(cmake/bundle/windows/installer-Windows.iss.in
    ${CMAKE_BINARY_DIR}/installer-Windows.generated.iss)

  configure_file(cmake/bundle/windows/resource.rc.in ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.rc)
  target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.rc)

  if(MSVC)
    target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE /W0)
  endif()

# --- End of section ---

# -- macOS specific build settings and tasks --
elseif(OS_MACOS)
  configure_file(cmake/bundle/macos/installer-macos.pkgproj.in
    ${CMAKE_BINARY_DIR}/installer-macos.generated.pkgproj)

  set(MACOSX_PLUGIN_GUI_IDENTIFIER "${MACOS_BUNDLEID}")
  set(MACOSX_PLUGIN_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION}")
  set(MACOSX_PLUGIN_SHORT_VERSION_STRING "1")

  target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall -Wno-unused-parameter -Wno-unused-private-field)

# --- End of section ---

# --- Linux-specific build settings and tasks ---
else()
  target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE rt)

  target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall -Wno-unused-parameter -Wno-unused-private-field)
endif()

# --- End of section ---
setup_plugin_target(${CMAKE_PROJECT_NAME})<commit_msg>cmakeformat<commit_after>cmake_minimum_required(VERSION 3.24)

project(OBSInfoWriter VERSION 1.0.0)
add_library(${CMAKE_PROJECT_NAME} MODULE)

# Replace `Your Name Here` with the name (yours or your organization's) you want to see as the
# author of the plugin (in the plugin's metadata itself and in the installers)
set(PLUGIN_AUTHOR "<NAME>")

# Replace `com.example.obs-plugin-template` with a unique Bundle ID for macOS releases (used both in
# the installer and when submitting the installer for notarization)
set(MACOS_BUNDLEID "com.example.${CMAKE_PROJECT_NAME}")

# Replace `<EMAIL>` with the maintainer email address you want to put in Linux packages
set(LINUX_MAINTAINER_EMAIL "<EMAIL>")

# Download dependencies
set(FETCHCONTENT_TRY_FIND_PACKAGE_MODE ALWAYS)

include(FetchContent)
FetchContent_Declare(
  Crosscables
  OVERRIDE_FIND_PACKAGE
  GIT_REPOSITORY https://github.com/partouf/Crosscables.git
  GIT_TAG master)

# Add your custom source files here - header files are optional and only required for visibility
# e.g. in Xcode or Visual Studio
target_sources(
  ${CMAKE_PROJECT_NAME}
  PRIVATE OutputFormat/OutputFormat.SRT.cpp
          OutputFormat/OutputFormat.CSV.cpp
          OutputFormat/OutputFormat.EDL.cpp
          OutputFormat/OutputFormat.Default.cpp
          InfoWriter.cpp
          InfoWriterSettings.cpp
          OBSStudioInfoWriter.cpp)

# Import libobs as main plugin dependency
find_package(libobs REQUIRED)
include(cmake/ObsPluginHelpers.cmake)

find_package(obs-frontend-api REQUIRED)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::obs-frontend-api)

target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_17)

target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/_deps/crosscables-src)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Groundfloor)
find_package(Crosscables REQUIRED)

# /!\ TAKE NOTE: No need to edit things past this point /!\

# --- Platform-independent build settings ---
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)

target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::libobs)

# --- End of section ---

# --- Windows-specific build settings and tasks ---
if(OS_WINDOWS)
  configure_file(cmake/bundle/windows/installer-Windows.iss.in
                 ${CMAKE_BINARY_DIR}/installer-Windows.generated.iss)

  configure_file(cmake/bundle/windows/resource.rc.in ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.rc)
  target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.rc)

  if(MSVC)
    target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE /W0)
  endif()

  # --- End of section ---

  # -- macOS specific build settings and tasks --
elseif(OS_MACOS)
  configure_file(cmake/bundle/macos/installer-macos.pkgproj.in
                 ${CMAKE_BINARY_DIR}/installer-macos.generated.pkgproj)

  set(MACOSX_PLUGIN_GUI_IDENTIFIER "${MACOS_BUNDLEID}")
  set(MACOSX_PLUGIN_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION}")
  set(MACOSX_PLUGIN_SHORT_VERSION_STRING "1")

  target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall -Wno-unused-parameter
                                                       -Wno-unused-private-field)

  # --- End of section ---

  # --- Linux-specific build settings and tasks ---
else()
  target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE rt)

  target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall -Wno-unused-parameter
                                                       -Wno-unused-private-field)
endif()

# --- End of section ---
setup_plugin_target(${CMAKE_PROJECT_NAME})
{'fraction_non_alphanumeric': 0.10157819225251076, 'fraction_numerical': 0.0028694404591104736, 'mean_word_length': 4.892645815722739, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1945508', 'n_tokens_mistral': 2456, 'n_tokens_neox': 2341, 'n_words': 462}