File: CMakeLists.txt

package info (click to toggle)
pxe-kexec 0.2.4-3
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch, wheezy
  • size: 1,216 kB
  • ctags: 472
  • sloc: cpp: 3,030; ansic: 349; sh: 15; makefile: 4
file content (78 lines) | stat: -rw-r--r-- 2,013 bytes parent folder | download
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
#
# (c) 2009, Bernhard Walle <bernhard@bwalle.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

add_executable(pxe-kexec
        kexec.cc
        pxeparser.cc
        downloader.cc
        main.cc
        process.cc
        networkhelper.cc
        console.cc
        pxekexec.cc
        linuxdb.cc
        ext/rpmvercmp.c)
target_link_libraries(pxe-kexec ${EXTRA_LIBS})

INSTALL(
    TARGETS
        pxe-kexec
    DESTINATION
        sbin
)

INSTALL(
    FILES
        ${CMAKE_CURRENT_BINARY_DIR}/pxe-kexec.8.gz
    DESTINATION
        ${MANDIR}/man8
)


ADD_CUSTOM_COMMAND(
    OUTPUT
        ${CMAKE_CURRENT_BINARY_DIR}/pxe-kexec.8.gz
    COMMAND
        ${POD2MAN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/pxe-kexec.pod
        --center="PXE-Kexec"
        --release=${PACKAGE_VERSION}
        --section=8
        ${CMAKE_CURRENT_BINARY_DIR}/pxe-kexec.8 &&
        rm -f ${CMAKE_CURRENT_SOURCE_DIR}/pxe-kexec.8.xml &&
        gzip -f ${CMAKE_CURRENT_BINARY_DIR}/pxe-kexec.8
    DEPENDS
        ${CMAKE_CURRENT_SOURCE_DIR}/pxe-kexec.pod
    WORKING_DIRECTORY
        ${CMAKE_CURRENT_BINARY_DIR}
)

#
# always build the manpages before building the program
ADD_DEPENDENCIES(
    pxe-kexec
    manpages
)

#
# we need to make a target out of the two ADD_CUSTOM_COMMAND() calls
# because otherwise cmake ignores the manpages
ADD_CUSTOM_TARGET(
    manpages
    DEPENDS
        ${CMAKE_CURRENT_BINARY_DIR}/pxe-kexec.8.gz
)