Commit 1982a51b authored by Nicolas Fella's avatar Nicolas Fella

Misc cmake cleanup

Remove some unneeded stuff. Condense calls where appropriate. Set C++ standard to 17 to follow other Plasma projects.
parent d4667ed2
......@@ -4,28 +4,22 @@ cmake_minimum_required(VERSION 2.8.12)
set(KF5_MIN_VERSION "5.74")
set(QT_MIN_VERSION "5.15.0")
################# Disallow in-source build #################
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "plymouthkcm requires an out of source build. Please create a separate build directory and run 'cmake path_to_kirigami [options]' there.")
message(FATAL_ERROR "plymouthkcm requires an out of source build. Please create a separate build directory and run 'cmake path_to_plymouth_kcm [options]' there.")
endif()
# Make CPack available to easy generate binary packages
include(CPack)
include(FeatureSummary)
################# set KDE specific information #################
set(PROJECT_VERSION "5.19.90")
set(PROJECT_VERSION_MAJOR 5)
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} )
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH})
include(FeatureSummary)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(KDEInstallDirs)
......@@ -33,25 +27,15 @@ include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDEClangFormat)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui )
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Archive NewStuff NewStuffCore KIO Declarative I18n Config ConfigWidgets)
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
################# Enable C++11 features for clang and gcc #################
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
endif()
################# now find all used packages #################
Archive NewStuff NewStuffCore KIO Declarative I18n Config)
find_package(Plymouth REQUIRED)
add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_URL_CAST_FROM_STRING)
add_subdirectory(src)
# add clang-format target for all our real source files
......@@ -59,4 +43,3 @@ file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -21,9 +21,6 @@ target_link_libraries(kcm_plymouth
KF5::NewStuffCore
KF5::ConfigCore
KF5::KIOCore
Qt5::Widgets
${X11_LIBRARIES}
)
kcoreaddons_desktop_to_json(kcm_plymouth "kcm_plymouth.desktop" SERVICE_TYPES kcmodule.desktop)
......
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