forked from rpm-software-management/dnf
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
36 lines (29 loc) · 1.38 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
PROJECT (dnf NONE)
CMAKE_MINIMUM_REQUIRED (VERSION 2.4)
INCLUDE (${CMAKE_SOURCE_DIR}/VERSION.cmake)
if (NOT PYTHON_DESIRED)
set (PYTHON_DESIRED "2")
endif()
SET( SYSCONFDIR /etc)
SET( SYSTEMD_DIR /usr/lib/systemd/system)
if (${PYTHON_DESIRED} STREQUAL "2")
FIND_PACKAGE (PythonInterp REQUIRED)
else()
SET(Python_ADDITIONAL_VERSIONS 3.3)
FIND_PACKAGE(PythonLibs 3.0)
FIND_PACKAGE(PythonInterp 3.0 REQUIRED)
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)
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write('%s.%s' % (sys.version_info.major, sys.version_info.minor))" OUTPUT_VARIABLE PYTHON_MAJOR_DOT_MINOR_VERSION)
MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}")
ADD_SUBDIRECTORY (dnf)
ADD_SUBDIRECTORY (bin)
ADD_SUBDIRECTORY (etc)
ADD_SUBDIRECTORY (doc)
ADD_SUBDIRECTORY (po)
ENABLE_TESTING()
ADD_SUBDIRECTORY (tests)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/bin/dnf.in ${CMAKE_SOURCE_DIR}/bin/dnf-${PYTHON_DESIRED} @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/bin/dnf-automatic.in ${CMAKE_SOURCE_DIR}/bin/dnf-automatic-${PYTHON_DESIRED} @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/bin/yum.in ${CMAKE_SOURCE_DIR}/bin/yum @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/dnf/const.py.in ${CMAKE_SOURCE_DIR}/dnf/const.py @ONLY)