-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
36 lines (26 loc) · 950 Bytes
/
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 (libdnf)
MESSAGE ("Running CMake on libdnf...")
CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 -Wall -Wextra -Werror -Wno-unused-parameter -fPIC")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Werror -Wno-unused-parameter -fPIC")
include (CheckSymbolExists)
set(CMAKE_MACOSX_RPATH 0) # to disable MAC OS warnings
if (NOT PYTHON_DESIRED)
set (PYTHON_DESIRED "3")
endif()
if (${PYTHON_DESIRED} STREQUAL "2")
message("Building for python2")
FIND_PACKAGE (PythonInterp 2 REQUIRED)
FIND_PACKAGE (PythonLibs 2 REQUIRED)
else()
message("Building for python3")
FIND_PACKAGE(PythonInterp 3 REQUIRED)
FIND_PACKAGE(PythonLibs 3 REQUIRED)
endif()
SET(COMMON_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
INCLUDE_DIRECTORIES ("libdnf")
ADD_SUBDIRECTORY ("libdnf")
ADD_SUBDIRECTORY ("doc")
# configure tests
ENABLE_TESTING ()
ADD_SUBDIRECTORY ("tests")