KF5_MIN_VERSION was being defined *after* being used

This commit is contained in:
Albert Vaca Cintora 2019-07-23 00:28:02 +02:00
parent e812a31c40
commit dedb4b1ed2

View file

@ -2,6 +2,16 @@ cmake_minimum_required(VERSION 3.0)
project(kdeconnect)
if (SAILFISHOS)
set(KF5_MIN_VERSION "5.31.0")
set(QT_MIN_VERSION "5.6.0")
set(QCA_MIN_VERSION "2.0.0")
else()
set(KF5_MIN_VERSION "5.48.0")
set(QT_MIN_VERSION "5.10.0")
set(QCA_MIN_VERSION "2.1.0")
endif()
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
@ -23,25 +33,19 @@ ecm_setup_version(1.3.3
if (SAILFISHOS)
find_package(PkgConfig)
set(KF5_MIN_VERSION "5.31.0")
set(QT_MIN_VERSION "5.6.0")
set(KF5_REQUIRED_COMPONENTS I18n DBusAddons CoreAddons IconThemes Config)
set(KF5_OPTIONAL_COMPONENTS)
set(QCA_MIN_VERSION 2.0.0)
pkg_search_module(SFOS REQUIRED sailfishapp)
pkg_check_modules(QCA2 qca2-qt5>=${QCA_MIN_VERSION} REQUIRED)
add_definitions(-DSAILFISHOS)
include_directories(${QCA2_INCLUDEDIR})
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
else()
set(KF5_MIN_VERSION "5.48.0")
set(QT_MIN_VERSION "5.10.0")
set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Kirigami2)
set(KF5_OPTIONAL_COMPONENTS DocTools)
if(UNIX AND NOT APPLE)
set(KF5_OPTIONAL_COMPONENTS ${KF5_OPTIONAL_COMPONENTS} Runner)
endif()
set(QCA_MIN_VERSION "2.1.0")
find_package(Qca-qt5 ${QCA_MIN_VERSION} REQUIRED)
if(NOT WIN32 AND NOT APPLE)
find_package(KF5PulseAudioQt REQUIRED)