CMakeLists.txt 3.1 KB
Newer Older
1
2
3
# SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: BSD-3-Clause

4
cmake_minimum_required(VERSION 3.5)
5
6

# KDE Application Version, managed by release script
7
8
9
set (RELEASE_SERVICE_VERSION_MAJOR "20")
set (RELEASE_SERVICE_VERSION_MINOR "11")
set (RELEASE_SERVICE_VERSION_MICRO "80")
10
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
11
project(KOSMIndoorMap VERSION ${RELEASE_SERVICE_VERSION})
12
13

find_package(ECM 5.59 REQUIRED NO_MODULE)
14
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
15
16
17
18
19
20
21
22
23
24
25

include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMAddTests)
include(ECMGenerateHeaders)
include(ECMQtDeclareLoggingCategory)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(GenerateExportHeader)

Nicolas Fella's avatar
Nicolas Fella committed
26
27
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
28
29
30
31
32
33
34
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
ecm_setup_version(PROJECT VARIABLE_PREFIX KOSMINDOORMAP
    VERSION_HEADER kosmindoormap_version.h
    PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KOSMIndoorMapConfigVersion.cmake"
)

Nicolas Fella's avatar
Nicolas Fella committed
35
find_package(Qt5 5.11 REQUIRED COMPONENTS Quick)
Volker Krause's avatar
Volker Krause committed
36
find_package(KF5 REQUIRED COMPONENTS I18n)
37
find_package(KPublicTransport REQUIRED)
Nicolas Fella's avatar
Nicolas Fella committed
38
39
40
41
42

if (BUILD_TESTING)
    find_package(Qt5 5.11 REQUIRED COMPONENTS Test Widgets)
endif()

43
find_package(ZLIB REQUIRED)
44
45
46
find_package(OsmTools)
set_package_properties(OsmTools PROPERTIES TYPE OPTIONAL PURPOSE "Needed only for regenereating line metadata tables (ie. you most likely don't need this)")

Volker Krause's avatar
Volker Krause committed
47
48
49
50
find_package(FLEX REQUIRED)
set_package_properties(FLEX PROPERTIES PURPOSE "MapCSS parser for indoor map rendering.")
find_package(BISON REQUIRED)
set_package_properties(BISON PROPERTIES PURPOSE "MapCSS parser for indoor map rendering.")
51

52
53
54
55
if (NOT WIN32)
    find_package(Protobuf)
    set_package_properties(Protobuf PROPERTIES TYPE OPTIONAL PURPOSE "Parsing of OSM PBF files.")
endif()
Volker Krause's avatar
Volker Krause committed
56

57
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
58
59
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00)
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054400)
60
61
62
63
endif()

add_definitions(-DQT_NO_FOREACH)
add_subdirectory(src)
Nicolas Fella's avatar
Nicolas Fella committed
64
65
66
67
68

if (BUILD_TESTING)
    add_subdirectory(autotests)
    add_subdirectory(tests)
endif()
69
70
71

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)

72
73
74
75
76
77
78
79
80
81
82
83
84
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KOSMIndoorMap")
configure_package_config_file(
    "${CMAKE_CURRENT_SOURCE_DIR}/KOSMIndoorMapConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/KOSMIndoorMapConfig.cmake"
    INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
)

install(FILES
        "${CMAKE_CURRENT_BINARY_DIR}/KOSMIndoorMapConfig.cmake"
        "${CMAKE_CURRENT_BINARY_DIR}/KOSMIndoorMapConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    COMPONENT Devel
)
85
install(EXPORT KOSMIndoorMapTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KOSMIndoorMapTargets.cmake)
86

87
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kosmindoormap_version.h DESTINATION ${KDE_INSTALL_INCLUDEDIR} COMPONENT Devel)