<commit_before># Add debug if debugmode (only default on for windows)
dbg_ext =
win32:CONFIG(debug, debug|release):dbg_ext = _d
unix:CONFIG(debug, debug|release):dbg_ext =

# By default assume Python version 2
PYTHONQT_PYVERSION=2
export(PYTHONQT_PYVERSION)

# Set hompath and libname
pythonqt_home = $${PWD}/pythonqt
pythonqt_lib = $${pythonqt_home}/lib
libname = PythonQt

defineTest(have_local_pythonqt) {
  exists($${pythonqt_lib}) {
    return(true)
  }
  return(false)
}

defineTest(have_system_pythonqt) {
  unix:system(ldconfig -p | grep -q lib$${libname}) {
    return(true)
  }
  return(false)
}

defineTest(have_pythonqt) {
  have_local_pythonqt() {
    return(true)
  }
  have_system_pythonqt() {
    return(true)
  }
  return(false)
}

have_local_pythonqt() {
  INCLUDEPATH *= $${pythonqt_home}/include
  #TODO Use prf instead
  exists($${pythonqt_lib}/libPythonQt-Qt5-Python3$${dbg_ext}.so) {
    LIBS *= -L$${pythonqt_lib} -lPythonQt-Qt5-Python3$${dbg_ext}
    PYTHONQT_PYVERSION=3
    export(PYTHONQT_PYVERSION)
  } else {
    LIBS *= -L$${pythonqt_lib} -l$${libname}$${dbg_ext}
  }
  # Note! The RPATH is absolute and only meant for dev builds in the IDE, on release runtime paths should be stripped
  QMAKE_RPATHDIR *= $${pythonqt_lib}
  message(Found local PythonQt)
} else:have_system_pythonqt() {
  LIBS += -l$${libname}
  message(Found system ldconfig PythonQt)
}<commit_msg>Use pkg-config to find PythonQt<commit_after># Add debug if debugmode (only default on for windows)
dbg_ext =
win32:CONFIG(debug, debug|release):dbg_ext = _d
unix:CONFIG(debug, debug|release):dbg_ext =

# Set hompath and libname
pythonqt_home = $${PWD}/pythonqt
pythonqt_lib = $${pythonqt_home}/lib
libname = PythonQt

defineTest(have_local_pythonqt) {
  exists($${pythonqt_lib}) {
    return(true)
  }
  return(false)
}

defineTest(have_system_pythonqt) {
  packagesExist(PythonQt-Qt5-Python3) {
    return(true)
  }
  return(false)
}

defineTest(have_pythonqt) {
  have_local_pythonqt() {
    return(true)
  }
  have_system_pythonqt() {
    return(true)
  }
  return(false)
}

have_local_pythonqt() {
  INCLUDEPATH *= $${pythonqt_home}/include
  #TODO Use prf instead
  exists($${pythonqt_lib}/libPythonQt-Qt5-Python3$${dbg_ext}.so) {
    LIBS *= -L$${pythonqt_lib} -lPythonQt-Qt5-Python3$${dbg_ext}
    PYTHONQT_PYVERSION=3
    export(PYTHONQT_PYVERSION)
  } else {
    PYTHONQT_PYVERSION=2
    export(PYTHONQT_PYVERSION)
    LIBS *= -L$${pythonqt_lib} -l$${libname}$${dbg_ext}
  }
  # Note! The RPATH is absolute and only meant for dev builds in the IDE, on release runtime paths should be stripped
  QMAKE_RPATHDIR *= $${pythonqt_lib}
  message(Found local PythonQt)
} else:have_system_pythonqt() {
  CONFIG *= link_pkgconfig
  PKGCONFIG *= PythonQt-Qt5-Python3
  PYTHONQT_PYVERSION=3
  export(PYTHONQT_PYVERSION)
  message(Found system pkg-config PythonQt)
}
{'fraction_non_alphanumeric': 0.12548060118839566, 'fraction_numerical': 0.007689619014330654, 'mean_word_length': 4.937759336099585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2610832', 'n_tokens_mistral': 1110, 'n_tokens_neox': 1069, 'n_words': 202}