-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
60 lines (48 loc) · 2.01 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
cmake_minimum_required(VERSION 3.18.0 FATAL_ERROR)
# CMP0000: Call the cmake_minimum_required() command at the beginning of the top-level
# CMakeLists.txt file even before calling the project() command.
# The cmake_minimum_required(VERSION) command implicitly invokes the cmake_policy(VERSION)
# command to specify that the current project code is written for the given range of CMake
# versions.
project(qtxdg-tools)
set(QTXDG_TOOLS_MAJOR_VERSION 4)
set(QTXDG_TOOLS_MINOR_VERSION 1)
set(QTXDG_TOOLS_PATCH_VERSION 0)
set(QTXDG_TOOLS_VERSION_STRING ${QTXDG_TOOLS_MAJOR_VERSION}.${QTXDG_TOOLS_MINOR_VERSION}.${QTXDG_TOOLS_PATCH_VERSION})
set(LXQTBT_MINIMUM_VERSION "2.1.0")
set(QTXDG_MINIMUM_VERSION "4.1.0")
set(QT_MINIMUM_VERSION "6.6.0")
find_package(lxqt2-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
find_package(Qt6 ${QT_MINIMUM_VERSION} CONFIG REQUIRED Core)
find_package(Qt6Xdg ${QTXDG_MINIMUM_VERSION} REQUIRED)
include(GNUInstallDirs) # Standard directories for installation
include(FeatureSummary)
include(CMakePackageConfigHelpers)
include(GenerateExportHeader)
include(LXQtPreventInSourceBuilds)
include(LXQtCompilerSettings NO_POLICY_SCOPE)
set(CMAKE_AUTOMOC ON)
add_subdirectory(src)
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/qtxdg-tools-config.cmake.in"
"${CMAKE_BINARY_DIR}/qtxdg-tools-config.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/qtxdg-tools"
)
write_basic_package_version_file(
"${CMAKE_BINARY_DIR}/qtxdg-tools-config-version.cmake"
VERSION ${QTXDG_TOOLS_VERSION_STRING}
COMPATIBILITY AnyNewerVersion
)
install(FILES
"${CMAKE_BINARY_DIR}/qtxdg-tools-config.cmake"
"${CMAKE_BINARY_DIR}/qtxdg-tools-config-version.cmake"
DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/qtxdg-tools"
COMPONENT Devel
)
install(EXPORT
"qtxdg-tools-targets"
DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/qtxdg-tools"
FILE "qtxdg-tools-targets.cmake"
COMPONENT Devel
)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)