-
Notifications
You must be signed in to change notification settings - Fork 26
/
CMakeLists.txt
47 lines (41 loc) · 1.57 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
# SPDX-FileCopyrightText: 2022 Uniontech Software Technology Co.,Ltd.
#
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.13)
set (DTK_VERSION "5.6.12" CACHE STRING "define project version")
project(dtkcommon
VERSION ${DTK_VERSION}
DESCRIPTION "DTK common"
HOMEPAGE_URL "https://github.com/linuxdeepin/dtkcommon"
)
message(STATUS "Project version: ${PROJECT_VERSION}")
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX /usr)
endif ()
include(GNUInstallDirs)
install(DIRECTORY configs DESTINATION "share/dsg" FILES_MATCHING PATTERN "*")
set(VERSION_SUFFIX)
configure_file(
"${CMAKE_SOURCE_DIR}/misc/config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/DtkConfig.cmake"
@ONLY
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/DtkConfig.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Dtk")
set(VERSION_SUFFIX 6)
configure_file(
"${CMAKE_SOURCE_DIR}/misc/config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/Dtk6Config.cmake"
@ONLY
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Dtk6Config.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Dtk6")
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/DtkBuildHelperConfigVersion.cmake"
VERSION ${DTK_VERSION}
COMPATIBILITY SameMajorVersion
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/DtkBuildHelperConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/DtkBuildHelper")
install(FILES "${CMAKE_SOURCE_DIR}/cmake/DtkBuildHelper.cmake"
RENAME "DtkBuildHelperConfig.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/DtkBuildHelper")