CMakeLists.txt 3.2 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 "21")
set (RELEASE_SERVICE_VERSION_MINOR "03")
set (RELEASE_SERVICE_VERSION_MICRO "70")
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
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"
Volker Krause's avatar
Volker Krause committed
33
    SOVERSION 1
34
35
)

36
find_package(Qt5 5.14 REQUIRED COMPONENTS Quick)
Volker Krause's avatar
Volker Krause committed
37
find_package(KF5 REQUIRED COMPONENTS I18n)
38
find_package(KPublicTransport REQUIRED)
39
40
find_package(KOpeningHours)
set_package_properties(KOpeningHours PROPERTIES TYPE OPTIONAL PURPOSE "Highlight currently open amenities/shops/etc.")
Nicolas Fella's avatar
Nicolas Fella committed
41
42

if (BUILD_TESTING)
43
    find_package(Qt5 5.14 REQUIRED COMPONENTS Test Widgets)
Nicolas Fella's avatar
Nicolas Fella committed
44
45
endif()

46
find_package(ZLIB REQUIRED)
47
48
49
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
50
51
52
53
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.")
54

55
56
57
58
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
59

60
61
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054400)
62
add_definitions(-DQT_NO_FOREACH)
Nicolas Fella's avatar
Nicolas Fella committed
63

64
add_subdirectory(src)
Nicolas Fella's avatar
Nicolas Fella committed
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)