forked from qxmpp-project/qxmpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
82 lines (62 loc) · 2.03 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
75
76
77
78
79
80
81
# SPDX-FileCopyrightText: 2017 Niels Ole Salscheider <[email protected]>
#
# SPDX-License-Identifier: CC0-1.0
cmake_minimum_required(VERSION 3.3)
project(qxmpp VERSION 1.5.0)
set(SO_VERSION 4)
# C++ standard settings:
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/modules")
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network Xml)
find_package(Qt${QT_VERSION_MAJOR} 5.9.2 REQUIRED COMPONENTS Core Network Xml)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
include(GNUInstallDirs)
option(BUILD_TESTS "Build tests." ON)
option(BUILD_INTERNAL_TESTS "Build internal tests." OFF)
option(BUILD_DOCUMENTATION "Build API documentation." OFF)
option(BUILD_EXAMPLES "Build examples." ON)
option(WITH_GSTREAMER "Build with GStreamer support for Jingle" OFF)
add_definitions(
-DQT_DISABLE_DEPRECATED_BEFORE=0x050F00
-DQURL_NO_CAST_FROM_STRING
-DQT_NO_CAST_TO_ASCII
-DQT_NO_FOREACH
)
add_subdirectory(src)
if(BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
if(BUILD_DOCUMENTATION)
add_subdirectory(doc)
endif()
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
include(CMakePackageConfigHelpers)
configure_package_config_file(
QXmppConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/QXmppConfig.cmake
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/qxmpp"
)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/QXmppConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/QXmppConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/QXmppConfigVersion.cmake
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/qxmpp"
COMPONENT Devel
)
# Generate qxmpp.pc
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qxmpp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/qxmpp.pc @ONLY)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/qxmpp.pc
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
COMPONENT Devel
)