<commit_before># disable MySQL/Embedded plugin for now since it is unused and causes linker problems on Debian based 64bit systems
# macro_optional_find_package(MySQL)
# macro_log_feature(MYSQL_EMBEDDED_FOUND "mysql-embedded" "MySQL/Embedded Library" "http://www.mysql.org" FALSE "" "Needed for the MySQL/Embedded Akonadi backend. Sqlite will be used instead.")
#
# macro_optional_find_package(OpenSSL)
# macro_log_feature(OPENSSL_FOUND "OpenSSL" "A toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols" "http://openssl.org" FALSE "" "Required for building the Akonadi SQL plugin with MySQL embedded.")

find_program( MYSQLD_EXECUTABLE mysqld /usr/sbin /usr/local/sbin /usr/libexec )
macro_log_feature( MYSQLD_EXECUTABLE "MySQL Server" "Database server" "http://www.mysql.com" FALSE ""
                   "Akonadi server requires the mysqld binary" )

include_directories( ${CMAKE_BINARY_DIR}/akonadi )
include_directories( ${CMAKE_SOURCE_DIR}/akonadi )
# needed for akonadi_export.h
include_directories( ${CMAKE_SOURCE_DIR}/akonadi/libakonadi )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/src )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/src/handler )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
include_directories( ${QT_QTDBUS_INCLUDE_DIR} )

add_subdirectory( akonadictl )
add_subdirectory( control )
add_subdirectory( src )
# if (MYSQL_EMBEDDED_FOUND AND OPENSSL_FOUND)
#   add_subdirectory( sqlplugin )
# endif (MYSQL_EMBEDDED_FOUND AND OPENSSL_FOUND)
#add_subdirectory( queryserver )
add_subdirectory( tests )

set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS} -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII" )
if ( MYSQLD_EXECUTABLE )
  set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMYSQLD_EXECUTABLE=\"\\\"${MYSQLD_EXECUTABLE}\\\"\"" )
endif ( MYSQLD_EXECUTABLE )

########### next target ###############

add_custom_command(
  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/entities.h
         ${CMAKE_CURRENT_BINARY_DIR}/entities.cpp
  COMMAND ${XSLTPROC_EXECUTABLE} --stringparam code header
          ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/entities.xsl
          ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/akonadidb.xml
          > ${CMAKE_CURRENT_BINARY_DIR}/entities.h
  COMMAND ${XSLTPROC_EXECUTABLE} --stringparam code source
          ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/entities.xsl
          ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/akonadidb.xml
          > ${CMAKE_CURRENT_BINARY_DIR}/entities.cpp
  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/entities.xsl
          ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/entities-header.xsl
          ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/entities-source.xsl
          ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/akonadidb.xml
)

set(libakonadiprivate_SRCS
  src/akonadi.cpp
  src/akonadiconnection.cpp
  src/handler.cpp
  src/handlerhelper.cpp
  src/intervalcheck.cpp
  src/response.cpp
  src/handler/aklist.cpp
  src/handler/akappend.cpp
  src/handler/append.cpp
  src/handler/copy.cpp
  src/handler/colcopy.cpp
  src/handler/create.cpp
  src/handler/capability.cpp
  src/handler/delete.cpp
  src/handler/expunge.cpp
  src/handler/fetch.cpp
  src/handler/list.cpp
  src/handler/login.cpp
  src/handler/logout.cpp
  src/handler/modify.cpp
  src/handler/noop.cpp
  src/handler/rename.cpp
  src/handler/searchhelper.cpp
  src/handler/searchpersistent.cpp
  src/handler/select.cpp
  src/handler/subscribe.cpp
  src/handler/status.cpp
  src/handler/store.cpp
  src/handler/transaction.cpp
  src/handler/uid.cpp
  src/storage/entity.cpp
  ${CMAKE_CURRENT_BINARY_DIR}/entities.cpp
  src/storage/datastore.cpp
  src/storage/dbinitializer.cpp
  src/storage/dbupdater.cpp
  src/storage/notificationcollector.cpp
  src/storage/query.cpp
  src/storage/querybuilder.cpp
  src/storage/transaction.cpp
  src/tracer.cpp
  src/dbustracer.cpp
  src/filetracer.cpp
  src/notificationmanager.cpp
  src/resourcemanager.cpp
  src/cachecleaner.cpp
  src/xesammanager.cpp
)

qt4_add_dbus_adaptor( libakonadiprivate_SRCS interfaces/org.kde.Akonadi.TracerNotification.xml dbustracer.h Akonadi::DBusTracer )
qt4_add_dbus_adaptor( libakonadiprivate_SRCS ${KDEPIMLIBS4_DBUS_INTERFACES_DIR}/org.kde.Akonadi.Tracer.xml tracer.h Akonadi::Tracer
)
qt4_add_dbus_adaptor( libakonadiprivate_SRCS ${KDEPIMLIBS4_DBUS_INTERFACES_DIR}/org.kde.Akonadi.NotificationManager.xml notificationmanager.h Akonadi::NotificationManager )

qt4_add_dbus_adaptor( libakonadiprivate_SRCS interfaces/org.kde.Akonadi.Server.xml akonadi.h Akonadi::AkonadiServer )

qt4_add_dbus_interfaces( libakonadiprivate_SRCS ${KDEPIMLIBS4_DBUS_INTERFACES_DIR}/org.kde.Akonadi.AgentManager.xml ${KDEPIMLIBS4_DBUS_INTERFACES_DIR}/org.kde.Akonadi.Resource.xml )

qt4_add_dbus_interface2( libakonadiprivate_SRCS interfaces/org.freedesktop.xesam.Search.xml xesaminterface xesamtypes.h )

qt4_add_resources( libakonadiprivate_SRCS src/storage/akonadidb.qrc )


kde4_add_library( akonadiprivate SHARED ${libakonadiprivate_SRCS} )
target_link_libraries( akonadiprivate
  ${QT_QTCORE_LIBRARY}
  ${QT_QTNETWORK_LIBRARY}
  ${QT_QTSQL_LIBRARY}
  ${QT_QTDBUS_LIBRARY}
  ${QT_QTXML_LIBRARY}
  ${KDE4_KDECORE_LIBRARY}
  ${KDEWIN32_LIBRARY}
  akonadiprotocolinternals
)
set_target_properties( akonadiprivate PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
install( TARGETS akonadiprivate DESTINATION ${LIB_INSTALL_DIR} )

set( akonadiserver_bin_SRCS src/main.cpp control/kcrash.cpp )


kde4_add_executable( akonadiserver_bin NOGUI ${akonadiserver_bin_SRCS} )
set_target_properties( akonadiserver_bin PROPERTIES OUTPUT_NAME akonadiserver )
target_link_libraries( akonadiserver_bin akonadiprivate )

install( TARGETS akonadiserver_bin DESTINATION ${BIN_INSTALL_DIR} )
install( FILES src/storage/mysql-global.conf DESTINATION ${CONFIG_INSTALL_DIR}/akonadi/ )<commit_msg>QT4_ADD_DBUS_INTERFACE2 is not necessary QT4_ADD_DBUS_INTERFACE works fine (use set_source_file_properties)<commit_after># disable MySQL/Embedded plugin for now since it is unused and causes linker problems on Debian based 64bit systems
# macro_optional_find_package(MySQL)
# macro_log_feature(MYSQL_EMBEDDED_FOUND "mysql-embedded" "MySQL/Embedded Library" "http://www.mysql.org" FALSE "" "Needed for the MySQL/Embedded Akonadi backend. Sqlite will be used instead.")
#
# macro_optional_find_package(OpenSSL)
# macro_log_feature(OPENSSL_FOUND "OpenSSL" "A toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols" "http://openssl.org" FALSE "" "Required for building the Akonadi SQL plugin with MySQL embedded.")

find_program( MYSQLD_EXECUTABLE mysqld /usr/sbin /usr/local/sbin /usr/libexec )
macro_log_feature( MYSQLD_EXECUTABLE "MySQL Server" "Database server" "http://www.mysql.com" FALSE ""
                   "Akonadi server requires the mysqld binary" )

include_directories( ${CMAKE_BINARY_DIR}/akonadi )
include_directories( ${CMAKE_SOURCE_DIR}/akonadi )
# needed for akonadi_export.h
include_directories( ${CMAKE_SOURCE_DIR}/akonadi/libakonadi )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/src )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/src/handler )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
include_directories( ${QT_QTDBUS_INCLUDE_DIR} )

add_subdirectory( akonadictl )
add_subdirectory( control )
add_subdirectory( src )
# if (MYSQL_EMBEDDED_FOUND AND OPENSSL_FOUND)
#   add_subdirectory( sqlplugin )
# endif (MYSQL_EMBEDDED_FOUND AND OPENSSL_FOUND)
#add_subdirectory( queryserver )
add_subdirectory( tests )

set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS} -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII" )
if ( MYSQLD_EXECUTABLE )
  set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMYSQLD_EXECUTABLE=\"\\\"${MYSQLD_EXECUTABLE}\\\"\"" )
endif ( MYSQLD_EXECUTABLE )

########### next target ###############

add_custom_command(
  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/entities.h
         ${CMAKE_CURRENT_BINARY_DIR}/entities.cpp
  COMMAND ${XSLTPROC_EXECUTABLE} --stringparam code header
          ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/entities.xsl
          ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/akonadidb.xml
          > ${CMAKE_CURRENT_BINARY_DIR}/entities.h
  COMMAND ${XSLTPROC_EXECUTABLE} --stringparam code source
          ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/entities.xsl
          ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/akonadidb.xml
          > ${CMAKE_CURRENT_BINARY_DIR}/entities.cpp
  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/entities.xsl
          ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/entities-header.xsl
          ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/entities-source.xsl
          ${CMAKE_CURRENT_SOURCE_DIR}/src/storage/akonadidb.xml
)

set(libakonadiprivate_SRCS
  src/akonadi.cpp
  src/akonadiconnection.cpp
  src/handler.cpp
  src/handlerhelper.cpp
  src/intervalcheck.cpp
  src/response.cpp
  src/handler/aklist.cpp
  src/handler/akappend.cpp
  src/handler/append.cpp
  src/handler/copy.cpp
  src/handler/colcopy.cpp
  src/handler/create.cpp
  src/handler/capability.cpp
  src/handler/delete.cpp
  src/handler/expunge.cpp
  src/handler/fetch.cpp
  src/handler/list.cpp
  src/handler/login.cpp
  src/handler/logout.cpp
  src/handler/modify.cpp
  src/handler/noop.cpp
  src/handler/rename.cpp
  src/handler/searchhelper.cpp
  src/handler/searchpersistent.cpp
  src/handler/select.cpp
  src/handler/subscribe.cpp
  src/handler/status.cpp
  src/handler/store.cpp
  src/handler/transaction.cpp
  src/handler/uid.cpp
  src/storage/entity.cpp
  ${CMAKE_CURRENT_BINARY_DIR}/entities.cpp
  src/storage/datastore.cpp
  src/storage/dbinitializer.cpp
  src/storage/dbupdater.cpp
  src/storage/notificationcollector.cpp
  src/storage/query.cpp
  src/storage/querybuilder.cpp
  src/storage/transaction.cpp
  src/tracer.cpp
  src/dbustracer.cpp
  src/filetracer.cpp
  src/notificationmanager.cpp
  src/resourcemanager.cpp
  src/cachecleaner.cpp
  src/xesammanager.cpp
)

qt4_add_dbus_adaptor( libakonadiprivate_SRCS interfaces/org.kde.Akonadi.TracerNotification.xml dbustracer.h Akonadi::DBusTracer )
qt4_add_dbus_adaptor( libakonadiprivate_SRCS ${KDEPIMLIBS4_DBUS_INTERFACES_DIR}/org.kde.Akonadi.Tracer.xml tracer.h Akonadi::Tracer
)
qt4_add_dbus_adaptor( libakonadiprivate_SRCS ${KDEPIMLIBS4_DBUS_INTERFACES_DIR}/org.kde.Akonadi.NotificationManager.xml notificationmanager.h Akonadi::NotificationManager )

qt4_add_dbus_adaptor( libakonadiprivate_SRCS interfaces/org.kde.Akonadi.Server.xml akonadi.h Akonadi::AkonadiServer )

qt4_add_dbus_interfaces( libakonadiprivate_SRCS ${KDEPIMLIBS4_DBUS_INTERFACES_DIR}/org.kde.Akonadi.AgentManager.xml ${KDEPIMLIBS4_DBUS_INTERFACES_DIR}/org.kde.Akonadi.Resource.xml )

set(xesam_xml  interfaces/org.freedesktop.xesam.Search.xml)

SET_SOURCE_FILES_PROPERTIES(${xesam_xml} PROPERTIES INCLUDE "xesamtypes.h")

qt4_add_dbus_interface( libakonadiprivate_SRCS ${xesam_xml} xesaminterface )

qt4_add_resources( libakonadiprivate_SRCS src/storage/akonadidb.qrc )


kde4_add_library( akonadiprivate SHARED ${libakonadiprivate_SRCS} )
target_link_libraries( akonadiprivate
  ${QT_QTCORE_LIBRARY}
  ${QT_QTNETWORK_LIBRARY}
  ${QT_QTSQL_LIBRARY}
  ${QT_QTDBUS_LIBRARY}
  ${QT_QTXML_LIBRARY}
  ${KDE4_KDECORE_LIBRARY}
  ${KDEWIN32_LIBRARY}
  akonadiprotocolinternals
)
set_target_properties( akonadiprivate PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
install( TARGETS akonadiprivate DESTINATION ${LIB_INSTALL_DIR} )

set( akonadiserver_bin_SRCS src/main.cpp control/kcrash.cpp )


kde4_add_executable( akonadiserver_bin NOGUI ${akonadiserver_bin_SRCS} )
set_target_properties( akonadiserver_bin PROPERTIES OUTPUT_NAME akonadiserver )
target_link_libraries( akonadiserver_bin akonadiprivate )

install( TARGETS akonadiserver_bin DESTINATION ${BIN_INSTALL_DIR} )
install( FILES src/storage/mysql-global.conf DESTINATION ${CONFIG_INSTALL_DIR}/akonadi/ )
{'fraction_non_alphanumeric': 0.09952488122030508, 'fraction_numerical': 0.004001000250062516, 'mean_word_length': 5.751828925154755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 23}, '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': '76880', 'n_tokens_mistral': 4595, 'n_tokens_neox': 4448, 'n_words': 611}