<commit_before>cmake_minimum_required(VERSION 2.8.11)
cmake_policy(SET CMP0020 NEW)
cmake_policy(SET CMP0043 NEW)

include(cmake/Translations.cmake)

option(BUILD_WITH_QT4 "Build qtsparkle with Qt4" ON)
option(BUILD_STATIC "Static build" OFF)
if(BUILD_WITH_QT4)
  find_package(Qt4 REQUIRED QtCore QtGui QtNetwork QtXml)
  add_definitions(${QT_DEFINITIONS})
  include(${QT_USE_FILE})

  macro(qt_add_resources)
    qt4_add_resources(${ARGN})
  endmacro()

  set(QT_SUFFIX "")
else()
  find_package(Qt5 REQUIRED COMPONENTS Core Network Xml Widgets)

  macro(qt_add_resources)
    qt5_add_resources(${ARGN})
  endmacro()

  set(QT_LIBRARIES Qt5::Core Qt5::Network Qt5::Widgets)
  set(QT_SUFFIX "-qt5")
endif()


SET(CMAKE_C_FLAGS    "${CMAKE_C_FLAGS} -Wall")
SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -Wall")

add_subdirectory(src)
add_subdirectory(exampleapp)
<commit_msg>fix build with Qt5<commit_after>cmake_minimum_required(VERSION 2.8.11)
cmake_policy(SET CMP0020 NEW)
cmake_policy(SET CMP0043 NEW)

include(cmake/Translations.cmake)

option(BUILD_WITH_QT4 "Build qtsparkle with Qt4" ON)
option(BUILD_STATIC "Static build" OFF)
if(BUILD_WITH_QT4)
  find_package(Qt4 REQUIRED QtCore QtGui QtNetwork QtXml)
  add_definitions(${QT_DEFINITIONS})
  include(${QT_USE_FILE})

  macro(qt_add_resources)
    qt4_add_resources(${ARGN})
  endmacro()

  set(QT_SUFFIX "")
else()
  find_package(Qt5 REQUIRED COMPONENTS Core Network Xml Widgets LinguistTools)
  set(QT_LUPDATE_EXECUTABLE ${Qt5_LUPDATE_EXECUTABLE})
  set(QT_LRELEASE_EXECUTABLE ${Qt5_LRELEASE_EXECUTABLE})

  macro(qt_add_resources)
    qt5_add_resources(${ARGN})
  endmacro()

  set(QT_LIBRARIES Qt5::Core Qt5::Network Qt5::Widgets)
  set(QT_SUFFIX "-qt5")
endif()


SET(CMAKE_C_FLAGS    "${CMAKE_C_FLAGS} -Wall")
SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -Wall")

add_subdirectory(src)
add_subdirectory(exampleapp)

{'fraction_non_alphanumeric': 0.11021936864633494, 'fraction_numerical': 0.026217228464419477, 'mean_word_length': 7.095238095238095, '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': '3656030', 'n_tokens_mistral': 815, 'n_tokens_neox': 740, 'n_words': 124}