<commit_before>##
# This is called *before* any call to qi_use_lib() is made.
# Here we need to define the qt macros, such as qt5_wrap_cpp,
# qt5_add_resources, qt5_wrap_ui
set(CMAKE_AUTOMOC ON)
find_package(Qt5Core REQUIRED)
include("${Qt5Core_DIR}/Qt5CoreMacros.cmake")

find_package(Qt5Widgets REQUIRED)
include("${Qt5Widgets_DIR}/Qt5WidgetsMacros.cmake")

function(qi_generate_qt_conf)
  # First, find qt and generate qt.conf
  # containing paths in the toolchain
  if(DEFINED QT_PLUGINS_PATH)
    set(_plugins_path "${QT_PLUGINS_PATH}")
  else()
    list(GET QT5_CORE_LIBRARIES 0 _lib)
    if("${_lib}" STREQUAL "debug"
        OR "${_lib}" STREQUAL "optimized"
        OR "${_lib}" STREQUAL "general")
      list(GET QT5_CORE_LIBRARIES 1 _lib)
    endif()

    get_target_property(_lib_loc ${_lib} LOCATION)
    get_filename_component(_lib_path ${_lib_loc} PATH)
    get_filename_component(_root_path ${_lib_path} PATH)
  endif()

  file(WRITE "${QI_SDK_DIR}/${QI_SDK_BIN}/qt.conf"
"[Paths]
Prefix = ${_root_path}
")

  # Then, generate and install a qt.conf
  # containing relative paths
  file(WRITE "${CMAKE_BINARY_DIR}/qt.conf"
"[Paths]
Prefix = ..
")
  install(FILES "${CMAKE_BINARY_DIR}/qt.conf" DESTINATION bin COMPONENT runtime)
<commit_msg>qi_generate_qt_conf: fix for mac<commit_after>##
# This is called *before* any call to qi_use_lib() is made.
# Here we need to define the qt macros, such as qt5_wrap_cpp,
# qt5_add_resources, qt5_wrap_ui
set(CMAKE_AUTOMOC ON)
find_package(Qt5Core REQUIRED)
include("${Qt5Core_DIR}/Qt5CoreMacros.cmake")

find_package(Qt5Widgets REQUIRED)
include("${Qt5Widgets_DIR}/Qt5WidgetsMacros.cmake")

function(qi_generate_qt_conf)
  # First, find qt and generate qt.conf
  # containing paths in the toolchain
  if(DEFINED QT_PLUGINS_PATH)
    set(_plugins_path "${QT_PLUGINS_PATH}")
  else()
    list(GET QT5_CORE_LIBRARIES 0 _lib)
    if("${_lib}" STREQUAL "debug"
        OR "${_lib}" STREQUAL "optimized"
        OR "${_lib}" STREQUAL "general")
      list(GET QT5_CORE_LIBRARIES 1 _lib)
    endif()

    get_target_property(_lib_loc ${_lib} LOCATION)
    get_filename_component(_lib_path ${_lib_loc} PATH)
    if(APPLE)
      # location is: <prefix>/lib/QtCore.framework/QtCore
      get_filename_component(_lib_path ${_lib_path} PATH)
    endif()
    get_filename_component(_root_path ${_lib_path} PATH)
  endif()

  file(WRITE "${QI_SDK_DIR}/${QI_SDK_BIN}/qt.conf"
"[Paths]
Prefix = ${_root_path}
")

  # Then, generate and install a qt.conf
  # containing relative paths
  file(WRITE "${CMAKE_BINARY_DIR}/qt.conf"
"[Paths]
Prefix = ..
")
  install(FILES "${CMAKE_BINARY_DIR}/qt.conf" DESTINATION bin COMPONENT runtime)

{'fraction_non_alphanumeric': 0.12130288281542494, 'fraction_numerical': 0.009734181954324224, 'mean_word_length': 4.951002227171492, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5655072', 'n_tokens_mistral': 1066, 'n_tokens_neox': 996, 'n_words': 217}