forked from rpm-software-management/hawkey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
63 lines (53 loc) · 2.19 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
PROJECT (hawkey)
CMAKE_MINIMUM_REQUIRED (VERSION 2.4)
CMAKE_POLICY (SET CMP0005 OLD)
INCLUDE (${CMAKE_SOURCE_DIR}/VERSION.cmake)
SET (VERSION "${HAWKEY_MAJOR}.${HAWKEY_MINOR}.${HAWKEY_PATCH}")
include (CheckSymbolExists)
list (APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
check_symbol_exists (FNM_CASEFOLD "fnmatch.h" HAS_FNM_CASEFOLD)
if (NOT HAS_FNM_CASEFOLD)
message (SEND_ERROR "FNM_CASEFOLD is not available")
endif ()
add_definitions (-D_GNU_SOURCE)
INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR})
OPTION (ENABLE_SOLV_URPMREORDER "Build with support for URPM-like solution reordering?" OFF)
IF (ENABLE_SOLV_URPMREORDER)
ADD_DEFINITIONS(-DLIBSOLV_FLAG_URPMREORDER=1)
ENDIF()
if (LIBSOLV_PATH)
INCLUDE_DIRECTORIES (${LIBSOLV_PATH}/build/)
FIND_LIBRARY (SOLV_LIBRARY NAMES solv PATHS ${LIBSOLV_PATH}/build/src NO_DEFAULT_PATH)
FIND_LIBRARY (SOLVEXT_LIBRARY NAMES solvext PATHS ${LIBSOLV_PATH}/build/ext NO_DEFAULT_PATH)
ADD_CUSTOM_COMMAND (OUTPUT ${LIBSOLV_PATH}/build/solv
COMMAND mkdir -p ${LIBSOLV_PATH}/build/solv
COMMAND cp ${LIBSOLV_PATH}/src/*.h ${LIBSOLV_PATH}/build/solv
COMMAND cp ${LIBSOLV_PATH}/ext/*.h ${LIBSOLV_PATH}/build/solv
COMMAND cp ${LIBSOLV_PATH}/build/src/*.h ${LIBSOLV_PATH}/build/solv)
ADD_CUSTOM_TARGET (generate_libsolv_includes ALL DEPENDS ${LIBSOLV_PATH}/build/solv)
endif (LIBSOLV_PATH)
SET (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
FIND_PACKAGE (EXPAT REQUIRED)
FIND_PACKAGE (ZLIB REQUIRED)
FIND_LIBRARY (RPMDB_LIBRARY NAMES rpmdb)
FIND_LIBRARY (SOLV_LIBRARY NAMES solv)
FIND_LIBRARY (SOLVEXT_LIBRARY NAMES solvext)
FIND_LIBRARY (CHECK_LIBRARY NAMES check)
FIND_PROGRAM (VALGRIND_PROGRAM NAMES valgrind PATH /usr/bin /usr/local/bin)
MESSAGE(STATUS "Using libsolv at ${SOLV_LIBRARY}")
if (NOT PYTHON_DESIRED)
set (PYTHON_DESIRED "2")
endif()
# rpm:
FIND_LIBRARY (RPMDB_LIBRARY NAMES rpmdb)
IF (NOT RPMDB_LIBRARY)
FIND_LIBRARY (RPMDB_LIBRARY NAMES rpm)
ENDIF (NOT RPMDB_LIBRARY)
FIND_LIBRARY (RPMIO_LIBRARY NAMES rpmio)
IF (RPMIO_LIBRARY)
SET(RPMDB_LIBRARY ${RPMIO_LIBRARY} ${RPMDB_LIBRARY})
ENDIF (RPMIO_LIBRARY)
ADD_SUBDIRECTORY (src)
ENABLE_TESTING()
ADD_SUBDIRECTORY (tests)
ADD_SUBDIRECTORY (doc)