<commit_before>cmake_minimum_required(VERSION 3.0.2)
project(eovim LANGUAGES C VERSION 0.1.2.99)

include(CPack)
include(CheckTypeSize)

# Try to determine the architecture (32/64 bits) we are compiling for.  This
# will be used to determine in which lib directory plugins must be loaded
# (lib/lib32/lib64).
check_type_size("void*" SIZEOF_VOID_P BUILTIN_TYPES_ONLY LANGUAGE C)
if (SIZEOF_VOID_P EQUAL 4)
   set(LIB_SUFFIX "32")
elseif (SIZEOF_VOID_P EQUAL 8)
   set(LIB_SUFFIX "64")
else ()
   set(LIB_SUFFIX "")
endif ()

# Shared objects (loadable modules) have different extensions from one platform
# to another.  OSX and Linux use .so, whereas Windows uses .dll.  There may be
# more, that I'm not aware of.
if (WIN32)
   set(MODULE_EXT ".dll")
else ()
   set(MODULE_EXT ".so")
endif ()

option(WITH_TESTS "Compile eovim for testing purposes" OFF)
option(WITH_PLUGINS "Compile eovim with plug-ins support" ON)

set(CMAKE_MODULE_PATH
   "${CMAKE_MODULE_PATH}${CMAKE_SOURCE_DIR}/cmake/Modules")

if (WITH_PLUGINS)
   include(plugin)
endif ()
include(compiler_warnings)

set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(THEMES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/data/themes")
set(BUILD_THEMES_DIR "${CMAKE_BINARY_DIR}/themes")
set(BUILD_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include")

file(MAKE_DIRECTORY "${BUILD_THEMES_DIR}")
file(MAKE_DIRECTORY "${BUILD_INCLUDE_DIR}/eovim")
configure_file(
   "${CMAKE_SOURCE_DIR}/cmake/Modules/version.h.in"
   "${BUILD_INCLUDE_DIR}/eovim/version.h"
   @ONLY)

find_package(Eina REQUIRED)
find_package(Eet REQUIRED)
find_package(Evas REQUIRED)
find_package(Ecore REQUIRED COMPONENTS File Input)
find_package(Edje REQUIRED)
find_package(Efreet REQUIRED)
find_package(Elementary REQUIRED)
find_package(MsgPack REQUIRED)
<commit_msg>Add support for creating an RPM package<commit_after>cmake_minimum_required(VERSION 3.0.2)
project(eovim LANGUAGES C VERSION 0.1.2.99)

include(CheckTypeSize)

# Try to determine the architecture (32/64 bits) we are compiling for.  This
# will be used to determine in which lib directory plugins must be loaded
# (lib/lib32/lib64).
check_type_size("void*" SIZEOF_VOID_P BUILTIN_TYPES_ONLY LANGUAGE C)
if (SIZEOF_VOID_P EQUAL 4)
   set(LIB_SUFFIX "32")
elseif (SIZEOF_VOID_P EQUAL 8)
   set(LIB_SUFFIX "64")
else ()
   set(LIB_SUFFIX "")
endif ()

# Shared objects (loadable modules) have different extensions from one platform
# to another.  OSX and Linux use .so, whereas Windows uses .dll.  There may be
# more, that I'm not aware of.
if (WIN32)
   set(MODULE_EXT ".dll")
else ()
   set(MODULE_EXT ".so")
endif ()

option(WITH_TESTS "Compile eovim for testing purposes" OFF)
option(WITH_PLUGINS "Compile eovim with plug-ins support" ON)

set(CMAKE_MODULE_PATH
   "${CMAKE_MODULE_PATH}${CMAKE_SOURCE_DIR}/cmake/Modules")

if (WITH_PLUGINS)
   include(plugin)
endif ()
include(compiler_warnings)

set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(THEMES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/data/themes")
set(BUILD_THEMES_DIR "${CMAKE_BINARY_DIR}/themes")
set(BUILD_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include")

file(MAKE_DIRECTORY "${BUILD_THEMES_DIR}")
file(MAKE_DIRECTORY "${BUILD_INCLUDE_DIR}/eovim")
configure_file(
   "${CMAKE_SOURCE_DIR}/cmake/Modules/version.h.in"
   "${BUILD_INCLUDE_DIR}/eovim/version.h"
   @ONLY)

execute_process(COMMAND git tag -l WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE VERSION_STRING OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX MATCHALL "[0-9.]+" VERSION_LIST "${VERSION_STRING}")
list(GET VERSION_LIST -1 VERSION)
set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
set(CPACK_PACKAGE_VERSION "${VERSION}")
set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_NAME "eovim")
set(CPACK_PACKAGE_RELEASE 1)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Eovim is the Enlightened Neovim")
set(CPACK_PACKAGE_VENDOR "<NAME>")
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
set(CPACK_RPM_PACKAGE_GROUP "Applications/Editors")
set(CPACK_RPM_PACKAGE_DESCRIPTION "Eovim is the Enlightened Neovim. That's just an EFL GUI client for Neovim.")
set(CPACK_RPM_PACKAGE_REQUIRES "neovim >= 0.2.0, efl >= 1.20")

include(CPack)

find_package(Eina REQUIRED)
find_package(Eet REQUIRED)
find_package(Evas REQUIRED)
find_package(Ecore REQUIRED COMPONENTS File Input)
find_package(Edje REQUIRED)
find_package(Efreet REQUIRED)
find_package(Elementary REQUIRED)
find_package(MsgPack REQUIRED)

{'fraction_non_alphanumeric': 0.10932334141503196, 'fraction_numerical': 0.01278377782675777, 'mean_word_length': 7.089126559714795, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1492382', 'n_tokens_mistral': 1795, 'n_tokens_neox': 1705, 'n_words': 367}