forked from rpm-software-management/dnf-plugins-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
32 lines (26 loc) · 1.08 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
PROJECT (dnf-plugins-core NONE)
CMAKE_MINIMUM_REQUIRED (VERSION 2.4)
if (NOT WITHOUT_LOCAL)
set (WITHOUT_LOCAL "0")
endif()
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)
ADD_SUBDIRECTORY (libexec)
ADD_SUBDIRECTORY (doc)
ADD_SUBDIRECTORY (etc)
ADD_SUBDIRECTORY (plugins)
ADD_SUBDIRECTORY (po)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/libexec/dnf-utils.in ${CMAKE_SOURCE_DIR}/libexec/dnf-utils-${PYTHON_VERSION_MAJOR} @ONLY)