Commit 0dc2f857 authored by Ömer Fadıl Usta's avatar Ömer Fadıl Usta 😊

Fix Boot dependency problems and cleanup old configs

* Cmake min version requirements increased to 3.5
* Boost min version requirements increased to 1.58
* Cleanup the parts about boost's old version problems
* Cleanup the parts about old cpp11 (we already using cpp17)
parent 048acb76
# vim:set softtabstop=3 shiftwidth=3 tabstop=3 expandtab:
cmake_minimum_required (VERSION 3.0)
cmake_minimum_required (VERSION 3.5)
project (KActivityManagerd)
option (KACTIVITIES_ENABLE_EXCEPTIONS "If you have Boost 1.53, you need to build KActivities with exceptions enabled. This is UNTESTED and EXPERIMENTAL!" OFF)
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.74")
set (QT_MIN_VERSION "5.15.0")
set (KF5_MIN_VERSION "5.74")
set (Boost_MINIMUM_VERSION "1.58")
# We don't build in-source
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
......@@ -20,9 +19,13 @@ endif ()
set (KACTIVITIES_CURRENT_ROOT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
# Extra CMake stuff
include(FeatureSummary)
include (FeatureSummary)
find_package(ECM ${KF5_MIN_VERSION} NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules")
set_package_properties(ECM PROPERTIES
DESCRIPTION "Extra CMake Modules."
URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules"
TYPE REQUIRED
)
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
......@@ -36,7 +39,7 @@ include (ECMGenerateDBusServiceFile)
include (ECMGenerateHeaders)
include (ECMQtDeclareLoggingCategory)
include (ECMSetupQtPluginMacroNames)
include(KDEClangFormat)
include (KDEClangFormat)
# C++17
set (CMAKE_CXX_STANDARD 17)
......@@ -69,17 +72,16 @@ if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
endif ()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_VISIBILITY_PRESET default)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 0)
set (CMAKE_CXX_VISIBILITY_PRESET default)
set (CMAKE_VISIBILITY_INLINES_HIDDEN 0)
endif ()
add_subdirectory (src)
# add clang-format target for all our real source files
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
file (GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
install(FILES kactivitymanagerd.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
install (FILES kactivitymanagerd.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
# Write out the features
feature_summary (WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -2,24 +2,13 @@
# Boosting us a bit
find_package (Boost 1.49 REQUIRED)
include_directories (${Boost_INCLUDE_DIR})
string (REGEX MATCH "1053.." BOOST_VERSION_BLACKLISTED ${Boost_VERSION})
if (BOOST_VERSION_BLACKLISTED AND NOT KACTIVITIES_ENABLE_EXCEPTIONS)
message (
WARNING
"Boost.Container 1.53 has issues when exceptions are disabled. "
"We will set the KACTIVITIES_ENABLE_EXCEPTIONS option."
)
set (KACTIVITIES_ENABLE_EXCEPTIONS ON)
endif ()
if (KACTIVITIES_ENABLE_EXCEPTIONS)
string (REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
add_definitions (-fexceptions)
endif ()
find_package(Boost ${Boost_MINIMUM_VERSION} MODULE REQUIRED)
set_package_properties(Boost PROPERTIES
DESCRIPTION "Boost C++ Libraries"
URL "https://www.boost.org"
TYPE REQUIRED
)
include_directories (${Boost_INCLUDE_DIRS})
# =======================================================
# Starting the actual project definition
......@@ -35,25 +24,6 @@ include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
# Is the compiler modern enough to build the ActivityManager service
# and accompanying workspace addons?
string (COMPARE EQUAL "${CXX_FEATURES_UNSUPPORTED}" "" CXX_COMPILER_IS_MODERN)
# The compiler is good enough
if (CXX_COMPILER_IS_MODERN)
message (STATUS
"C++11 enabled compiler: Your compiler is state-of-the-art"
)
else ()
message (STATUS
"C++11 enabled compiler:"
"Your compiler doesn't support the following features: ${CXX_FEATURES_UNSUPPORTED} but
the list of the supported ones is sufficient for the build: ${CXX_FEATURES_SUPPORTED}"
)
endif ()
# D-Bus activation service file, and associated systemd service
ecm_generate_dbus_service_file(
NAME org.kde.ActivityManager
......@@ -85,4 +55,3 @@ ecm_qt_declare_logging_category(debug_SRCS
ecm_setup_qtplugin_macro_names(JSON_ARG3 "KAMD_EXPORT_PLUGIN")
add_subdirectory (service)
......@@ -4,10 +4,4 @@
#cmakedefine KAMD_PLUGIN_DIR "@KAMD_PLUGIN_DIR@"
#cmakedefine KAMD_FULL_PLUGIN_DIR "@KAMD_FULL_PLUGIN_DIR@"
#cmakedefine01 HAVE_CXX11_AUTO
#cmakedefine01 HAVE_CXX11_NULLPTR
#cmakedefine01 HAVE_CXX11_LAMBDA
#cmakedefine01 HAVE_CXX11_OVERRIDE
#cmakedefine01 HAVE_CXX_OVERRIDE_ATTR
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment