Hi

In attachment a patch and the file FindLibLZMA.cmake

If you think this module can be integrate in cmake and if you can give me the 
write access in cmake, i can integrate and maintain this.

What do you think about this ?

Best Regards
Mario
>From 281ccf37cc4e8c1d4924ff58e38231cd7799ffab Mon Sep 17 00:00:00 2001
From: Mario Bensi <[email protected]>
Date: Sun, 6 May 2012 14:07:22 +0200
Subject: [PATCH] Add LZMA Module

---
 Modules/FindLibLZMA.cmake |   45 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)
 create mode 100644 Modules/FindLibLZMA.cmake

diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake
new file mode 100644
index 0000000..1a341b2
--- /dev/null
+++ b/Modules/FindLibLZMA.cmake
@@ -0,0 +1,45 @@
+# - Find LibLZMA
+# Find LibLZMA headers and library
+#
+#  LIBLZMA_FOUND             - True if liblzma is found.
+#  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).
+#  LIBLZMA_HAS_LZMA_PRESET   - True if lzma_lzma_preset() is found (required).
+
+
+# Copyright (c) 2008, Per Øyvind Karlsen, <[email protected]>
+# Copyright (c) 2009, Alexander Neundorf, <[email protected]>
+# Copyright (c) 2009, Helio Chissini de Castro, <[email protected]>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+FIND_PATH(LIBLZMA_INCLUDE_DIR lzma.h )
+FIND_LIBRARY(LIBLZMA_LIBRARY lzma)
+
+SET(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
+SET(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})
+
+
+# We're using new code known now as XZ, even library still been called LZMA
+# it can be found in http://tukaani.org/xz/
+# Avoid using old codebase
+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)
+ENDIF (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 )
-- 
1.7.7
# - Find LibLZMA
# Find LibLZMA headers and library
#
#  LIBLZMA_FOUND             - True if liblzma is found.
#  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).
#  LIBLZMA_HAS_LZMA_PRESET   - True if lzma_lzma_preset() is found (required).


# Copyright (c) 2008, Per Øyvind Karlsen, <[email protected]>
# Copyright (c) 2009, Alexander Neundorf, <[email protected]>
# Copyright (c) 2009, Helio Chissini de Castro, <[email protected]>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.


FIND_PATH(LIBLZMA_INCLUDE_DIR lzma.h )
FIND_LIBRARY(LIBLZMA_LIBRARY lzma)

SET(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
SET(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})


# We're using new code known now as XZ, even library still been called LZMA
# it can be found in http://tukaani.org/xz/
# Avoid using old codebase
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)
ENDIF (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 )
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to