forked from rpm-software-management/dnf-plugins-extras
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
40 lines (33 loc) · 1.26 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
PROJECT (dnf-plugins-extras NONE)
CMAKE_MINIMUM_REQUIRED (VERSION 2.4)
IF (NOT PYTHON_DESIRED)
FIND_PACKAGE (PythonInterp REQUIRED)
ELSEIF (${PYTHON_DESIRED} STREQUAL "2")
FIND_PACKAGE (PythonInterp 2 EXACT REQUIRED)
ELSEIF (${PYTHON_DESIRED} STREQUAL "3")
FIND_PACKAGE (PythonInterp 3 EXACT REQUIRED)
ELSEIF (EXISTS ${PYTHON_DESIRED})
SET (PYTHON_EXECUTABLE ${PYTHON_DESIRED})
FIND_PACKAGE (PythonInterp REQUIRED)
ELSE ()
MESSAGE (FATAL_ERROR "Invalid PYTHON_DESIRED value: " ${PYTHON_DESIRED})
ENDIF()
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib())" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}")
SET (SYSCONFDIR /etc)
find_package (PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_search_module (SYSTEMD systemd)
if (SYSTEMD_FOUND)
execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=systemdsystemunitdir systemd
OUTPUT_VARIABLE SYSTEMD_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif ()
endif()
if (NOT SYSTEMD_DIR)
set (SYSTEMD_DIR /usr/lib/systemd/system)
endif ()
ADD_SUBDIRECTORY (doc)
ADD_SUBDIRECTORY (etc)
ADD_SUBDIRECTORY (plugins)
ADD_SUBDIRECTORY (po)