File: CMakeLists.txt

package info (click to toggle)
cmake-vala 3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 224 kB
  • sloc: makefile: 4
file content (79 lines) | stat: -rw-r--r-- 2,213 bytes parent folder | download | duplicates (2)
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
cmake_minimum_required (VERSION 3.3)
cmake_policy (VERSION 3.3)
project (VCM LANGUAGES NONE)
enable_testing ()
include(GNUInstallDirs)
include(FeatureSummary)

set(PROJECT_VERSION 1)

set(PACKAGE_INSTALL_DIR ${CMAKE_INSTALL_FULL_DATAROOTDIR}/${CMAKE_PROJECT_NAME})
set(FIND_MODULE_DIR ${PACKAGE_INSTALL_DIR}/Find/)
set(GIT_VERSION_MODULE_DIR ${PACKAGE_INSTALL_DIR}/GitVersion/)
set(GLIB_MODULE_DIR ${PACKAGE_INSTALL_DIR}/GLib/)
set(UTILITY_MODULE_DIR ${PACKAGE_INSTALL_DIR}/Utility/)
set(VALA_MODULE_DIR ${PACKAGE_INSTALL_DIR}/Vala/)

install(DIRECTORY Find DESTINATION ${PACKAGE_INSTALL_DIR} USE_SOURCE_PERMISSIONS)
install(DIRECTORY GitVersion DESTINATION ${PACKAGE_INSTALL_DIR} USE_SOURCE_PERMISSIONS)
install(DIRECTORY GLib DESTINATION ${PACKAGE_INSTALL_DIR} USE_SOURCE_PERMISSIONS)
install(DIRECTORY Utility DESTINATION ${PACKAGE_INSTALL_DIR} USE_SOURCE_PERMISSIONS)
install(DIRECTORY Vala DESTINATION ${PACKAGE_INSTALL_DIR} USE_SOURCE_PERMISSIONS)

#
# Config.cmake file
#

include(CMakePackageConfigHelpers)

configure_package_config_file(
    VCMConfig.cmake.in
    ${CMAKE_CURRENT_BINARY_DIR}/VCMConfig.cmake
    INSTALL_DESTINATION
        ${PACKAGE_INSTALL_DIR}
    PATH_VARS
        FIND_MODULE_DIR
        GIT_VERSION_MODULE_DIR
        GLIB_MODULE_DIR
        UTILITY_MODULE_DIR
        VALA_MODULE_DIR
)

write_basic_package_version_file(
    ${CMAKE_CURRENT_BINARY_DIR}/VCMConfigVersion.cmake
    VERSION
        "${PROJECT_VERSION}"
    COMPATIBILITY
        AnyNewerVersion
)

install(
    FILES
        ${CMAKE_CURRENT_BINARY_DIR}/VCMConfig.cmake
        ${CMAKE_CURRENT_BINARY_DIR}/VCMConfigVersion.cmake
    DESTINATION
        ${PACKAGE_INSTALL_DIR}
)

#
# Packaging
#

set (CPACK_PACKAGE_NAME vala-cmake-modules)
set (CPACK_PACKAGE_RELEASE ${PROJECT_VERSION})
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-r${CPACK_PACKAGE_RELEASE}")
set (CPACK_SOURCE_IGNORE_FILES "/VCMSubmodule.cmake;/build/;/.gitmodules;/.git;/.gitignore;~$;${CPACK_SOURCE_IGNORE_FILES}")
set (CPACK_SOURCE_GENERATOR "TXZ")
include (CPack)
add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)



#
# Feature summary
#

feature_summary(
    FATAL_ON_MISSING_REQUIRED_PACKAGES
    WHAT ALL
)