1
0
mirror of https://github.com/openSUSE/libsolv.git synced 2026-02-05 12:45:46 +01:00

- make sure to link against the lzma library if ENABLE_LZMA_COMPRESSION is set

This commit is contained in:
Michael Schroeder
2012-04-02 13:41:10 +02:00
parent ab13d4e340
commit d1275e7fcc
5 changed files with 37 additions and 0 deletions

View File

@@ -55,6 +55,9 @@ INCLUDE (${CMAKE_SOURCE_DIR}/VERSION.cmake)
FIND_PACKAGE (EXPAT REQUIRED)
FIND_PACKAGE (ZLIB REQUIRED)
IF (ENABLE_LZMA_COMPRESSION)
FIND_PACKAGE (LZMA REQUIRED)
ENDIF (ENABLE_LZMA_COMPRESSION)
IF (FEDORA)
MESSAGE(STATUS "Building for Fedora")

View File

@@ -1,5 +1,8 @@
# as we link with --as-needed we do not get bogus dependencies
SET (SYSTEM_LIBRARIES ${EXPAT_LIBRARY} ${ZLIB_LIBRARY})
IF (ENABLE_LZMA_COMPRESSION)
SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${LZMA_LIBRARY})
ENDIF (ENABLE_LZMA_COMPRESSION)
IF (NOT DEBIAN)
SET (SYSTEM_LIBRARIES ${RPMDB_LIBRARY} ${SYSTEM_LIBRARIES})
ENDIF (NOT DEBIAN)

View File

@@ -0,0 +1,25 @@
# - Find lzma
# Find the native LZMA headers and library
#
# LZMA_INCLUDE_DIR - where to find lzma.h, etc.
# LZMA_LIBRARIES - List of libraries when using liblzma.
# LZMA_FOUND - True if liblzma found.
IF (LZMA_INCLUDE_DIR)
# Already in cache, be silent
SET(LZMA_FIND_QUIETLY TRUE)
ENDIF (LZMA_INCLUDE_DIR)
FIND_PATH(LZMA_INCLUDE_DIR lzma.h)
FIND_LIBRARY(LZMA_LIBRARY NAMES lzma liblzma)
# handle the QUIETLY and REQUIRED arguments and set LZMA_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZMA DEFAULT_MSG LZMA_LIBRARY LZMA_INCLUDE_DIR)
IF(LZMA_FOUND)
SET( LZMA_LIBRARIES ${LZMA_LIBRARY} )
ELSE(LZMA_FOUND)
SET( LZMA_LIBRARIES )
ENDIF(LZMA_FOUND)

View File

@@ -1,5 +1,8 @@
# as we link with --as-needed we do not get bogus dependencies
SET (SYSTEM_LIBRARIES ${EXPAT_LIBRARY} ${ZLIB_LIBRARY})
IF (ENABLE_LZMA_COMPRESSION)
SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${LZMA_LIBRARY})
ENDIF (ENABLE_LZMA_COMPRESSION)
IF (NOT DEBIAN)
SET (SYSTEM_LIBRARIES ${RPMDB_LIBRARY} ${SYSTEM_LIBRARIES})
ENDIF (NOT DEBIAN)

View File

@@ -6,6 +6,9 @@ ADD_LIBRARY (toolstuff STATIC common_write.c)
# as we link with --as-needed we do not get bogus dependencies
SET (SYSTEM_LIBRARIES ${EXPAT_LIBRARY} ${ZLIB_LIBRARY})
IF (ENABLE_LZMA_COMPRESSION)
SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${LZMA_LIBRARY})
ENDIF (ENABLE_LZMA_COMPRESSION)
IF (ENABLE_RPMDB)
SET (SYSTEM_LIBRARIES ${RPMDB_LIBRARY} ${SYSTEM_LIBRARIES})
ENDIF (ENABLE_RPMDB)