This repository has been archived by the owner on Jul 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
135 lines (120 loc) · 4.54 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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# "Build" script for my paludis-hooks package
# Copyright 2012-2017 by Alex Turbov <i.zaufi@gmail.com>
#
cmake_minimum_required(VERSION 3.4)
project(paludis-hooks VERSION 1.3 LANGUAGES NONE)
option(WITH_AUTOPATCH "Install autopatch hook" ON)
option(WITH_FS_MANAGER "Install filesystem manager hook" ON)
option(WITH_PACKAGE_ENV "Install per package environment manager" ON)
option(WITH_PYTHON_EXTENSIONS "Install some `cave` aux commands" AUTO)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")
# seek for xmllint to validate our XML files
find_program(XMLLINT_EXECUTABLE xmllint REQUIRED)
# check if xsltproc is even installed
find_program(XSLTPROC_EXECUTABLE xsltproc REQUIRED)
# `diff` is needed for some unit tests
find_program(DIFF_EXECUTABLE diff)
# python interpreter is needed for some optional scripts
if(WITH_PYTHON_EXTENSIONS AND (WITH_PYTHON_EXTENSIONS STREQUAL ON OR WITH_PYTHON_EXTENSIONS STREQUAL AUTO))
find_package(PythonInterp)
if(NOT PYTHONINTERP_FOUND)
if(WITH_PYTHON_EXTENSIONS STREQUAL AUTO)
message(STATUS "Python scripts will not be installed")
elseif(WITH_PYTHON_EXTENSIONS STREQUAL ON)
message(FATAL_ERROR "Python extensions has requested, but interpreter not found")
endif()
endif()
endif()
# Define install destination dirs
# ATTENTION Define CMAKE_SIZEOF_VOID_P to some not important value
# to suppress a warning from GNUInstallDirs...
set(CMAKE_SIZEOF_VOID_P 8)
include(GNUInstallDirs)
# For tests
include(CTest)
include(AddShellFunctionsTest)
# Autopatch hook
if(WITH_AUTOPATCH)
configure_file(auto-patch/auto-patch.bash.in auto-patch/auto-patch.bash @ONLY)
configure_file(auto-patch/auto-patch.conf.in auto-patch/auto-patch.conf @ONLY)
install(
PROGRAMS "${CMAKE_BINARY_DIR}/auto-patch/auto-patch.bash"
DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/paludis-hooks"
)
install(
FILES "${CMAKE_BINARY_DIR}/auto-patch/auto-patch.conf"
DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/paludis/hooks/configs"
)
endif()
# Filesystem manager hook
if(WITH_FS_MANAGER)
add_subdirectory(filesystem-manager)
endif()
# Package environment configurator
if(WITH_PACKAGE_ENV)
configure_file(package.env/setup_pkg_env.bash.in package.env/setup_pkg_env.bash @ONLY)
install(
FILES "${CMAKE_BINARY_DIR}/package.env/setup_pkg_env.bash"
DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/paludis-hooks"
)
install(
FILES
package.env/default-deps-trk.conf
package.env/default-silent-rules.conf
package.env/extra-optimize.conf
package.env/ld-no-gc-sections.conf
package.env/ld-no-hash-style.conf
package.env/ld-no-new-dtags.conf
package.env/ld-no-sort-common.conf
package.env/lto.conf
package.env/max-debug.conf
package.env/no-debug.conf
package.env/no-modern-c++.conf
package.env/no-gnu-tls.conf
package.env/no-lto.conf
package.env/spam.conf
package.env/use-bfd-linker.conf
package.env/use-gold-linker.conf
package.env/use-latest-gcc.conf
package.env/use-modern-c++.conf
DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/paludis/env.conf.d"
)
endif()
# In Memory Build hook
if(WITH_WORKDIR_TMPFS)
configure_file(workdir-tmpfs/workdir-tmpfs.bash.in workdir-tmpfs/workdir-tmpfs.bash @ONLY)
configure_file(workdir-tmpfs/workdir-tmpfs.conf.in workdir-tmpfs/workdir-tmpfs.conf @ONLY)
install(
PROGRAMS "${CMAKE_BINARY_DIR}/workdir-tmpfs/workdir-tmpfs.bash"
DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/paludis-hooks"
)
install(
FILES "${CMAKE_BINARY_DIR}/workdir-tmpfs/workdir-tmpfs.conf"
DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/paludis/hooks/configs"
)
endif()
# Some other helpers...
install(
FILES profile.d/00-make-completion-wrapper.sh profile.d/cave-aliases.sh
DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/profile.d"
)
install(
FILES env.d/90cave
DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/env.d"
)
if(PYTHONINTERP_FOUND)
install(
PROGRAMS print-ebuild-path
DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/cave/commands"
)
install(
FILES profile.d/cave-addons.sh
DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/profile.d"
)
endif()
# Docs (not much)
install(
FILES ChangeLog.md LICENSE README.md
DESTINATION "${CMAKE_INSTALL_FULL_DOCDIR}"
)
# vim:ts=4:expandtab: