KDE/kdelibs
Alexander Neundorf
neundorf at kde.org
Wed Apr 29 20:06:40 CEST 2009
SVN commit 961236 by neundorf:
-fix FindLibLZMA.cmake, so it sets the variables according to our conventions (http://techbase.kde.org/Policies/CMake_Coding_Style)
and works also without pkg-config
-fix kdecore/CMakeLists.txt accordingly
Alex
CCMAIL: kde-buildsystem at kde.org
M +26 -19 cmake/modules/FindLibLZMA.cmake
M +1 -2 kdecore/CMakeLists.txt
--- trunk/KDE/kdelibs/cmake/modules/FindLibLZMA.cmake #961235:961236
@@ -2,7 +2,7 @@
# Find LibLZMA headers and library
#
# LIBLZMA_FOUND - True if liblzma is found.
-# LIBLZMA_INCLUDE_DIR - Directory where liblzma headers are located.
+# LIBLZMA_INCLUDE_DIRS - Directory where liblzma headers are located.
# LIBLZMA_LIBRARIES - Lzma libraries to link against.
# LIBLZMA_HAS_AUTO_DECODER - True if lzma_auto_decoder() is found (required).
# LIBLZMA_HAS_EASY_ENCODER - True if lzma_easy_encoder() is found (required).
@@ -10,30 +10,37 @@
# Copyright (c) 2008, Per Øyvind Karlsen, <peroyvind at mandriva.org>
+# Copyright (c) 2009, Alexander Neundorf, <neundorf at kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-IF (LIBLZMA_INCLUDE_DIRS AND LIBLZMA_LIBRARIES)
- SET(LIBLZMA_FIND_QUIETLY TRUE)
-ENDIF (LIBLZMA_INCLUDE_DIRS AND LIBLZMA_LIBRARIES)
+FIND_PATH(LIBLZMA_INCLUDE_DIR lzmadec.h )
+FIND_LIBRARY(LIBLZMA_LIBRARY lzmadec)
-IF (NOT WIN32)
- INCLUDE(FindPkgConfig)
- PKG_SEARCH_MODULE(LIBLZMA liblzma)
- ELSE (NOT WIN32)
- FIND_PATH(LIBLZMA_INCLUDE_DIRS lzma.h )
- FIND_LIBRARY(LIBLZMA_LIBRARIES NAMES lzma )
- INCLUDE(FindPackageHandleStandardArgs)
- FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBLZMA DEFAULT_MSG LIBLZMA_INCLUDE_DIRS LIBLZMA_LIBRARIES)
-ENDIF (NOT WIN32)
+SET(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
+SET(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})
-IF (LIBLZMA_FOUND)
+
+# what's up with the following tests ?
+# I downloaded, built and installed the lzma-4.32.7 source package directly
+# from http://tukaani.org/lzma/download and they resulting library doesn't have
+# these symbols. Also "grep -R auto_decoder *" gives no results.
+# Where should they come frome ? Alex
+IF (LIBLZMA_LIBRARIES)
INCLUDE(CheckLibraryExists)
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARIES} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER)
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARIES} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER)
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARIES} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET)
- IF (NOT LIBLZMA_HAS_AUTO_DECODER AND LIBLZMA_HAS_EASY_ENCODER AND LIBLZMA_HAS_LZMA_PRESET)
- SET(LIBLZMA_FOUND FALSE)
- ENDIF(NOT LIBLZMA_HAS_AUTO_DECODER AND LIBLZMA_HAS_EASY_ENCODER AND LIBLZMA_HAS_LZMA_PRESET)
-ENDIF (LIBLZMA_FOUND)
+ENDIF (LIBLZMA_LIBRARIES)
-MARK_AS_ADVANCED( LIBLZMA_INCLUDE_DIRS LIBLZMA_LIBRARIES )
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBLZMA DEFAULT_MSG LIBLZMA_INCLUDE_DIR
+ LIBLZMA_LIBRARY
+ LIBLZMA_HAS_AUTO_DECODER
+ LIBLZMA_HAS_EASY_ENCODER
+ LIBLZMA_HAS_LZMA_PRESET
+ )
+
+MARK_AS_ADVANCED( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
--- trunk/KDE/kdelibs/kdecore/CMakeLists.txt #961235:961236
@@ -43,8 +43,7 @@
# compile lzma support if available
if(LIBLZMA_FOUND)
- include_directories(${LIBLZMA_INCLUDEDIR})
- link_directories(${LIBLZMA_LIBRARY_DIRS})
+ include_directories(${LIBLZMA_INCLUDE_DIRS})
set(kdecore_OPTIONAL_SRCS ${kdecore_OPTIONAL_SRCS} compression/kxzfilter.cpp )
set(kdecore_OPTIONAL_LIBS ${kdecore_OPTIONAL_LIBS} ${LIBLZMA_LIBRARIES})
endif(LIBLZMA_FOUND)
More information about the Kde-buildsystem
mailing list