File: CMakeLists.txt

package info (click to toggle)
pkg-kde-tools 0.15.32
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 752 kB
  • sloc: perl: 4,178; ansic: 628; sh: 481; python: 48; makefile: 1
file content (99 lines) | stat: -rw-r--r-- 3,258 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
project(pkg-kde-tools)
# 2.6.4 has PERL_VENDORLIB
cmake_minimum_required(VERSION 2.6.4)

# Find required perl bits
find_package(PerlLibs)
if (PERL_VENDORLIB AND PERL_EXECUTABLE)
    MESSAGE(STATUS "Perl VendorLib: ${PERL_VENDORLIB}")
else (PERL_VENDORLIB AND PERL_EXECUTABLE)
    MESSAGE(FATAL_ERROR "Unable to determine vendorlib. Perl was not found?")
endif (PERL_VENDORLIB AND PERL_EXECUTABLE)

find_program(POD2MAN pod2man)
if (NOT POD2MAN)
    MESSAGE(FATAL_ERROR "pod2man is required to build this package")
endif (NOT POD2MAN)

set(BIN_INSTALL_DIR bin CACHE PATH "Binary/script installation directory")
set(LIB_INSTALL_DIR lib CACHE PATH "Library installation directory")
set(DATA_INSTALL_DIR share/${CMAKE_PROJECT_NAME} CACHE PATH "Data file installation directory")
set(DATALIB_INSTALL_DIR "${DATA_INSTALL_DIR}/lib")
set(MAN_INSTALL_DIR share/man CACHE PATH "Manual page installation directory")
set(INCLUDE_INSTALL_DIR include CACHE PATH "Header file installation directory")
option(DISABLE_TESTS "Disable ${CMAKE_PROJECT_NAME} tests" OFF)

# Function for building & installing manual pages generated from PODs
function(install_pod_manpages section)
    foreach (pod ${ARGN})
        set(man "${CMAKE_CURRENT_BINARY_DIR}/${pod}.${section}")
        add_custom_command(OUTPUT "${man}"
            COMMAND ${POD2MAN} "${CMAKE_CURRENT_SOURCE_DIR}/${pod}" "${man}"
            MAIN_DEPENDENCY ${pod})
        get_filename_component(podfilename ${pod} NAME)
        add_custom_target(pod2man_${pod} ALL DEPENDS ${man}
            COMMENT "Building manual page for ${pod}" SOURCES ${pod})
        install(FILES ${man} DESTINATION "${MAN_INSTALL_DIR}/man${section}"
                             COMPONENT Documentation)
    endforeach (pod ${ARGN})
endfunction(install_pod_manpages section)

# Install data & arch-indep library bundles
install(DIRECTORY cmake makefiles qt-kde-team
        DESTINATION ${DATA_INSTALL_DIR}
        USE_SOURCE_PERMISSIONS
        COMPONENT Programs)

install(DIRECTORY vcslib/
    DESTINATION ${DATA_INSTALL_DIR}/vcs
    USE_SOURCE_PERMISSIONS
    COMPONENT Programs)

install(DIRECTORY datalib/
    DESTINATION ${DATALIB_INSTALL_DIR}
    USE_SOURCE_PERMISSIONS
    COMPONENT Programs)

install(DIRECTORY perllib/
    DESTINATION ${PERL_VENDORLIB}
    COMPONENT Programs
    FILES_MATCHING PATTERN "*.pm")

# Install debhelper helpers programs
install(PROGRAMS
    dh_movelibkdeinit
    dh_qmlcdeps
    dh_sameversiondep
    dh_sodeps
    DESTINATION ${BIN_INSTALL_DIR}
    COMPONENT Programs
)
install_pod_manpages(1 dh_movelibkdeinit dh_qmlcdeps dh_sameversiondep dh_sodeps)

# Install pkgkde binaries
install(PROGRAMS
    pkgkde-debs2symbols
    pkgkde-gensymbols
    pkgkde-getbuildlogs
    pkgkde-mark-private-symbols
    pkgkde-mark-qt5-private-symbols
    pkgkde-override-sc-dev-latest
    pkgkde-symbolshelper
    pkgkde-vcs
    pkgkde-git
    DESTINATION ${BIN_INSTALL_DIR}
    COMPONENT Programs)
install_pod_manpages(1 pkgkde-override-sc-dev-latest)

# Install raw manpages
install(DIRECTORY man1
    DESTINATION ${MAN_INSTALL_DIR}
    COMPONENT Documentation)

# Build dlrestrictions
add_subdirectory(dlrestrictions)

if (NOT DISABLE_TESTS)
    enable_testing()
    add_subdirectory(t)
endif (NOT DISABLE_TESTS)