-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
74 lines (57 loc) · 2.96 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# SPDX-FileCopyrightText: (C) 2016-2022 Matthias Fehring / www.huessenbergnetz.de
# SPDX-License-Identifier: GPL-3.0-or-later
cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
cmake_policy(SET CMP0048 NEW)
project(fuoten
VERSION 0.8.1
DESCRIPTION "Qt based client for the Nextcloud News Application"
HOMEPAGE_URL "https://github.com/Huessenbergnetz/Fuoten"
LANGUAGES CXX)
# Auto generate moc files
set(CMAKE_AUTOMOC ON)
# As moc files are generated in the binary dir, tell CMake
# to always look for includes there:
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Forbid in-tree building
if(${CMAKE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR})
message(STATUS "Please do an out-of-tree build:")
message(STATUS "rm -f CMakeCache.txt && mkdir build && cd build; cmake .. && make")
message(FATAL_ERROR "In-tree-build detected!")
endif(${CMAKE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR})
include(GNUInstallDirs)
include(FindPkgConfig)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Fuoten default install prefix" FORCE)
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
option(ENABLE_MAINTAINER_FLAGS "Enables some build flags used for development" OFF)
set(TARGETSYSTEM "sfos" CACHE STRING "Target system to build the application for, currently supported: sfos, kirigami")
if(${TARGETSYSTEM} STREQUAL "sfos")
message(STATUS "Building Fuoten for SailfishOS")
find_package(Qt5 COMPONENTS Core Quick Network Sql DBus LinguistTools REQUIRED)
set(HBNSC_APPNAME "harbour-fuoten" CACHE STRING "Name of the application the HBN SFOS Components are used for. Used for installation values.")
set(FUOTEN_EXE_OUTPUT_NAME ${HBNSC_APPNAME})
set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_DATADIR}/${FUOTEN_EXE_OUTPUT_NAME}/lib)
set(HBNSC_WITH_OPENSSL ON)
set(HBNSC_WITH_NEMONOTIFY ON)
set(HBNSC_WITH_FIRFUORIDA OFF)
set(HBNSC_WITH_SQLITE ON)
set(HBNSC_WITH_DBUS ON)
set(FUOTEN_I18NDIR "${CMAKE_INSTALL_DATADIR}/${FUOTEN_EXE_OUTPUT_NAME}/translations")
set(FUOTEN_QMLDIR "${CMAKE_INSTALL_DATADIR}/${FUOTEN_EXE_OUTPUT_NAME}/qml")
set(LIBFUOTEN_I18NDIR "${FUOTEN_I18NDIR}" CACHE PATH "Directory to install translations")
set(FUOTEN_AES256_KEY "" CACHE STRING "32 charachter (32 byte) long encryption key used for AES256 encryption of the password, if you change this key, passwords stored with old keys are not readable anymore")
if(NOT ${FUOTEN_AES256_KEY} MATCHES "[a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9]+")
message(FATAL_ERROR "Invalid FUOTEN_AES256_KEY variable")
endif()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/HBN_SFOS_Cmake)
add_subdirectory(libfuoten)
add_subdirectory(HBN_SFOS_Cmake)
add_subdirectory(HBN_SFOS_Components)
add_subdirectory(sailfishos)
add_custom_target(specfiles
SOURCES
rpm/harbour-fuoten.changes
rpm/harbour-fuoten.spec
rpm/harbour-fuoten.yaml
)
endif(${TARGETSYSTEM} STREQUAL "sfos")