forked from rpm-software-management/dnf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
39 lines (33 loc) · 1.78 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
PROJECT (dnf NONE)
CMAKE_MINIMUM_REQUIRED (VERSION 2.4)
INCLUDE (${CMAKE_SOURCE_DIR}/VERSION.cmake)
SET( SYSCONFDIR /etc)
SET( SYSTEMD_DIR /usr/lib/systemd/system)
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 sysconfig import get_path; stdout.write(get_path('purelib'))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
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_VERSION_MAJOR} @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/bin/dnf-automatic.in ${CMAKE_SOURCE_DIR}/bin/dnf-automatic-${PYTHON_VERSION_MAJOR} @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/dnf/const.py.in ${CMAKE_SOURCE_DIR}/dnf/const.py @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/dnf/cli/completion_helper.py.in ${CMAKE_SOURCE_DIR}/dnf/cli/completion_helper.py @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/tests/modules/etc/dnf/repos.d/test.repo.in ${CMAKE_SOURCE_DIR}/tests/modules/etc/dnf/repos.d/test.repo @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/tests/modules/etc/dnf/dnf.conf.in ${CMAKE_SOURCE_DIR}/tests/modules/etc/dnf/dnf.conf @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/doc/conf.py.in ${CMAKE_SOURCE_DIR}/doc/conf.py @ONLY)