<commit_before>PROJECT(OpenCOR)

# Minimum version of CMake required

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

# Type of build

SET(CMAKE_BUILD_TYPE Release)

# Version of OpenCOR

SET(${PROJECT_NAME}_VERSION_MAJOR 0)
SET(${PROJECT_NAME}_VERSION_MINOR 1)
SET(${PROJECT_NAME}_VERSION_PATCH 0)

SET(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}")

# Files that make up OpenCOR

SET(${PROJECT_NAME}_SOURCES
   src/main.cpp
   src/mainwindow.cpp
)

SET(${PROJECT_NAME}_HEADERS
)

SET(${PROJECT_NAME}_HEADERS_MOC
   src/mainwindow.h
)

SET(${PROJECT_NAME}_UIS
   src/mainwindow.ui
)

SET(${PROJECT_NAME}_RESOURCES
)

# Compiler options

ADD_DEFINITIONS(-Wall -O2 -ffast-math)

# Set the application icon for Mac OS X
#---GRY--- SOMETHING NEEDS TO BE DONE ABOUT Windows AND Linux...

IF(APPLE)
   SET(MACOSX_BUNDLE_ICON_FILE ${PROJECT_NAME}.icns)
   SET_SOURCE_FILES_PROPERTIES(res/${PROJECT_NAME}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
   SET(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES} res/${PROJECT_NAME}.icns)
ENDIF()

# Qt specific

FIND_PACKAGE(Qt4 4.7 REQUIRED)

IF(WIN32)
   SET(QT_USE_QTMAIN TRUE)
   # Note: the above ensures that winmain@16 is available on Windows
ENDIF()

INCLUDE(${QT_USE_FILE})

QT4_WRAP_CPP(${PROJECT_NAME}_SOURCES_MOC ${${PROJECT_NAME}_HEADERS_MOC})
QT4_WRAP_UI(${PROJECT_NAME}_SOURCES_UIS ${${PROJECT_NAME}_UIS})
QT4_ADD_RESOURCES(${PROJECT_NAME}_SOURCES_RCS ${${PROJECT_NAME}_RESOURCES})

# Rules to build OpenCOR itself

SET(CMAKE_INCLUDE_CURRENT_DIR ON)

ADD_EXECUTABLE(${PROJECT_NAME} WIN32 MACOSX_BUNDLE
   ${${PROJECT_NAME}_SOURCES}
   ${${PROJECT_NAME}_SOURCES_MOC}
   ${${PROJECT_NAME}_SOURCES_UIS}
   ${${PROJECT_NAME}_SOURCES_RCS}
)

TARGET_LINK_LIBRARIES(${PROJECT_NAME}
   ${QT_LIBRARIES}
)

# Packaging rules (using CPack)

INCLUDE(InstallRequiredSystemLibraries)

SET(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
SET(CPACK_PACKAGE_VENDOR "<NAME>")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME}, a cross-platform CellML-based modelling environment")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "${${PROJECT_NAME}_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${${PROJECT_NAME}_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${${PROJECT_NAME}_VERSION_PATCH}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
SET(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME}" "${PROJECT_NAME}")

IF(WIN32)
   # Select NSIS and ZIP as the packagers on Windows

   SET(CPACK_GENERATOR NSIS ZIP)

   SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LicenseLGPLv2.1.txt")

   # OpenCOR itself

   INSTALL(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)

   # MinGW files required by OpenCOR

   FOREACH(DLL mingwm10 libgcc_s_dw2-1)
      INSTALL(FILES ${QT_BINARY_DIR}/../../mingw/bin/${DLL}.dll DESTINATION bin)
   ENDFOREACH()

   # Qt files required by OpenCOR

   FOREACH(DLL QtCore QtGui)
      INSTALL(FILES ${QT_BINARY_DIR}/${DLL}${QT_VERSION_MAJOR}.dll DESTINATION bin)
   ENDFOREACH()

   # VBScript file to run OpenCOR (useful when downloading a ZIPped version of
   # OpenCOR)

   INSTALL(FILES distrib/OpenCOR.vbs DESTINATION .)
ELSEIF(APPLE)
   # Select PackageMaker and ZIP as the packagers on Mac OS X

   SET(CPACK_GENERATOR PackageMaker ZIP)

   SET(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/distrib/WelcomeForMacOSXInstaller.txt")
   SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
   SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LicenseLGPLv2.1.txt")

   SET(${PROJECT_NAME}_INSTALL_DIR "/Applications/${PROJECT_NAME}")

   SET(CPACK_SET_DESTDIR TRUE)
   SET(CMAKE_INSTALL_PREFIX ${${PROJECT_NAME}_INSTALL_DIR})

   INSTALL(TARGETS ${PROJECT_NAME} BUNDLE DESTINATION ${${PROJECT_NAME}_INSTALL_DIR})

   # Shell script to run OpenCOR (useful when downloading a ZIPped version of
   # OpenCOR)

   INSTALL(FILES distrib/OpenCOR DESTINATION . PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ELSE()
   # Select TGZ as the only packager on Linux

   SET(CPACK_GENERATOR TGZ)

   # OpenCOR itself

   INSTALL(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)

   # Qt files required by OpenCOR

   FOREACH(LIB QtCore QtGui)
      INSTALL(FILES
         ${QT_LIBRARY_DIR}/lib${LIB}.so.${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}
         RENAME lib${LIB}.so.${QT_VERSION_MAJOR}
         DESTINATION lib
      )
   ENDFOREACH()

   # Shell script to run OpenCOR

   INSTALL(FILES distrib/OpenCOR DESTINATION . PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ENDIF()

INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt DESTINATION .)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LicenseLGPLv2.1.txt DESTINATION .)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.txt DESTINATION .)

INCLUDE(CPack)
<commit_msg>Updated the Linux packaging, which was missing some libraries.<commit_after>PROJECT(OpenCOR)

# Minimum version of CMake required

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

# Type of build

SET(CMAKE_BUILD_TYPE Release)

# Version of OpenCOR

SET(${PROJECT_NAME}_VERSION_MAJOR 0)
SET(${PROJECT_NAME}_VERSION_MINOR 1)
SET(${PROJECT_NAME}_VERSION_PATCH 0)

SET(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}")

# Files that make up OpenCOR

SET(${PROJECT_NAME}_SOURCES
   src/main.cpp
   src/mainwindow.cpp
)

SET(${PROJECT_NAME}_HEADERS
)

SET(${PROJECT_NAME}_HEADERS_MOC
   src/mainwindow.h
)

SET(${PROJECT_NAME}_UIS
   src/mainwindow.ui
)

SET(${PROJECT_NAME}_RESOURCES
)

# Compiler options

ADD_DEFINITIONS(-Wall -O2 -ffast-math)

# Set the application icon for Mac OS X
#---GRY--- SOMETHING NEEDS TO BE DONE ABOUT Windows AND Linux...

IF(APPLE)
   SET(MACOSX_BUNDLE_ICON_FILE ${PROJECT_NAME}.icns)
   SET_SOURCE_FILES_PROPERTIES(res/${PROJECT_NAME}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
   SET(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES} res/${PROJECT_NAME}.icns)
ENDIF()

# Qt specific

FIND_PACKAGE(Qt4 4.7 REQUIRED)

IF(WIN32)
   SET(QT_USE_QTMAIN TRUE)
   # Note: the above ensures that winmain@16 is available on Windows
ENDIF()

INCLUDE(${QT_USE_FILE})

QT4_WRAP_CPP(${PROJECT_NAME}_SOURCES_MOC ${${PROJECT_NAME}_HEADERS_MOC})
QT4_WRAP_UI(${PROJECT_NAME}_SOURCES_UIS ${${PROJECT_NAME}_UIS})
QT4_ADD_RESOURCES(${PROJECT_NAME}_SOURCES_RCS ${${PROJECT_NAME}_RESOURCES})

# Rules to build OpenCOR itself

SET(CMAKE_INCLUDE_CURRENT_DIR ON)

ADD_EXECUTABLE(${PROJECT_NAME} WIN32 MACOSX_BUNDLE
   ${${PROJECT_NAME}_SOURCES}
   ${${PROJECT_NAME}_SOURCES_MOC}
   ${${PROJECT_NAME}_SOURCES_UIS}
   ${${PROJECT_NAME}_SOURCES_RCS}
)

TARGET_LINK_LIBRARIES(${PROJECT_NAME}
   ${QT_LIBRARIES}
)

# Packaging rules (using CPack)

INCLUDE(InstallRequiredSystemLibraries)

SET(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
SET(CPACK_PACKAGE_VENDOR "<NAME>")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME}, a cross-platform CellML-based modelling environment")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "${${PROJECT_NAME}_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${${PROJECT_NAME}_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${${PROJECT_NAME}_VERSION_PATCH}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
SET(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME}" "${PROJECT_NAME}")

IF(WIN32)
   # Select NSIS and ZIP as the packagers on Windows

   SET(CPACK_GENERATOR NSIS ZIP)

   SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LicenseLGPLv2.1.txt")

   # OpenCOR itself

   INSTALL(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)

   # MinGW files required by OpenCOR

   FOREACH(DLL mingwm10 libgcc_s_dw2-1)
      INSTALL(FILES ${QT_BINARY_DIR}/../../mingw/bin/${DLL}.dll DESTINATION bin)
   ENDFOREACH()

   # Qt files required by OpenCOR

   FOREACH(DLL QtCore QtGui)
      INSTALL(FILES ${QT_BINARY_DIR}/${DLL}${QT_VERSION_MAJOR}.dll DESTINATION bin)
   ENDFOREACH()

   # VBScript file to run OpenCOR (useful when downloading a ZIPped version of
   # OpenCOR)

   INSTALL(FILES distrib/OpenCOR.vbs DESTINATION .)
ELSEIF(APPLE)
   # Select PackageMaker and ZIP as the packagers on Mac OS X

   SET(CPACK_GENERATOR PackageMaker ZIP)

   SET(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/distrib/WelcomeForMacOSXInstaller.txt")
   SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
   SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LicenseLGPLv2.1.txt")

   SET(${PROJECT_NAME}_INSTALL_DIR "/Applications/${PROJECT_NAME}")

   SET(CPACK_SET_DESTDIR TRUE)
   SET(CMAKE_INSTALL_PREFIX ${${PROJECT_NAME}_INSTALL_DIR})

   INSTALL(TARGETS ${PROJECT_NAME} BUNDLE DESTINATION ${${PROJECT_NAME}_INSTALL_DIR})

   # Shell script to run OpenCOR (useful when downloading a ZIPped version of
   # OpenCOR)

   INSTALL(FILES distrib/OpenCOR DESTINATION . PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ELSE()
   # Select TGZ as the only packager on Linux

   SET(CPACK_GENERATOR TGZ)

   # OpenCOR itself

   INSTALL(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)

   # Qt files required by OpenCOR
   # Note: by default, OpenCOR only requires QtCore and QtGui, but QtGui
   #       requires QtDBus which itself requires QtXml, so...

   FOREACH(LIB QtCore QtDBus QtGui QtXml)
      INSTALL(FILES
         ${QT_LIBRARY_DIR}/lib${LIB}.so.${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}
         RENAME lib${LIB}.so.${QT_VERSION_MAJOR}
         DESTINATION lib
      )
   ENDFOREACH()

   # QtGui seems to require libaudio.so.2.4 (to be packaged as libaudio.so.2)
   # which is not available on a 'blank' version of Ubuntu, so...

   INSTALL(FILES /usr/lib/libaudio.so.2.4 RENAME libaudio.so.2 DESTINATION lib)

   # Shell script to run OpenCOR

   INSTALL(FILES distrib/OpenCOR DESTINATION . PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ENDIF()

INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt DESTINATION .)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LicenseLGPLv2.1.txt DESTINATION .)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.txt DESTINATION .)

INCLUDE(CPack)

{'fraction_non_alphanumeric': 0.1078798349169786, 'fraction_numerical': 0.006334581053843939, 'mean_word_length': 5.9513008672448295, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6560597', 'n_tokens_mistral': 4213, 'n_tokens_neox': 3825, 'n_words': 701}