<commit_before>PROJECT(OpenCOR)

# Minimum version of CMake required

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

# Name of the main project and location of the built OpenCOR binary
# Note: these are required, on Mac OS X, to determine where plugins should be
#       copied

SET(MAIN_PROJECT_NAME ${PROJECT_NAME})
SET(MAC_OS_X_PROJECT_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib)
SET(MAC_OS_X_PROJECT_BINARY_DIR ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app)

# Location of our CMake files

SET(CMAKE_FILES_DIR ${CMAKE_SOURCE_DIR}/cmake)

# Some in-house CMake functions/macros

INCLUDE(${CMAKE_FILES_DIR}/common.cmake)

# Initialise the project

INITIALISE_PROJECT()

# Version of OpenCOR

SET(VERSION_MAJOR 0)
SET(VERSION_MINOR 0)
SET(VERSION_PATCH 0)

SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")

FILE(WRITE ${CMAKE_BINARY_DIR}/version.txt ${VERSION})

# Files that make up the GUI version of OpenCOR

SET(SOURCES
    src/checkforupdateswindow.cpp
    src/main.cpp
    src/mainwindow.cpp
    src/pluginswindow.cpp
    src/preferenceswindow.cpp

    src/misc/common.cpp
    src/misc/utils.cpp
    src/misc/versionmanager.cpp

    src/plugins/guiinterface.cpp
    src/plugins/plugin.cpp
    src/plugins/plugininterface.cpp
    src/plugins/pluginmanager.cpp
)

SET(HEADERS
    src/misc/common.h
    src/misc/utils.h

    src/plugins/guiinterface.h
    src/plugins/plugininterface.h
)

SET(HEADERS_MOC
    src/checkforupdateswindow.h
    src/mainwindow.h
    src/pluginswindow.h
    src/preferenceswindow.h

    src/misc/versionmanager.h

    src/plugins/plugin.h
    src/plugins/pluginmanager.h
)

SET(UIS
    src/checkforupdateswindow.ui
    src/mainwindow.ui
    src/pluginswindow.ui
    src/preferenceswindow.ui
)

SET(RESOURCES
    res/common.qrc
    res/ui.qrc
)

# Various include directories

INCLUDE_DIRECTORIES(
    build
    src
    src/misc
    src/plugins
    src/ui
    src/widgets
)

# Qt specific

SET(QT_USE_QTHELP TRUE)
SET(QT_USE_QTNETWORK TRUE)
SET(QT_USE_QTSQL TRUE)
SET(QT_USE_QTWEBKIT TRUE)
SET(QT_USE_QTXML TRUE)

IF(WIN32 OR APPLE)
    SET(QT_USE_PHONON TRUE)
ELSE()
    SET(QT_USE_QTDBUS TRUE)
ENDIF()

INCLUDE(${QT_USE_FILE})

# Generate the help files which will be embedded in the executable as a
# resource

EXECUTE_PROCESS(COMMAND ${QT_QCOLLECTIONGENERATOR_EXECUTABLE} ${PROJECT_SOURCE_DIR}/doc/${PROJECT_NAME}.qhcp
                                                           -o ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.qhc)

# Update the translation (.ts) files and generate the language (.qm) files
# which will later on be embedded in the executable as resources

UPDATE_LANGUAGE_FILES(${PROJECT_NAME} FALSE)

# Third-party libraries which must be directly embedded in the GUI version of
# OpenCOR

INCLUDE_THIRD_PARTY_LIBRARIES(.
    LibQxt
    QtSingleApplication
)

# Set the application icon, but only for Windows and Mac OS X, since in the
# case of Linux, it's done through res/OpenCOR.qrc

IF(WIN32)
    SET(IconObjectFile ${CMAKE_BINARY_DIR}/${PROJECT_NAME}_icon.o)

    ADD_CUSTOM_COMMAND(OUTPUT ${IconObjectFile}
                       COMMAND windres -I ${CMAKE_SOURCE_DIR} -i ${CMAKE_SOURCE_DIR}/res/${PROJECT_NAME}.rc
                                       -o ${IconObjectFile}
                      )

    SET(SOURCES ${SOURCES} ${IconObjectFile})
ELSEIF(APPLE)
    SET(IconFile ${PROJECT_NAME}.icns)

    SET(MACOSX_BUNDLE_ICON_FILE ${IconFile})

    SET_SOURCE_FILES_PROPERTIES(res/boomy/${IconFile} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)

    SET(SOURCES ${SOURCES} res/boomy/${IconFile})
ENDIF()

# Build the plugins used by either the GUI and/or console version of OpenCOR

SET(PLUGINS
    # Build the plugins which may be required by other plugins

    application/Core

    api/CellML

    editing/CoreEditing
    editing/CoreCellMLEditing

    3rdparty/QtMmlWidget

    # Build the remaining plugins

    3rdparty/QScintilla

    editing/CellMLXMLView
    editing/Viewer

    application/Help

    organisation/CellMLModelRepository
    organisation/FileBrowser
    organisation/FileOrganiser
)

FOREACH(PLUGIN ${PLUGINS})
    SET(PLUGIN_DIR src/plugins/${PLUGIN})
    SET(PLUGIN_INCLUDE_DIRS)
    # Note: the above variable is defined here, but is actually set when
    #       processing the CMakeLists.txt file of the plugin
<commit_msg>Minor update to our main CMakeLists.txt file.<commit_after>PROJECT(OpenCOR)

# Minimum version of CMake required

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

# Name of the main project and location of the built OpenCOR binary
# Note: these are required, on Mac OS X, to determine where plugins should be
#       copied

SET(MAIN_PROJECT_NAME ${PROJECT_NAME})
SET(MAC_OS_X_PROJECT_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib)
SET(MAC_OS_X_PROJECT_BINARY_DIR ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app)

# Location of our CMake files

SET(CMAKE_FILES_DIR ${CMAKE_SOURCE_DIR}/cmake)

# Some in-house CMake functions/macros

INCLUDE(${CMAKE_FILES_DIR}/common.cmake)

# Initialise the project

INITIALISE_PROJECT()

# Version of OpenCOR

SET(VERSION_MAJOR 0)
SET(VERSION_MINOR 0)
SET(VERSION_PATCH 0)

SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")

FILE(WRITE ${CMAKE_BINARY_DIR}/version.txt ${VERSION})

# Files that make up the GUI version of OpenCOR

SET(SOURCES
    src/checkforupdateswindow.cpp
    src/main.cpp
    src/mainwindow.cpp
    src/pluginswindow.cpp
    src/preferenceswindow.cpp

    src/misc/common.cpp
    src/misc/utils.cpp
    src/misc/versionmanager.cpp

    src/plugins/guiinterface.cpp
    src/plugins/plugin.cpp
    src/plugins/plugininterface.cpp
    src/plugins/pluginmanager.cpp
)

SET(HEADERS
    src/misc/common.h
    src/misc/utils.h

    src/plugins/guiinterface.h
    src/plugins/plugininterface.h
)

SET(HEADERS_MOC
    src/checkforupdateswindow.h
    src/mainwindow.h
    src/pluginswindow.h
    src/preferenceswindow.h

    src/misc/versionmanager.h

    src/plugins/plugin.h
    src/plugins/pluginmanager.h
)

SET(UIS
    src/checkforupdateswindow.ui
    src/mainwindow.ui
    src/pluginswindow.ui
    src/preferenceswindow.ui
)

SET(RESOURCES
    res/common.qrc
    res/ui.qrc
)

# Various include directories

INCLUDE_DIRECTORIES(
    build
    src
    src/misc
    src/plugins
    src/ui
    src/widgets
)

# Qt specific

SET(QT_USE_QTHELP TRUE)
SET(QT_USE_QTNETWORK TRUE)
SET(QT_USE_QTSQL TRUE)
SET(QT_USE_QTWEBKIT TRUE)
SET(QT_USE_QTXML TRUE)

IF(WIN32 OR APPLE)
    SET(QT_USE_PHONON TRUE)
ELSE()
    SET(QT_USE_QTDBUS TRUE)
ENDIF()

INCLUDE(${QT_USE_FILE})

# Generate the help files which will be embedded in the executable as a
# resource

EXECUTE_PROCESS(COMMAND ${QT_QCOLLECTIONGENERATOR_EXECUTABLE} ${PROJECT_SOURCE_DIR}/doc/${PROJECT_NAME}.qhcp
                                                           -o ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.qhc)

# Update the translation (.ts) files and generate the language (.qm) files
# which will later on be embedded in the executable as resources

UPDATE_LANGUAGE_FILES(${PROJECT_NAME} FALSE)

# Third-party libraries which must be directly embedded in the GUI version of
# OpenCOR

INCLUDE_THIRD_PARTY_LIBRARIES(.
    LibQxt
    QtSingleApplication
)

# Set the application icon, but only for Windows and Mac OS X, since in the
# case of Linux, it's done through res/OpenCOR.qrc

IF(WIN32)
    SET(IconObjectFile ${CMAKE_BINARY_DIR}/${PROJECT_NAME}_icon.o)

    ADD_CUSTOM_COMMAND(OUTPUT ${IconObjectFile}
                       COMMAND windres -I ${CMAKE_SOURCE_DIR} -i ${CMAKE_SOURCE_DIR}/res/${PROJECT_NAME}.rc
                                       -o ${IconObjectFile}
                      )

    SET(SOURCES ${SOURCES} ${IconObjectFile})
ELSEIF(APPLE)
    SET(IconFile ${PROJECT_NAME}.icns)

    SET(MACOSX_BUNDLE_ICON_FILE ${IconFile})

    SET_SOURCE_FILES_PROPERTIES(res/boomy/${IconFile} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)

    SET(SOURCES ${SOURCES} res/boomy/${IconFile})
ENDIF()

# Build the plugins used by either the GUI and/or console version of OpenCOR

SET(PLUGINS
    # Build the plugins which may be required by other plugins
    # Note: the build order is important...

    application/Core

    api/CellML

    editing/CoreEditing
    editing/CoreCellMLEditing

    3rdparty/QScintilla
    3rdparty/QtMmlWidget

    # Build the remaining plugins

    editing/CellMLXMLView
    editing/Viewer

    application/Help

    organisation/CellMLModelRepository
    organisation/FileBrowser
    organisation/FileOrganiser
)

FOREACH(PLUGIN ${PLUGINS})
    SET(PLUGIN_DIR src/plugins/${PLUGIN})
    SET(PLUGIN_INCLUDE_DIRS)
    # Note: the above variable is defined here, but is actually set when
    #       processing the CMakeLists.txt file of the plugin

{'fraction_non_alphanumeric': 0.08568792526813516, 'fraction_numerical': 0.002537192941990543, 'mean_word_length': 3.5119667013527573, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7006611', 'n_tokens_mistral': 3117, 'n_tokens_neox': 2924, 'n_words': 652}