From 1d7f24fe572cbeb68ee241c850cd01389005312b Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Tue, 20 Oct 2020 16:07:26 +0200 Subject: [PATCH] Misc cmake cleanup Remove some unneeded things. Set C++ version to 17. Set somewhat sensible min versions for Qt and KF5 Pass version and languages to project() --- CMakeLists.txt | 13 ++++++++----- plugins/nextcloud-ui/CMakeLists.txt | 8 ++------ plugins/owncloud-ui/CMakeLists.txt | 13 +------------ 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12eb336..441867c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,3 @@ -project(kde-account-providers) - cmake_minimum_required(VERSION 3.5) set(RELEASE_SERVICE_VERSION_MAJOR "20") @@ -7,11 +5,16 @@ set(RELEASE_SERVICE_VERSION_MINOR "11") set(RELEASE_SERVICE_VERSION_MICRO "70") set(KACCOUNTS_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}") -set(QT_REQUIRED_VERSION "5.2.0") -set(KF5_MIN_VERSION "5.4.0") +project(kde-account-providers LANGUAGES CXX VERSION ${KACCOUNTS_VERSION}) + +set(QT_REQUIRED_VERSION "5.12.0") +set(KF5_MIN_VERSION "5.70.0") + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) -set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${ECM_MODULE_PATH}) find_package(Intltool REQUIRED) find_package(KAccounts REQUIRED) diff --git a/plugins/nextcloud-ui/CMakeLists.txt b/plugins/nextcloud-ui/CMakeLists.txt index 62d80a8..7976222 100644 --- a/plugins/nextcloud-ui/CMakeLists.txt +++ b/plugins/nextcloud-ui/CMakeLists.txt @@ -1,10 +1,6 @@ -set(nextcloud_plugin_kaccounts_SRCS - nextcloud.cpp - nextcloudcontroller.cpp -) - add_library(nextcloud_plugin_kaccounts MODULE - ${nextcloud_plugin_kaccounts_SRCS} + nextcloud.cpp + nextcloudcontroller.cpp ) target_link_libraries(nextcloud_plugin_kaccounts diff --git a/plugins/owncloud-ui/CMakeLists.txt b/plugins/owncloud-ui/CMakeLists.txt index a73c640..e061ff9 100644 --- a/plugins/owncloud-ui/CMakeLists.txt +++ b/plugins/owncloud-ui/CMakeLists.txt @@ -1,27 +1,16 @@ -include_directories(${CMAKE_CURRENT_BUILD_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} -) - -set(owncloud_plugin_kaccounts_SRCS +add_library(owncloud_plugin_kaccounts MODULE owncloud.cpp owncloudcontroller.cpp ) -add_library(owncloud_plugin_kaccounts MODULE - ${owncloud_plugin_kaccounts_SRCS} -) - target_link_libraries(owncloud_plugin_kaccounts Qt5::Core KF5::KIOCore KF5::I18n KF5::Declarative KAccounts - ${ACCOUNTSQT_LIBRARIES} - ${SIGNONQT_LIBRARIES} ) -# Install: install(TARGETS owncloud_plugin_kaccounts DESTINATION ${PLUGIN_INSTALL_DIR}/kaccounts/ui ) -- GitLab