<commit_before>cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
cmake_policy(SET CMP0048 NEW)

project(skaffari VERSION 1.0.0)

find_package(Qt5 5.6.0 REQUIRED COMPONENTS Core Network Sql)
find_package(Cutelyst2Qt5 2.1.0 REQUIRED)
find_package(Grantlee5 REQUIRED)
find_package(PkgConfig REQUIRED)

# Auto generate moc files
set(CMAKE_AUTOMOC ON)

# As moc files are generated in the binary dir, tell CMake
# to always look for includes there:
set(CMAKE_INCLUDE_CURRENT_DIR ON)

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Skaffari default install prefix" FORCE)
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

set(CMAKE_INSTALL_BINDIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Directory to install skaffarictl")
set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_PREFIX}/share" CACHE PATH "Data install directory")
set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Library install directory")
set(APPDIR "${CMAKE_INSTALL_DATADIR}/skaffari")
set(CMAKE_INSTALL_LOCALEDIR "${APPDIR}/l10n" CACHE PATH "Directory to install core translations")
set(TEMPLATES_INSTALL_DIR "${APPDIR}/templates" CACHE PATH "Directory to install templates")
set(CMAKE_INSTALL_SYSCONFDIR "/etc/skaffari" CACHE PATH "Directory to install configuration files")
set(SQL_INSTALL_DIR "${APPDIR}/sql" CACHE PATH "Directory to install SQL files")
set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATADIR}/doc/skaffari" CACHE PATH "Directory to install documentation")
set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATADIR}/man" CACHE PATH "Directory to install man pages")
set(BUILD_TEMPLATES OFF CACHE BOOL "If enabled, template assests will be build")

set(Grantlee5_MAJOR_MINOR_VERSION_STRING "${Grantlee5_VERSION_MAJOR}.${Grantlee5_VERSION_MINOR}" )
set(GRANTLEE_PLUGIN_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/grantlee/${Grantlee5_MAJOR_MINOR_VERSION_STRING} )

option(ENABLE_WKD "Enable support for Web Key Directory" OFF)
if (ENABLE_WKD)
    find_package(Qca-qt5 CONFIG REQUIRED)
endif (ENABLE_WKD)

# set default configuration values
set(DEFVAL_ACC_PWMETHOD 1 CACHE INTERNAL "Default accounts password method")
set(DEFVAL_ACC_PWALGORITHM 0 CACHE INTERNAL "Default accounts password algorithm")
set(DEFVAL_ACC_PWROUNDS 32000 CACHE INTERNAL "Default accounts password iteration count")
set(DEFVAL_ACC_PWMINLENGTH 8 CACHE INTERNAL "Default accounts password minimum length")
set(DEFVAL_ACC_PWTHRESHOLD 30 CACHE INTERNAL "Default accounts password quality threshold")
set(DEFVAL_ADM_PWALGORITHM 4 CACHE INTERNAL "Default admin password algorithm")
set(DEFVAL_ADM_PWROUNDS 32000 CACHE INTERNAL "Default admin password iteration count")
set(DEFVAL_ADM_PWMINLENGTH 8 CACHE INTERNAL "Default admin password minimum length")
set(DEFVAL_ADM_PWTHRESHOLD 50 CACHE INTERNAL "Default admin password quality threshold")
set(DEFVAL_DEF_DOMAINQUOTA 0 CACHE INTERNAL "Default domain quota for new domains in KiB")
set(DEFVAL_DEF_LANGUAGE "en" CACHE INTERNAL "Default language")
set(DEFVAL_DEF_MAXACCOUNTS 1000 CACHE INTERNAL "Default maximum accounts for new domains")
set(DEFVAL_DEF_QUOTA 102400 CACHE INTERNAL "Default quota for new accounts in KiB")
set(DEFVAL_DEF_TIMEZONE "UTC" CACHE INTERNAL "Default timezone")
set(DEFVAL_DEF_WARNLEVEL 90 CACHE INTERNAL "Default warn level for domain quota in percent")
set(DEFVAL_DEF_MAXDISPLAY 25 CACHE INTERNAL "Default value for displaying list entries")
set(DEFVAL_IMAP_PROTOCOL 2 CACHE INTERNAL "Default protocol for the IMAP connection")
set(DEFVAL_IMAP_ENCRYPTION 1 CACHE INTERNAL "Encryption layer for the IMAP connection")
set(DEFVAL_IMAP_CREATEMAILBOX 3 CACHE INTERNAL "Strategy to create new mailboxes on the IMAP server")
set(DEFVAL_IMAP_UNIXHIERARCHYSEP false CACHE INTERNAL "Default value for unix hierarchy separator")
set(DEFVAL_IMAP_DOMAINASPREFIX false CACHE INTERNAL "Default value for domain as prefix")
set(DEFVAL_IMAP_FQUN false CACHE INTERNAL "Default value for fqun")
set(DEFVAL_TMPL_ASYNCACCOUNTLIST false CACHE INTERNAL "Default value for async account list")

configure_file(common/config.h.in ${CMAKE_BINARY_DIR}/common/config.h)

find_program(LRELEASE_CMD_PATH NAMES lrelease-qt5 lrelease)
set(LRELEASE_CMD ${LRELEASE_CMD_PATH})
if(LRELEASE_CMD)
    message(STATUS "Found lrelease at ${LRELEASE_CMD}")
    message(STATUS "Translations are enabled")

    set(LANGS de)

else(LRELEASE_CMD)
    message(WARNING "lrelease executable cannot be found")
    message(WARNING "Translations are disabled")
endif(LRELEASE_CMD)

install(FILES contribute.json DESTINATION ${APPDIR}/static)

add_subdirectory(src)
add_subdirectory(sql)
add_subdirectory(cmd)
add_subdirectory(templates)
add_subdirectory(doc)
add_subdirectory(l10n)
add_subdirectory(grantlee)
<commit_msg>More specific value for default language.<commit_after>cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
cmake_policy(SET CMP0048 NEW)

project(skaffari VERSION 1.0.0)

find_package(Qt5 5.6.0 REQUIRED COMPONENTS Core Network Sql)
find_package(Cutelyst2Qt5 2.1.0 REQUIRED)
find_package(Grantlee5 REQUIRED)
find_package(PkgConfig REQUIRED)

# Auto generate moc files
set(CMAKE_AUTOMOC ON)

# As moc files are generated in the binary dir, tell CMake
# to always look for includes there:
set(CMAKE_INCLUDE_CURRENT_DIR ON)

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Skaffari default install prefix" FORCE)
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

set(CMAKE_INSTALL_BINDIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Directory to install skaffarictl")
set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_PREFIX}/share" CACHE PATH "Data install directory")
set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Library install directory")
set(APPDIR "${CMAKE_INSTALL_DATADIR}/skaffari")
set(CMAKE_INSTALL_LOCALEDIR "${APPDIR}/l10n" CACHE PATH "Directory to install core translations")
set(TEMPLATES_INSTALL_DIR "${APPDIR}/templates" CACHE PATH "Directory to install templates")
set(CMAKE_INSTALL_SYSCONFDIR "/etc/skaffari" CACHE PATH "Directory to install configuration files")
set(SQL_INSTALL_DIR "${APPDIR}/sql" CACHE PATH "Directory to install SQL files")
set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATADIR}/doc/skaffari" CACHE PATH "Directory to install documentation")
set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATADIR}/man" CACHE PATH "Directory to install man pages")
set(BUILD_TEMPLATES OFF CACHE BOOL "If enabled, template assests will be build")

set(Grantlee5_MAJOR_MINOR_VERSION_STRING "${Grantlee5_VERSION_MAJOR}.${Grantlee5_VERSION_MINOR}" )
set(GRANTLEE_PLUGIN_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/grantlee/${Grantlee5_MAJOR_MINOR_VERSION_STRING} )

option(ENABLE_WKD "Enable support for Web Key Directory" OFF)
if (ENABLE_WKD)
    find_package(Qca-qt5 CONFIG REQUIRED)
endif (ENABLE_WKD)

# set default configuration values
set(DEFVAL_ACC_PWMETHOD 1 CACHE INTERNAL "Default accounts password method")
set(DEFVAL_ACC_PWALGORITHM 0 CACHE INTERNAL "Default accounts password algorithm")
set(DEFVAL_ACC_PWROUNDS 32000 CACHE INTERNAL "Default accounts password iteration count")
set(DEFVAL_ACC_PWMINLENGTH 8 CACHE INTERNAL "Default accounts password minimum length")
set(DEFVAL_ACC_PWTHRESHOLD 30 CACHE INTERNAL "Default accounts password quality threshold")
set(DEFVAL_ADM_PWALGORITHM 4 CACHE INTERNAL "Default admin password algorithm")
set(DEFVAL_ADM_PWROUNDS 32000 CACHE INTERNAL "Default admin password iteration count")
set(DEFVAL_ADM_PWMINLENGTH 8 CACHE INTERNAL "Default admin password minimum length")
set(DEFVAL_ADM_PWTHRESHOLD 50 CACHE INTERNAL "Default admin password quality threshold")
set(DEFVAL_DEF_DOMAINQUOTA 0 CACHE INTERNAL "Default domain quota for new domains in KiB")
set(DEFVAL_DEF_LANGUAGE "en_US" CACHE INTERNAL "Default language")
set(DEFVAL_DEF_MAXACCOUNTS 1000 CACHE INTERNAL "Default maximum accounts for new domains")
set(DEFVAL_DEF_QUOTA 102400 CACHE INTERNAL "Default quota for new accounts in KiB")
set(DEFVAL_DEF_TIMEZONE "UTC" CACHE INTERNAL "Default timezone")
set(DEFVAL_DEF_WARNLEVEL 90 CACHE INTERNAL "Default warn level for domain quota in percent")
set(DEFVAL_DEF_MAXDISPLAY 25 CACHE INTERNAL "Default value for displaying list entries")
set(DEFVAL_IMAP_PROTOCOL 2 CACHE INTERNAL "Default protocol for the IMAP connection")
set(DEFVAL_IMAP_ENCRYPTION 1 CACHE INTERNAL "Encryption layer for the IMAP connection")
set(DEFVAL_IMAP_CREATEMAILBOX 3 CACHE INTERNAL "Strategy to create new mailboxes on the IMAP server")
set(DEFVAL_IMAP_UNIXHIERARCHYSEP false CACHE INTERNAL "Default value for unix hierarchy separator")
set(DEFVAL_IMAP_DOMAINASPREFIX false CACHE INTERNAL "Default value for domain as prefix")
set(DEFVAL_IMAP_FQUN false CACHE INTERNAL "Default value for fqun")
set(DEFVAL_TMPL_ASYNCACCOUNTLIST false CACHE INTERNAL "Default value for async account list")

configure_file(common/config.h.in ${CMAKE_BINARY_DIR}/common/config.h)

find_program(LRELEASE_CMD_PATH NAMES lrelease-qt5 lrelease)
set(LRELEASE_CMD ${LRELEASE_CMD_PATH})
if(LRELEASE_CMD)
    message(STATUS "Found lrelease at ${LRELEASE_CMD}")
    message(STATUS "Translations are enabled")

    set(LANGS de)

else(LRELEASE_CMD)
    message(WARNING "lrelease executable cannot be found")
    message(WARNING "Translations are disabled")
endif(LRELEASE_CMD)

install(FILES contribute.json DESTINATION ${APPDIR}/static)

add_subdirectory(src)
add_subdirectory(sql)
add_subdirectory(cmd)
add_subdirectory(templates)
add_subdirectory(doc)
add_subdirectory(l10n)
add_subdirectory(grantlee)

{'fraction_non_alphanumeric': 0.07248816412414519, 'fraction_numerical': 0.01409784324039979, 'mean_word_length': 8.256085686465433, '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': '3044646', 'n_tokens_mistral': 3372, 'n_tokens_neox': 3059, 'n_words': 863}