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

4
5
6
7
cmake_minimum_required(VERSION 3.5)
project(KOSMIndoorMap VERSION 0.0.1)

find_package(ECM 5.59 REQUIRED NO_MODULE)
8
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
9
10
11
12
13
14
15
16
17
18
19

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
20
21
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
22
23
24
25
26
27
28
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
29
find_package(Qt5 5.11 REQUIRED COMPONENTS Quick)
30
find_package(KPublicTransport REQUIRED)
Nicolas Fella's avatar
Nicolas Fella committed
31
32
33
34
35

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

36
find_package(ZLIB REQUIRED)
37
38
39
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)")

40
41
42
43
44
find_package(FLEX)
set_package_properties(FLEX PROPERTIES TYPE RECOMMENDED PURPOSE "MapCSS parser for indoor map rendering.")
find_package(BISON)
set_package_properties(BISON PROPERTIES TYPE RECOMMENDED PURPOSE "MapCSS parser for indoor map rendering.")

45
46
47
48
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
49

50
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
51
52
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00)
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054400)
53
54
55
56
endif()

add_definitions(-DQT_NO_FOREACH)
add_subdirectory(src)
Nicolas Fella's avatar
Nicolas Fella committed
57
58
59
60
61

if (BUILD_TESTING)
    add_subdirectory(autotests)
    add_subdirectory(tests)
endif()
62
63
64
65

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)

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