<commit_before># Find Qt4, including QtMain if on Windows.
if(WIN32)
  set(qtmain QtMain)
else()
  unset(qtmain)
endif()
find_package(Qt4 4.7 COMPONENTS QtCore QtGui QtNetwork ${qtmain} REQUIRED)
include(${QT_USE_FILE})

# VTK is used for the charting and infovis components.
find_package(VTK COMPONENTS vtkChartsCore vtkGUISupportQt vtkViewsContext2D
  vtkViewsInfovis vtkRenderingQt vtkRenderingFreeTypeOpenGL NO_MODULE)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${VTK_DEFINITIONS})
include_directories(SYSTEM ${VTK_INCLUDE_DIRS}
  ${MongoChem_SOURCE_DIR}/mongochem/gui)

# Need to add current binary dir to include path for UI file headers
include_directories(${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR})

if(MongoChem_ENABLE_RPC)
  # For Qt5Json
  find_package(MoleQueue REQUIRED)
  include_directories(${MoleQueue_INCLUDE_DIRS})
  add_definitions(-DMongoChem_ENABLE_RPC)
endif()

# find QtTesting
if(ENABLE_TESTING)
  find_package(QtTesting REQUIRED)
  include_directories(${QtTesting_INCLUDE_DIRS})
  link_directories(${QtTesting_LIBRARY_DIR})
  add_definitions(-DQTTESTING)
endif()

configure_file(mongochemconfig.h.in mongochemconfig.h)

set(SOURCES
  main.cpp
  mainwindow.cpp
  aboutdialog.cpp
)

qt4_add_resources(RCC_SOURCES mongochem.qrc)
qt4_wrap_ui(UI_SOURCES
  mainwindow.ui
  aboutdialog.ui
)

# Handle Mac OS X specific icons etc.
if(APPLE)
  list(APPEND SOURCES icons/mongochem.icns)
  set(MACOSX_BUNDLE_ICON_FILE mongochem.icns)
  set(MACOSX_BUNDLE_BUNDLE_VERSION "${MongoChem_VERSION}")
  set_source_files_properties(icons/mongochem.icns PROPERTIES
    MACOSX_PACKAGE_LOCATION Resources)
elseif(WIN32)
  list(APPEND SOURCES icons/mongochem.rc)
endif()

add_executable(mongochem WIN32 MACOSX_BUNDLE
  ${SOURCES} ${UI_SOURCES} ${RCC_SOURCES})
set_target_properties(mongochem PROPERTIES AUTOMOC TRUE)
target_link_libraries(mongochem
  ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY}
  MongoChemGui MongoChemPlugins
)
if(APPLE)
  set_target_properties(mongochem PROPERTIES
    OUTPUT_NAME ${MACOSX_BUNDLE_NAME})
endif()
if(ENABLE_TESTING)<commit_msg>Just use QT_LIBRARIES as link target<commit_after># Find Qt4, including QtMain if on Windows.
if(WIN32)
  set(qtmain QtMain)
else()
  unset(qtmain)
endif()
find_package(Qt4 4.7 COMPONENTS QtCore QtGui QtNetwork ${qtmain} REQUIRED)
include(${QT_USE_FILE})

# VTK is used for the charting and infovis components.
find_package(VTK COMPONENTS vtkChartsCore vtkGUISupportQt vtkViewsContext2D
  vtkViewsInfovis vtkRenderingQt vtkRenderingFreeTypeOpenGL NO_MODULE)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${VTK_DEFINITIONS})
include_directories(SYSTEM ${VTK_INCLUDE_DIRS}
  ${MongoChem_SOURCE_DIR}/mongochem/gui)

# Need to add current binary dir to include path for UI file headers
include_directories(${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR})

if(MongoChem_ENABLE_RPC)
  # For Qt5Json
  find_package(MoleQueue REQUIRED)
  include_directories(${MoleQueue_INCLUDE_DIRS})
  add_definitions(-DMongoChem_ENABLE_RPC)
endif()

# find QtTesting
if(ENABLE_TESTING)
  find_package(QtTesting REQUIRED)
  include_directories(${QtTesting_INCLUDE_DIRS})
  link_directories(${QtTesting_LIBRARY_DIR})
  add_definitions(-DQTTESTING)
endif()

configure_file(mongochemconfig.h.in mongochemconfig.h)

set(SOURCES
  main.cpp
  mainwindow.cpp
  aboutdialog.cpp
)

qt4_add_resources(RCC_SOURCES mongochem.qrc)
qt4_wrap_ui(UI_SOURCES
  mainwindow.ui
  aboutdialog.ui
)

# Handle Mac OS X specific icons etc.
if(APPLE)
  list(APPEND SOURCES icons/mongochem.icns)
  set(MACOSX_BUNDLE_ICON_FILE mongochem.icns)
  set(MACOSX_BUNDLE_BUNDLE_VERSION "${MongoChem_VERSION}")
  set_source_files_properties(icons/mongochem.icns PROPERTIES
    MACOSX_PACKAGE_LOCATION Resources)
elseif(WIN32)
  list(APPEND SOURCES icons/mongochem.rc)
endif()

add_executable(mongochem WIN32 MACOSX_BUNDLE
  ${SOURCES} ${UI_SOURCES} ${RCC_SOURCES})
set_target_properties(mongochem PROPERTIES AUTOMOC TRUE)
target_link_libraries(mongochem
  ${QT_LIBRARIES} MongoChemGui MongoChemPlugins
)
if(APPLE)
  set_target_properties(mongochem PROPERTIES
    OUTPUT_NAME ${MACOSX_BUNDLE_NAME})
endif()
if(ENABLE_TESTING)
{'fraction_non_alphanumeric': 0.08043788672060924, 'fraction_numerical': 0.006663493574488339, 'mean_word_length': 7.683884297520661, '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': '3369058', 'n_tokens_mistral': 1670, 'n_tokens_neox': 1550, 'n_words': 280}